QuickLinks -- Click here to rapidly navigate through this document

Exhibit 23.1

Consent of Independent Registered Public Accounting Firm

We consent to the reference to our firm under the caption "Experts" and to the use of our report dated June 21, 2017, in Amendment No. 1 to the Registration Statement (Form S-1 No. 333-220495) and related Prospectus of CarGurus, Inc. for the registration of 10,810,000 shares of its Class A common stock.

|  | /s/ Ernst & Young LLP
Boston, Massachusetts September 29, 2017 |  |

QuickLinks

Exhibit 23.1

Consent of Independent Registered Public Accounting Firm