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

    <schemaVersion>X0306</schemaVersion>

    <documentType>4</documentType>

    <periodOfReport>2022-02-08</periodOfReport>

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

    <reportingOwner>
        <reportingOwnerId>
            <rptOwnerCik>0001718636</rptOwnerCik>
            <rptOwnerName>Trevisan Jason</rptOwnerName>
        </reportingOwnerId>
        <reportingOwnerAddress>
            <rptOwnerStreet1>2 CANAL PARK</rptOwnerStreet1>
            <rptOwnerStreet2>4TH FLOOR</rptOwnerStreet2>
            <rptOwnerCity>CAMBRIDGE</rptOwnerCity>
            <rptOwnerState>MA</rptOwnerState>
            <rptOwnerZipCode>02141</rptOwnerZipCode>
            <rptOwnerStateDescription></rptOwnerStateDescription>
        </reportingOwnerAddress>
        <reportingOwnerRelationship>
            <isDirector>1</isDirector>
            <isOfficer>1</isOfficer>
            <officerTitle>Chief Executive Officer</officerTitle>
        </reportingOwnerRelationship>
    </reportingOwner>

    <nonDerivativeTable>
        <nonDerivativeTransaction>
            <securityTitle>
                <value>Class A Common Stock</value>
            </securityTitle>
            <transactionDate>
                <value>2022-02-08</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>F</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
                <footnoteId id="F1"/>
            </transactionCoding>
            <transactionTimeliness></transactionTimeliness>
            <transactionAmounts>
                <transactionShares>
                    <value>13849</value>
                </transactionShares>
                <transactionPricePerShare>
                    <value>34.88</value>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>D</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>588399</value>
                    <footnoteId id="F2"/>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
        <nonDerivativeHolding>
            <securityTitle>
                <value>Class A Common Stock</value>
            </securityTitle>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>80000</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>I</value>
                </directOrIndirectOwnership>
                <natureOfOwnership>
                    <value>See Footnote</value>
                    <footnoteId id="F3"/>
                </natureOfOwnership>
            </ownershipNature>
        </nonDerivativeHolding>
    </nonDerivativeTable>

    <footnotes>
        <footnote id="F1">Shares withheld for payment of tax liability upon vesting of restricted stock units (&quot;RSUs&quot;).</footnote>
        <footnote id="F2">The Reporting Person previously reported a prior award of performance-based RSUs in Table II of the Form 4 filed by the Reporting Person on February 12, 2021 (the &quot;Prior Form 4&quot;). These awards were amended by the Compensation Committee of the Issuer's Board of Directors on February 8, 2022 to revise the vesting terms thereunder from performance-based to time-based and therefore are being moved to Table I, consistent with prior grants of time-based RSUs by the Issuer to the Reporting Person. The total reported in Column 5 of this Form 4 includes the 126,368 time-based RSUs previously reported as performance-based RSUs in Table II of the Prior Form 4. Each such 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 an employee of the Issuer, 6.25% of the RSUs vested on each of April 1, 2021, July 1, 2021, October 1, 2021 and January 1, 2022, and 6.25% of the RSUs will vest on the last day of each three-month period thereafter until January 1, 2025. Such vesting may be accelerated in connection with a Change of Control (as defined in the Issuer's Omnibus Incentive Compensation Plan).</footnote>
        <footnote id="F3">These shares are held directly by the Trevisan 2021 Grantor Retained Annuity Trust dated March 12, 2021 (the &quot;GRAT&quot;), of which the Reporting Person is trustee. The Reporting Person's children are the beneficiaries of the GRAT.</footnote>
    </footnotes>

    <ownerSignature>
        <signatureName>/s/ Josh Goldstein, as attorney-in-fact</signatureName>
        <signatureDate>2022-02-10</signatureDate>
    </ownerSignature>
</ownershipDocument>
