<?xml version="1.0" encoding="utf-8"?>
<xbrl
  xmlns="http://www.xbrl.org/2003/instance"
  xmlns:dei="http://xbrl.sec.gov/dei/2024"
  xmlns:ffd="http://xbrl.sec.gov/ffd/2024q2"
  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/2024q2/ffd-2024q2.xsd"
      xlink:type="simple"/>
    <context id="P02_25_2025To02_25_2025">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0001622229</identifier>
        </entity>
        <period>
            <startDate>2025-02-25</startDate>
            <endDate>2025-02-25</endDate>
        </period>
    </context>
    <context id="P02_25_2025To02_25_2025_1TypedMemberffdOfferingAxis">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0001622229</identifier>
            <segment>
                <xbrldi:typedMember dimension="ffd:OfferingAxis">
                    <dei:lineNo>1</dei:lineNo>
                </xbrldi:typedMember>
            </segment>
        </entity>
        <period>
            <startDate>2025-02-25</startDate>
            <endDate>2025-02-25</endDate>
        </period>
    </context>
    <context id="P02_25_2025To02_25_2025_2TypedMemberffdOfferingAxis">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0001622229</identifier>
            <segment>
                <xbrldi:typedMember dimension="ffd:OfferingAxis">
                    <dei:lineNo>2</dei:lineNo>
                </xbrldi:typedMember>
            </segment>
        </entity>
        <period>
            <startDate>2025-02-25</startDate>
            <endDate>2025-02-25</endDate>
        </period>
    </context>
    <context id="P02_25_2025To02_25_2025_3TypedMemberffdOfferingAxis">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0001622229</identifier>
            <segment>
                <xbrldi:typedMember dimension="ffd:OfferingAxis">
                    <dei:lineNo>3</dei:lineNo>
                </xbrldi:typedMember>
            </segment>
        </entity>
        <period>
            <startDate>2025-02-25</startDate>
            <endDate>2025-02-25</endDate>
        </period>
    </context>
    <unit id="Unit_USD">
        <measure>iso4217:USD</measure>
    </unit>
    <unit id="Unit_pure">
        <measure>pure</measure>
    </unit>
    <unit id="Unit_shares">
        <measure>shares</measure>
    </unit>
    <dei:EntityCentralIndexKey contextRef="P02_25_2025To02_25_2025" id="ixv-278">0001622229</dei:EntityCentralIndexKey>
    <ffd:FeeExhibitTp contextRef="P02_25_2025To02_25_2025" id="ixv-279">EX-FILING FEES</ffd:FeeExhibitTp>
    <ffd:PrevslyPdFlg
      contextRef="P02_25_2025To02_25_2025_1TypedMemberffdOfferingAxis"
      id="ixv-280">false</ffd:PrevslyPdFlg>
    <ffd:PrevslyPdFlg
      contextRef="P02_25_2025To02_25_2025_2TypedMemberffdOfferingAxis"
      id="ixv-281">false</ffd:PrevslyPdFlg>
    <ffd:PrevslyPdFlg
      contextRef="P02_25_2025To02_25_2025_3TypedMemberffdOfferingAxis"
      id="ixv-282">false</ffd:PrevslyPdFlg>
    <ffd:OfferingSctyTitl
      contextRef="P02_25_2025To02_25_2025_3TypedMemberffdOfferingAxis"
      id="hidden131345668">To be issued pursuant to the Cogent Biosciences, Inc. 2020 Inducement Plan</ffd:OfferingSctyTitl>
    <ffd:OfferingSctyTitl
      contextRef="P02_25_2025To02_25_2025_2TypedMemberffdOfferingAxis"
      id="hidden131345669">To be issued pursuant to the Cogent Biosciences, Inc. 2018 Employee Stock Purchase Plan</ffd:OfferingSctyTitl>
    <ffd:OfferingSctyTitl
      contextRef="P02_25_2025To02_25_2025_1TypedMemberffdOfferingAxis"
      id="hidden131345670">To be issued pursuant to the Amended and Restated Cogent Biosciences, Inc. 2018 Stock Option and Incentive Plan</ffd:OfferingSctyTitl>
    <ffd:FeeRate
      contextRef="P02_25_2025To02_25_2025_1TypedMemberffdOfferingAxis"
      decimals="INF"
      id="hidden131345463"
      unitRef="Unit_pure">0.0001531</ffd:FeeRate>
    <ffd:FeeRate
      contextRef="P02_25_2025To02_25_2025_2TypedMemberffdOfferingAxis"
      decimals="INF"
      id="hidden131345464"
      unitRef="Unit_pure">0.0001531</ffd:FeeRate>
    <ffd:FeeRate
      contextRef="P02_25_2025To02_25_2025_3TypedMemberffdOfferingAxis"
      decimals="INF"
      id="hidden131345653"
      unitRef="Unit_pure">0.0001531</ffd:FeeRate>
    <ffd:FormTp contextRef="P02_25_2025To02_25_2025" id="ixv-331">S-8</ffd:FormTp>
    <ffd:SubmissnTp contextRef="P02_25_2025To02_25_2025" id="ixv-332">S-8</ffd:SubmissnTp>
    <dei:EntityRegistrantName contextRef="P02_25_2025To02_25_2025" id="ixv-333">Cogent Biosciences, Inc.</dei:EntityRegistrantName>
    <ffd:OfferingSctyTp
      contextRef="P02_25_2025To02_25_2025_1TypedMemberffdOfferingAxis"
      id="ixv-334">Equity</ffd:OfferingSctyTp>
    <ffd:OfferingSctyTp
      contextRef="P02_25_2025To02_25_2025_2TypedMemberffdOfferingAxis"
      id="ixv-335">Equity</ffd:OfferingSctyTp>
    <ffd:OfferingSctyTp
      contextRef="P02_25_2025To02_25_2025_3TypedMemberffdOfferingAxis"
      id="ixv-336">Equity</ffd:OfferingSctyTp>
    <ffd:Rule457aFlg
      contextRef="P02_25_2025To02_25_2025_1TypedMemberffdOfferingAxis"
      id="ixv-337">true</ffd:Rule457aFlg>
    <ffd:AmtSctiesRegd
      contextRef="P02_25_2025To02_25_2025_1TypedMemberffdOfferingAxis"
      decimals="0"
      id="ixv-338"
      unitRef="Unit_shares">4418469</ffd:AmtSctiesRegd>
    <ffd:MaxOfferingPricPerScty
      contextRef="P02_25_2025To02_25_2025_1TypedMemberffdOfferingAxis"
      decimals="2"
      id="ixv-339"
      unitRef="Unit_pure">8.06</ffd:MaxOfferingPricPerScty>
    <ffd:MaxAggtOfferingPric
      contextRef="P02_25_2025To02_25_2025_1TypedMemberffdOfferingAxis"
      decimals="2"
      id="ixv-340"
      unitRef="Unit_USD">35612860.14</ffd:MaxAggtOfferingPric>
    <ffd:FeeAmt
      contextRef="P02_25_2025To02_25_2025_1TypedMemberffdOfferingAxis"
      decimals="2"
      id="ixv-341"
      unitRef="Unit_USD">5452.33</ffd:FeeAmt>
    <ffd:Rule457aFlg
      contextRef="P02_25_2025To02_25_2025_2TypedMemberffdOfferingAxis"
      id="ixv-342">true</ffd:Rule457aFlg>
    <ffd:AmtSctiesRegd
      contextRef="P02_25_2025To02_25_2025_2TypedMemberffdOfferingAxis"
      decimals="0"
      id="ixv-343"
      unitRef="Unit_shares">125000</ffd:AmtSctiesRegd>
    <ffd:MaxOfferingPricPerScty
      contextRef="P02_25_2025To02_25_2025_2TypedMemberffdOfferingAxis"
      decimals="2"
      id="ixv-344"
      unitRef="Unit_pure">6.85</ffd:MaxOfferingPricPerScty>
    <ffd:MaxAggtOfferingPric
      contextRef="P02_25_2025To02_25_2025_2TypedMemberffdOfferingAxis"
      decimals="0"
      id="ixv-345"
      unitRef="Unit_USD">856250</ffd:MaxAggtOfferingPric>
    <ffd:FeeAmt
      contextRef="P02_25_2025To02_25_2025_2TypedMemberffdOfferingAxis"
      decimals="2"
      id="ixv-346"
      unitRef="Unit_USD">131.09</ffd:FeeAmt>
    <ffd:Rule457aFlg
      contextRef="P02_25_2025To02_25_2025_3TypedMemberffdOfferingAxis"
      id="ixv-347">true</ffd:Rule457aFlg>
    <ffd:AmtSctiesRegd
      contextRef="P02_25_2025To02_25_2025_3TypedMemberffdOfferingAxis"
      decimals="0"
      id="ixv-348"
      unitRef="Unit_shares">1300000</ffd:AmtSctiesRegd>
    <ffd:MaxOfferingPricPerScty
      contextRef="P02_25_2025To02_25_2025_3TypedMemberffdOfferingAxis"
      decimals="2"
      id="ixv-349"
      unitRef="Unit_pure">8.06</ffd:MaxOfferingPricPerScty>
    <ffd:MaxAggtOfferingPric
      contextRef="P02_25_2025To02_25_2025_3TypedMemberffdOfferingAxis"
      decimals="0"
      id="ixv-350"
      unitRef="Unit_USD">10478000</ffd:MaxAggtOfferingPric>
    <ffd:FeeAmt
      contextRef="P02_25_2025To02_25_2025_3TypedMemberffdOfferingAxis"
      decimals="2"
      id="ixv-351"
      unitRef="Unit_USD">1604.18</ffd:FeeAmt>
    <ffd:TtlOfferingAmt
      contextRef="P02_25_2025To02_25_2025"
      decimals="2"
      id="ixv-352"
      unitRef="Unit_USD">46947110.14</ffd:TtlOfferingAmt>
    <ffd:TtlFeeAmt
      contextRef="P02_25_2025To02_25_2025"
      decimals="2"
      id="ixv-353"
      unitRef="Unit_USD">7187.6</ffd:TtlFeeAmt>
    <ffd:TtlOffsetAmt
      contextRef="P02_25_2025To02_25_2025"
      decimals="0"
      id="ixv-354"
      unitRef="Unit_USD">0</ffd:TtlOffsetAmt>
    <ffd:NetFeeAmt
      contextRef="P02_25_2025To02_25_2025"
      decimals="2"
      id="ixv-355"
      unitRef="Unit_USD">7187.6</ffd:NetFeeAmt>
    <ffd:OfferingNote
      contextRef="P02_25_2025To02_25_2025_1TypedMemberffdOfferingAxis"
      id="ixv-252">
&lt;table cellpadding="0" cellspacing="0" style="text-align:start; BORDER-COLLAPSE:COLLAPSE; font-family:Times New Roman; font-size:9pt;width:100%;border:0;margin:0 auto"&gt;
&lt;tr&gt;
&lt;td style="width:2%"&gt;&lt;/td&gt;
&lt;td style="vertical-align:bottom;width:1%"&gt;&lt;/td&gt;
&lt;td style="width:97%"&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="page-break-inside:avoid ; font-family:Times New Roman; font-size:9pt"&gt;
&lt;td style="vertical-align:top"&gt;(1)&lt;/td&gt;
&lt;td style="vertical-align:bottom"&gt;&#160;&#160;&lt;/td&gt;
&lt;td style="vertical-align:top"&gt;In addition to the number of shares of the common stock, par value $0.001 per share (the &#x201c;Common Stock&#x201d;), of the Registrant stated above, pursuant to Rule 416 under the Securities Act of 1933, as amended (the &#x201c;Securities Act&#x201d;), this Registration Statement also covers any additional shares of Common Stock that become issuable by reason of any stock dividend, stock split, recapitalization or other similar transaction effected without receipt of consideration that increases the number of the Registrant&#x2019;s outstanding shares of Common Stock.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="page-break-inside:avoid ; font-family:Times New Roman; font-size:9pt"&gt;
&lt;td style="vertical-align:top"&gt;(2)&lt;/td&gt;
&lt;td style="vertical-align:bottom"&gt;&#160;&#160;&lt;/td&gt;
&lt;td style="vertical-align:top"&gt;Represents an automatic increase to the number of shares available for issuance under the 2018 Plan in accordance with the automatic annual increase provision therein, effective as of January&#160;1, 2025. The price of $8.06 per share, which is the average of the high and low sale prices of the Common Stock of the Registrant as quoted on the Nasdaq Global Select Market on February&#160;21, 2025, is set forth solely for purposes of calculating the registration fee pursuant to Rules 457(c) and (h)&#160;under the Securities Act and has been used as these shares are without a fixed price.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="page-break-inside:avoid ; font-family:Times New Roman; font-size:9pt"&gt;
&lt;td style="vertical-align:top"&gt;(3)&lt;/td&gt;
&lt;td style="vertical-align:bottom"&gt;&#160;&#160;&lt;/td&gt;
&lt;td style="vertical-align:top"&gt;Represents an automatic increase to the number of shares available for issuance under the ESPP in accordance with the automatic annual increase provision therein, effective as of January&#160;1, 2025. The price of $6.85 per share is estimated solely for the purpose of calculating the registration fee pursuant to Rules 457(c) and (h)&#160;under the Securities Act, and is based on 85% of $8.06, which is the average of the high and low sale prices of the Common Stock of the Registrant as quoted on the Nasdaq Global Select Market on February&#160;21, 2025. Pursuant to the ESPP, the purchase price of the shares of Common Stock reserved for issuance thereunder will be 85% of the fair market value of a share of Common Stock on the first trading day of the offering period or on the exercise date, whichever is less.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="page-break-inside:avoid ; font-family:Times New Roman; font-size:9pt"&gt;
&lt;td style="vertical-align:top"&gt;(4)&lt;/td&gt;
&lt;td style="vertical-align:bottom"&gt;&#160;&#160;&lt;/td&gt;
&lt;td style="vertical-align:top"&gt;Represents additional shares added to the Inducement Plan. The price of $8.06 per share, which is the average of the high and low sale prices of the Common Stock of the Registrant as quoted on the Nasdaq Global Select Market on February&#160;21, 2025, is set forth solely for purposes of calculating the registration fee pursuant to Rules 457(c) and (h)&#160;under the Securities Act and has been used as these shares are without a fixed price.&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</ffd:OfferingNote>
    <ffd:OfferingNote
      contextRef="P02_25_2025To02_25_2025_2TypedMemberffdOfferingAxis"
      id="ixv-253">
&lt;table cellpadding="0" cellspacing="0" style="text-align:start; BORDER-COLLAPSE:COLLAPSE; font-family:Times New Roman; font-size:9pt;width:100%;border:0;margin:0 auto"&gt;
&lt;tr&gt;
&lt;td style="width:2%"&gt;&lt;/td&gt;
&lt;td style="vertical-align:bottom;width:1%"&gt;&lt;/td&gt;
&lt;td style="width:97%"&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="page-break-inside:avoid ; font-family:Times New Roman; font-size:9pt"&gt;
&lt;td style="vertical-align:top"&gt;(1)&lt;/td&gt;
&lt;td style="vertical-align:bottom"&gt;&#160;&#160;&lt;/td&gt;
&lt;td style="vertical-align:top"&gt;In addition to the number of shares of the common stock, par value $0.001 per share (the &#x201c;Common Stock&#x201d;), of the Registrant stated above, pursuant to Rule 416 under the Securities Act of 1933, as amended (the &#x201c;Securities Act&#x201d;), this Registration Statement also covers any additional shares of Common Stock that become issuable by reason of any stock dividend, stock split, recapitalization or other similar transaction effected without receipt of consideration that increases the number of the Registrant&#x2019;s outstanding shares of Common Stock.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="page-break-inside:avoid ; font-family:Times New Roman; font-size:9pt"&gt;
&lt;td style="vertical-align:top"&gt;(2)&lt;/td&gt;
&lt;td style="vertical-align:bottom"&gt;&#160;&#160;&lt;/td&gt;
&lt;td style="vertical-align:top"&gt;Represents an automatic increase to the number of shares available for issuance under the 2018 Plan in accordance with the automatic annual increase provision therein, effective as of January&#160;1, 2025. The price of $8.06 per share, which is the average of the high and low sale prices of the Common Stock of the Registrant as quoted on the Nasdaq Global Select Market on February&#160;21, 2025, is set forth solely for purposes of calculating the registration fee pursuant to Rules 457(c) and (h)&#160;under the Securities Act and has been used as these shares are without a fixed price.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="page-break-inside:avoid ; font-family:Times New Roman; font-size:9pt"&gt;
&lt;td style="vertical-align:top"&gt;(3)&lt;/td&gt;
&lt;td style="vertical-align:bottom"&gt;&#160;&#160;&lt;/td&gt;
&lt;td style="vertical-align:top"&gt;Represents an automatic increase to the number of shares available for issuance under the ESPP in accordance with the automatic annual increase provision therein, effective as of January&#160;1, 2025. The price of $6.85 per share is estimated solely for the purpose of calculating the registration fee pursuant to Rules 457(c) and (h)&#160;under the Securities Act, and is based on 85% of $8.06, which is the average of the high and low sale prices of the Common Stock of the Registrant as quoted on the Nasdaq Global Select Market on February&#160;21, 2025. Pursuant to the ESPP, the purchase price of the shares of Common Stock reserved for issuance thereunder will be 85% of the fair market value of a share of Common Stock on the first trading day of the offering period or on the exercise date, whichever is less.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="page-break-inside:avoid ; font-family:Times New Roman; font-size:9pt"&gt;
&lt;td style="vertical-align:top"&gt;(4)&lt;/td&gt;
&lt;td style="vertical-align:bottom"&gt;&#160;&#160;&lt;/td&gt;
&lt;td style="vertical-align:top"&gt;Represents additional shares added to the Inducement Plan. The price of $8.06 per share, which is the average of the high and low sale prices of the Common Stock of the Registrant as quoted on the Nasdaq Global Select Market on February&#160;21, 2025, is set forth solely for purposes of calculating the registration fee pursuant to Rules 457(c) and (h)&#160;under the Securities Act and has been used as these shares are without a fixed price.&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</ffd:OfferingNote>
    <ffd:OfferingNote
      contextRef="P02_25_2025To02_25_2025_3TypedMemberffdOfferingAxis"
      id="ixv-254">
&lt;table cellpadding="0" cellspacing="0" style="text-align:start; BORDER-COLLAPSE:COLLAPSE; font-family:Times New Roman; font-size:9pt;width:100%;border:0;margin:0 auto"&gt;
&lt;tr&gt;
&lt;td style="width:2%"&gt;&lt;/td&gt;
&lt;td style="vertical-align:bottom;width:1%"&gt;&lt;/td&gt;
&lt;td style="width:97%"&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="page-break-inside:avoid ; font-family:Times New Roman; font-size:9pt"&gt;
&lt;td style="vertical-align:top"&gt;(1)&lt;/td&gt;
&lt;td style="vertical-align:bottom"&gt;&#160;&#160;&lt;/td&gt;
&lt;td style="vertical-align:top"&gt;In addition to the number of shares of the common stock, par value $0.001 per share (the &#x201c;Common Stock&#x201d;), of the Registrant stated above, pursuant to Rule 416 under the Securities Act of 1933, as amended (the &#x201c;Securities Act&#x201d;), this Registration Statement also covers any additional shares of Common Stock that become issuable by reason of any stock dividend, stock split, recapitalization or other similar transaction effected without receipt of consideration that increases the number of the Registrant&#x2019;s outstanding shares of Common Stock.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="page-break-inside:avoid ; font-family:Times New Roman; font-size:9pt"&gt;
&lt;td style="vertical-align:top"&gt;(2)&lt;/td&gt;
&lt;td style="vertical-align:bottom"&gt;&#160;&#160;&lt;/td&gt;
&lt;td style="vertical-align:top"&gt;Represents an automatic increase to the number of shares available for issuance under the 2018 Plan in accordance with the automatic annual increase provision therein, effective as of January&#160;1, 2025. The price of $8.06 per share, which is the average of the high and low sale prices of the Common Stock of the Registrant as quoted on the Nasdaq Global Select Market on February&#160;21, 2025, is set forth solely for purposes of calculating the registration fee pursuant to Rules 457(c) and (h)&#160;under the Securities Act and has been used as these shares are without a fixed price.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="page-break-inside:avoid ; font-family:Times New Roman; font-size:9pt"&gt;
&lt;td style="vertical-align:top"&gt;(3)&lt;/td&gt;
&lt;td style="vertical-align:bottom"&gt;&#160;&#160;&lt;/td&gt;
&lt;td style="vertical-align:top"&gt;Represents an automatic increase to the number of shares available for issuance under the ESPP in accordance with the automatic annual increase provision therein, effective as of January&#160;1, 2025. The price of $6.85 per share is estimated solely for the purpose of calculating the registration fee pursuant to Rules 457(c) and (h)&#160;under the Securities Act, and is based on 85% of $8.06, which is the average of the high and low sale prices of the Common Stock of the Registrant as quoted on the Nasdaq Global Select Market on February&#160;21, 2025. Pursuant to the ESPP, the purchase price of the shares of Common Stock reserved for issuance thereunder will be 85% of the fair market value of a share of Common Stock on the first trading day of the offering period or on the exercise date, whichever is less.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="page-break-inside:avoid ; font-family:Times New Roman; font-size:9pt"&gt;
&lt;td style="vertical-align:top"&gt;(4)&lt;/td&gt;
&lt;td style="vertical-align:bottom"&gt;&#160;&#160;&lt;/td&gt;
&lt;td style="vertical-align:top"&gt;Represents additional shares added to the Inducement Plan. The price of $8.06 per share, which is the average of the high and low sale prices of the Common Stock of the Registrant as quoted on the Nasdaq Global Select Market on February&#160;21, 2025, is set forth solely for purposes of calculating the registration fee pursuant to Rules 457(c) and (h)&#160;under the Securities Act and has been used as these shares are without a fixed price.&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</ffd:OfferingNote>
</xbrl>
