<?xml version="1.0" encoding="utf-8"?>
<xbrl
  xml:lang="en-US"
  xmlns="http://www.xbrl.org/2003/instance"
  xmlns:dei="http://xbrl.sec.gov/dei/2026"
  xmlns:ffd="http://xbrl.sec.gov/ffd/2026"
  xmlns:iso4217="http://www.xbrl.org/2003/iso4217"
  xmlns:link="http://www.xbrl.org/2003/linkbase"
  xmlns:xbrldi="http://xbrl.org/2006/xbrldi"
  xmlns:xlink="http://www.w3.org/1999/xlink">
    <link:schemaRef
      xlink:href="https://xbrl.sec.gov/ffd/2026/ffd-2026.xsd"
      xlink:type="simple"/>
    <context id="c-1">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0001170010</identifier>
        </entity>
        <period>
            <startDate>2026-06-24</startDate>
            <endDate>2026-06-24</endDate>
        </period>
    </context>
    <context id="c-2">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0001170010</identifier>
            <segment>
                <xbrldi:typedMember dimension="ffd:OfferingAxis">
                    <dei:lineNo>1</dei:lineNo>
                </xbrldi:typedMember>
            </segment>
        </entity>
        <period>
            <startDate>2026-06-24</startDate>
            <endDate>2026-06-24</endDate>
        </period>
    </context>
    <unit id="shares">
        <measure>shares</measure>
    </unit>
    <unit id="usd">
        <measure>iso4217:USD</measure>
    </unit>
    <unit id="number">
        <measure>pure</measure>
    </unit>
    <dei:EntityCentralIndexKey contextRef="c-1" id="f-15">0001170010</dei:EntityCentralIndexKey>
    <ffd:FeeExhibitTp contextRef="c-1" id="f-16">EX-FILING FEES</ffd:FeeExhibitTp>
    <ffd:OfferingSctyTitl contextRef="c-2" id="f-17">Common Stock, par value $0.50 per share</ffd:OfferingSctyTitl>
    <ffd:PrevslyPdFlg contextRef="c-2" id="f-18">false</ffd:PrevslyPdFlg>
    <ffd:TtlPrevslyPdAmt contextRef="c-1" decimals="2" id="f-19" unitRef="usd">0</ffd:TtlPrevslyPdAmt>
    <ffd:OffsetTableNa contextRef="c-1" id="f-20">N/A</ffd:OffsetTableNa>
    <ffd:FeeRate contextRef="c-2" decimals="INF" id="f-21" unitRef="number">0.0001381</ffd:FeeRate>
    <ffd:SubmissnTp contextRef="c-1" id="f-1">S-8</ffd:SubmissnTp>
    <ffd:FormTp contextRef="c-1" id="f-2">S-8</ffd:FormTp>
    <dei:EntityRegistrantName contextRef="c-1" id="f-3">CARMAX, INC.</dei:EntityRegistrantName>
    <ffd:OfferingSctyTp contextRef="c-2" id="f-4">Equity</ffd:OfferingSctyTp>
    <ffd:FeesOthrRuleFlg contextRef="c-2" id="f-5">true</ffd:FeesOthrRuleFlg>
    <ffd:AmtSctiesRegd contextRef="c-2" decimals="0" id="f-6" unitRef="shares">1842000</ffd:AmtSctiesRegd>
    <ffd:MaxOfferingPricPerScty contextRef="c-2" decimals="2" id="f-7" unitRef="usd">48.28</ffd:MaxOfferingPricPerScty>
    <ffd:MaxAggtOfferingPric contextRef="c-2" decimals="0" id="f-8" unitRef="usd">88931760</ffd:MaxAggtOfferingPric>
    <ffd:FeeAmt contextRef="c-2" decimals="2" id="f-9" unitRef="usd">12281.48</ffd:FeeAmt>
    <ffd:TtlOfferingAmt contextRef="c-1" decimals="0" id="f-10" unitRef="usd">88931760</ffd:TtlOfferingAmt>
    <ffd:TtlFeeAmt contextRef="c-1" decimals="2" id="f-11" unitRef="usd">12281.48</ffd:TtlFeeAmt>
    <ffd:TtlOffsetAmt contextRef="c-1" decimals="2" id="f-12" unitRef="usd">0.00</ffd:TtlOffsetAmt>
    <ffd:NetFeeAmt contextRef="c-1" decimals="2" id="f-13" unitRef="usd">12281.48</ffd:NetFeeAmt>
    <ffd:OfferingNote contextRef="c-2" id="f-14">&lt;div&gt;&lt;span style="color:#000000;font-family:'Times New Roman',serif;font-size:10pt;font-weight:400;line-height:112%"&gt;(1) The amount of Common Stock registered hereunder shall be deemed to include any additional shares issuable as a result of any stock split, stock dividend or other change in the capitalization of the Registrant.&lt;/span&gt;&lt;/div&gt;(2) Estimated solely for the purposes of calculating the registration fee as contemplated by Rules 457(c) and 457(h)(1) of the Securities Act of 1933, as amended, and based on the average of the high ($49.97) and low ($46.58) per share sales prices of CarMax, Inc. Common Stock reported on the New York Stock Exchange on June 17, 2026.</ffd:OfferingNote>
</xbrl>
