<?xml version="1.0"?>
<ownershipDocument>

    <schemaVersion>X0508</schemaVersion>

    <documentType>4</documentType>

    <periodOfReport>2025-06-04</periodOfReport>

    <issuer>
        <issuerCik>0001494259</issuerCik>
        <issuerName>CarGurus, Inc.</issuerName>
        <issuerTradingSymbol>CARG</issuerTradingSymbol>
    </issuer>

    <reportingOwner>
        <reportingOwnerId>
            <rptOwnerCik>0001186944</rptOwnerCik>
            <rptOwnerName>HICKOK LORI A</rptOwnerName>
        </reportingOwnerId>
        <reportingOwnerAddress>
            <rptOwnerStreet1>1001 BOYLSTON STREET</rptOwnerStreet1>
            <rptOwnerStreet2>16TH FLOOR</rptOwnerStreet2>
            <rptOwnerCity>BOSTON</rptOwnerCity>
            <rptOwnerState>MA</rptOwnerState>
            <rptOwnerZipCode>02115</rptOwnerZipCode>
            <rptOwnerStateDescription></rptOwnerStateDescription>
        </reportingOwnerAddress>
        <reportingOwnerRelationship>
            <isDirector>1</isDirector>
        </reportingOwnerRelationship>
    </reportingOwner>

    <aff10b5One>0</aff10b5One>

    <nonDerivativeTable>
        <nonDerivativeTransaction>
            <securityTitle>
                <value>Class A Common Stock</value>
            </securityTitle>
            <transactionDate>
                <value>2025-06-04</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>A</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
                <footnoteId id="F1"/>
            </transactionCoding>
            <transactionTimeliness></transactionTimeliness>
            <transactionAmounts>
                <transactionShares>
                    <value>6248</value>
                </transactionShares>
                <transactionPricePerShare>
                    <value>0</value>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>A</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>46915</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
    </nonDerivativeTable>

    <footnotes>
        <footnote id="F1">Represents shares issuable upon settlement of restricted stock units (&quot;RSUs&quot;) granted to the Reporting Person. Each RSU represents a contingent right to receive one share of the Issuer's Class A common stock. Subject to the Reporting Person's continuous service as a director of the Issuer, 100% of the RSUs will vest on the first anniversary of the grant date. Such vesting may be accelerated in connection with a Change in Control (as defined in the Issuer's Omnibus Incentive Compensation Plan).</footnote>
    </footnotes>

    <ownerSignature>
        <signatureName>/s/ Suzanne Murray, as attorney-in-fact</signatureName>
        <signatureDate>2025-06-06</signatureDate>
    </ownerSignature>
</ownershipDocument>
