<?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/2025"
  xmlns:ffd="http://xbrl.sec.gov/ffd/2025"
  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/2025/ffd-2025.xsd"
      xlink:type="simple"/>
    <context id="c-1">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0001577526</identifier>
        </entity>
        <period>
            <startDate>2026-06-23</startDate>
            <endDate>2026-06-23</endDate>
        </period>
    </context>
    <context id="c-2">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0001577526</identifier>
            <segment>
                <xbrldi:typedMember dimension="ffd:OfferingAxis">
                    <dei:lineNo>1</dei:lineNo>
                </xbrldi:typedMember>
            </segment>
        </entity>
        <period>
            <startDate>2026-06-23</startDate>
            <endDate>2026-06-23</endDate>
        </period>
    </context>
    <context id="c-3">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0001577526</identifier>
            <segment>
                <xbrldi:typedMember dimension="ffd:OfferingAxis">
                    <dei:lineNo>2</dei:lineNo>
                </xbrldi:typedMember>
            </segment>
        </entity>
        <period>
            <startDate>2026-06-23</startDate>
            <endDate>2026-06-23</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-29">0001577526</dei:EntityCentralIndexKey>
    <ffd:FeeExhibitTp contextRef="c-1" id="f-30">EX-FILING FEES</ffd:FeeExhibitTp>
    <ffd:AmtSctiesRegd contextRef="c-2" decimals="0" id="f-31" unitRef="shares">10360509</ffd:AmtSctiesRegd>
    <ffd:MaxOfferingPricPerScty contextRef="c-2" decimals="2" id="f-32" unitRef="usd">10.12</ffd:MaxOfferingPricPerScty>
    <ffd:AmtSctiesRegd contextRef="c-3" decimals="0" id="f-33" unitRef="shares">1480072</ffd:AmtSctiesRegd>
    <ffd:MaxOfferingPricPerScty contextRef="c-3" decimals="2" id="f-34" unitRef="usd">8.61</ffd:MaxOfferingPricPerScty>
    <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">C3.ai, Inc.</dei:EntityRegistrantName>
    <ffd:PrevslyPdFlg contextRef="c-2" id="f-4">false</ffd:PrevslyPdFlg>
    <ffd:OfferingSctyTp contextRef="c-2" id="f-5">Equity</ffd:OfferingSctyTp>
    <ffd:OfferingSctyTitl contextRef="c-2" id="f-6">Class A common stock, par value $0.001 per share, C3.ai, Inc. 2020 Equity Incentive Plan</ffd:OfferingSctyTitl>
    <ffd:FeesOthrRuleFlg contextRef="c-2" id="f-7">true</ffd:FeesOthrRuleFlg>
    <ffd:AmtSctiesRegd contextRef="c-2" decimals="0" id="f-8" unitRef="shares">10360509</ffd:AmtSctiesRegd>
    <ffd:MaxOfferingPricPerScty contextRef="c-2" decimals="2" id="f-9" unitRef="usd">10.12</ffd:MaxOfferingPricPerScty>
    <ffd:MaxAggtOfferingPric contextRef="c-2" decimals="2" id="f-10" unitRef="usd">104848351.08</ffd:MaxAggtOfferingPric>
    <ffd:FeeRate contextRef="c-2" decimals="8" id="f-11" unitRef="number">0.0001381</ffd:FeeRate>
    <ffd:FeeAmt contextRef="c-2" decimals="2" id="f-12" unitRef="usd">14479.56</ffd:FeeAmt>
    <ffd:PrevslyPdFlg contextRef="c-3" id="f-13">false</ffd:PrevslyPdFlg>
    <ffd:OfferingSctyTp contextRef="c-3" id="f-14">Equity</ffd:OfferingSctyTp>
    <ffd:OfferingSctyTitl contextRef="c-3" id="f-15">Class A common stock, par value $0.001 per share, C3.ai, Inc. 2020 Employee Stock Purchase Plan</ffd:OfferingSctyTitl>
    <ffd:FeesOthrRuleFlg contextRef="c-3" id="f-16">true</ffd:FeesOthrRuleFlg>
    <ffd:AmtSctiesRegd contextRef="c-3" decimals="0" id="f-17" unitRef="shares">1480072</ffd:AmtSctiesRegd>
    <ffd:MaxOfferingPricPerScty contextRef="c-3" decimals="2" id="f-18" unitRef="usd">8.61</ffd:MaxOfferingPricPerScty>
    <ffd:MaxAggtOfferingPric contextRef="c-3" decimals="2" id="f-19" unitRef="usd">12743419.92</ffd:MaxAggtOfferingPric>
    <ffd:FeeRate contextRef="c-3" decimals="8" id="f-20" unitRef="number">0.0001381</ffd:FeeRate>
    <ffd:FeeAmt contextRef="c-3" decimals="2" id="f-21" unitRef="usd">1759.87</ffd:FeeAmt>
    <ffd:TtlOfferingAmt contextRef="c-1" decimals="2" id="f-22" unitRef="usd">117591771</ffd:TtlOfferingAmt>
    <ffd:TtlFeeAmt contextRef="c-1" decimals="2" id="f-23" unitRef="usd">16239.43</ffd:TtlFeeAmt>
    <ffd:TtlPrevslyPdAmt contextRef="c-1" decimals="2" id="f-24" unitRef="usd">0</ffd:TtlPrevslyPdAmt>
    <ffd:TtlOffsetAmt contextRef="c-1" decimals="2" id="f-25" unitRef="usd">0</ffd:TtlOffsetAmt>
    <ffd:NetFeeAmt contextRef="c-1" decimals="2" id="f-26" unitRef="usd">16239.43</ffd:NetFeeAmt>
    <ffd:OfferingNote contextRef="c-2" id="f-28">&lt;span style="color:#000000;font-family:'Times New Roman',serif;font-size:10pt;font-weight:400;line-height:120%;padding-left:10.5pt"&gt;Pursuant to Rule 416(a) promulgated under the Securities Act of 1933, as amended (the &#x201c;Securities Act&#x201d;), this Registration Statement shall also cover any additional shares of Class A common stock of C3.ai, Inc. (the &#x201c;Registrant&#x201d;) that become issuable under the Registrant&#x2019;s 2020 Equity Incentive Plan (the &#x201c;2020 Plan&#x201d;) by reason of any stock dividend, stock split, recapitalization, or other similar transaction effected that results in an increase to the number of outstanding shares of Registrant&#x2019;s Class A common stock, as applicable. The amount registered represents an automatic annual increase on May 1, 2026 in the number of shares reserved for future issuance pursuant to the 2020 Plan in an amount equal to 7% of the total number of shares of the Registrant&#x2019;s Class A common stock and Class B common stock outstanding on April 30, 2026. The proposed maximum offering price per unit is estimated in accordance with Rules 457(c) and (h) of the Securities Act solely for the purpose of calculating the registration fee on the basis of the average of the high and low prices of the Registrant&#x2019;s Class A common stock as reported on the New York Stock Exchange (&#x201c;NYSE&#x201d;) on June 22, 2026. &lt;/span&gt;&lt;div style="margin-bottom:6pt;margin-top:6pt;padding-left:18pt;text-align:justify;text-indent:-18pt"&gt;&lt;span style="color:#000000;font-family:'Times New Roman',serif;font-size:10pt;font-weight:400;line-height:120%"&gt;2.&lt;/span&gt;&lt;span style="color:#000000;font-family:'Times New Roman',serif;font-size:10pt;font-weight:400;line-height:120%;padding-left:10.5pt"&gt;Pursuant to Rule 416(a) promulgated under the Securities Act, this Registration Statement shall also cover any additional shares of the Registrant&#x2019;s Class A common stock that become issuable under the Registrant&#x2019;s 2020 Employee Stock Purchase Plan (the &#x201c;2020 ESPP&#x201d;) by reason of any stock dividend, stock split, recapitalization, or other similar transaction effected that results in an increase to the number of outstanding shares of Registrant&#x2019;s Class A common stock, as applicable. The amount registered represents an automatic annual increase on May 1, 2026 in the number of shares reserved for future issuance pursuant to the 2020 ESPP in an amount equal to 1% of the total number of shares of the Registrant&#x2019;s Class A common stock and Class B common stock outstanding on April 30, 2026. The proposed maximum offering price per unit is estimated in accordance with Rules 457(c) and (h) of the Securities Act solely for the purpose of calculating the registration fee on the basis of the average of the high and low prices of the Registrant&#x2019;s Class A common stock as reported on the NYSE on June 22, 2026, multiplied by 85%, which is the percentage of the price per share applicable to purchases under the 2020 ESPP.&lt;/span&gt;&lt;/div&gt;</ffd:OfferingNote>
    <ffd:OfferingNote contextRef="c-3" id="f-27">Pursuant to Rule 416(a) promulgated under the Securities Act of 1933, as amended (the &#x201c;Securities Act&#x201d;), this Registration Statement shall also cover any additional shares of Class A common stock of C3.ai, Inc. (the &#x201c;Registrant&#x201d;) that become issuable under the Registrant&#x2019;s 2020 Equity Incentive Plan (the &#x201c;2020 Plan&#x201d;) by reason of any stock dividend, stock split, recapitalization, or other similar transaction effected that results in an increase to the number of outstanding shares of Registrant&#x2019;s Class A common stock, as applicable. The amount registered represents an automatic annual increase on May 1, 2026 in the number of shares reserved for future issuance pursuant to the 2020 Plan in an amount equal to 7% of the total number of shares of the Registrant&#x2019;s Class A common stock and Class B common stock outstanding on April 30, 2026. The proposed maximum offering price per unit is estimated in accordance with Rules 457(c) and (h) of the Securities Act solely for the purpose of calculating the registration fee on the basis of the average of the high and low prices of the Registrant&#x2019;s Class A common stock as reported on the New York Stock Exchange (&#x201c;NYSE&#x201d;) on June 22, 2026.</ffd:OfferingNote>
</xbrl>
