EXHIBIT 23.1
Consent of Independent Registered Public Accounting Firm
We consent to the incorporation by reference in the registration statements (No. 333-273031, 333-239438, 333-232394, 333-212310, 333-183594, 333-160912, 333-152717, 333-135701, 333-127486, and 333-100311) on Form S-8 of our reports dated April 15, 2024, with respect to the consolidated financial statements of CarMax, Inc. and the effectiveness of internal control over financial reporting.

/s/ KPMG LLP

Richmond, Virginia
April 15, 2024