<?xml version='1.0' encoding='utf-8'?>
<FilingSummary>
  <Version>3.20.1</Version>
  <ProcessingTime/>
  <ReportFormat>html</ReportFormat>
  <ContextCount>246</ContextCount>
  <ElementCount>332</ElementCount>
  <EntityCount>1</EntityCount>
  <FootnotesReported>false</FootnotesReported>
  <SegmentCount>91</SegmentCount>
  <ScenarioCount>0</ScenarioCount>
  <TuplesReported>false</TuplesReported>
  <UnitCount>9</UnitCount>
  <MyReports>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R1.htm</HtmlFileName>
      <LongName>0001001 - Document - Cover Page</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/CoverPage</Role>
      <ShortName>Cover Page</ShortName>
      <MenuCategory>Cover</MenuCategory>
      <Position>1</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R2.htm</HtmlFileName>
      <LongName>1001002 - Statement - Condensed Consolidated Balance Sheets</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/CondensedConsolidatedBalanceSheets</Role>
      <ShortName>Condensed Consolidated Balance Sheets</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>2</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R3.htm</HtmlFileName>
      <LongName>1002003 - Statement - Condensed Consolidated Balance Sheets (Parenthetical)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/CondensedConsolidatedBalanceSheetsParenthetical</Role>
      <ShortName>Condensed Consolidated Balance Sheets (Parenthetical)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>3</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R4.htm</HtmlFileName>
      <LongName>1003004 - Statement - Condensed Consolidated Statements of Operations</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/CondensedConsolidatedStatementsofOperations</Role>
      <ShortName>Condensed Consolidated Statements of Operations</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>4</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R5.htm</HtmlFileName>
      <LongName>1004005 - Statement - Condensed Consolidated Statements of Stockholders' Equity</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/CondensedConsolidatedStatementsofStockholdersEquity</Role>
      <ShortName>Condensed Consolidated Statements of Stockholders' Equity</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>5</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R6.htm</HtmlFileName>
      <LongName>1005006 - Statement - Condensed Consolidated Statements of Cash Flows</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/CondensedConsolidatedStatementsofCashFlows</Role>
      <ShortName>Condensed Consolidated Statements of Cash Flows</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>6</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R7.htm</HtmlFileName>
      <LongName>2101101 - Disclosure - Description of Business</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/DescriptionofBusiness</Role>
      <ShortName>Description of Business</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>7</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R8.htm</HtmlFileName>
      <LongName>2103102 - Disclosure - Basis of Presentation and Summary of Significant Accounting Policies</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/BasisofPresentationandSummaryofSignificantAccountingPolicies</Role>
      <ShortName>Basis of Presentation and Summary of Significant Accounting Policies</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>8</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R9.htm</HtmlFileName>
      <LongName>2106103 - Disclosure - Revenue Recognition</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/RevenueRecognition</Role>
      <ShortName>Revenue Recognition</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>9</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R10.htm</HtmlFileName>
      <LongName>2113104 - Disclosure - Net loss per Share</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/NetlossperShare</Role>
      <ShortName>Net loss per Share</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>10</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R11.htm</HtmlFileName>
      <LongName>2118106 - Disclosure - Cash Equivalents</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/CashEquivalents</Role>
      <ShortName>Cash Equivalents</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>11</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R12.htm</HtmlFileName>
      <LongName>2122107 - Disclosure - Fair Value Measurements</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/FairValueMeasurements</Role>
      <ShortName>Fair Value Measurements</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>12</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R13.htm</HtmlFileName>
      <LongName>2125108 - Disclosure - Balance Sheets Details</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/BalanceSheetsDetails</Role>
      <ShortName>Balance Sheets Details</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>13</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R14.htm</HtmlFileName>
      <LongName>2135110 - Disclosure - Capital Stock</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/CapitalStock</Role>
      <ShortName>Capital Stock</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>14</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R15.htm</HtmlFileName>
      <LongName>2145112 - Disclosure - Related Party Transactions</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/RelatedPartyTransactions</Role>
      <ShortName>Related Party Transactions</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>15</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R16.htm</HtmlFileName>
      <LongName>2147113 - Disclosure - Segment, Geographical and Other Revenue Information</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/SegmentGeographicalandOtherRevenueInformation</Role>
      <ShortName>Segment, Geographical and Other Revenue Information</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>16</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R17.htm</HtmlFileName>
      <LongName>2155114 - Disclosure - Allowance for Credit Losses</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/AllowanceforCreditLosses</Role>
      <ShortName>Allowance for Credit Losses</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>17</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R18.htm</HtmlFileName>
      <LongName>2159115 - Disclosure - Subsequent Events</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/SubsequentEvents</Role>
      <ShortName>Subsequent Events</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>18</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R19.htm</HtmlFileName>
      <LongName>2204201 - Disclosure - Basis of Presentation and Summary of Significant Accounting Policies (Policies)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/BasisofPresentationandSummaryofSignificantAccountingPoliciesPolicies</Role>
      <ShortName>Basis of Presentation and Summary of Significant Accounting Policies (Policies)</ShortName>
      <MenuCategory>Policies</MenuCategory>
      <ParentRole>http://www.codexis.com/role/BasisofPresentationandSummaryofSignificantAccountingPolicies</ParentRole>
      <Position>19</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R20.htm</HtmlFileName>
      <LongName>2307301 - Disclosure - Revenue Recognition (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/RevenueRecognitionTables</Role>
      <ShortName>Revenue Recognition (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.codexis.com/role/RevenueRecognition</ParentRole>
      <Position>20</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R21.htm</HtmlFileName>
      <LongName>2314302 - Disclosure - Net loss per Share (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/NetlossperShareTables</Role>
      <ShortName>Net loss per Share (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.codexis.com/role/NetlossperShare</ParentRole>
      <Position>21</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R22.htm</HtmlFileName>
      <LongName>2319303 - Disclosure - Cash Equivalents (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/CashEquivalentsTables</Role>
      <ShortName>Cash Equivalents (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.codexis.com/role/CashEquivalents</ParentRole>
      <Position>22</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R23.htm</HtmlFileName>
      <LongName>2323304 - Disclosure - Fair Value Measurements (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/FairValueMeasurementsTables</Role>
      <ShortName>Fair Value Measurements (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.codexis.com/role/FairValueMeasurements</ParentRole>
      <Position>23</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R24.htm</HtmlFileName>
      <LongName>2326305 - Disclosure - Balance Sheets Details (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/BalanceSheetsDetailsTables</Role>
      <ShortName>Balance Sheets Details (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.codexis.com/role/BalanceSheetsDetails</ParentRole>
      <Position>24</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R25.htm</HtmlFileName>
      <LongName>2332306 - Disclosure - Stock-based Compensation (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/StockbasedCompensationTables</Role>
      <ShortName>Stock-based Compensation (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <Position>25</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R26.htm</HtmlFileName>
      <LongName>2338307 - Disclosure - Commitments and Contingencies (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/CommitmentsandContingenciesTables</Role>
      <ShortName>Commitments and Contingencies (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <Position>26</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R27.htm</HtmlFileName>
      <LongName>2348308 - Disclosure - Segment, Geographical and Other Revenue Information (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/SegmentGeographicalandOtherRevenueInformationTables</Role>
      <ShortName>Segment, Geographical and Other Revenue Information (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.codexis.com/role/SegmentGeographicalandOtherRevenueInformation</ParentRole>
      <Position>27</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R28.htm</HtmlFileName>
      <LongName>2356309 - Disclosure - Allowance for Credit Losses (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/AllowanceforCreditLossesTables</Role>
      <ShortName>Allowance for Credit Losses (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.codexis.com/role/AllowanceforCreditLosses</ParentRole>
      <Position>28</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R29.htm</HtmlFileName>
      <LongName>2402401 - Disclosure - Description of Business - Textual (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/DescriptionofBusinessTextualDetails</Role>
      <ShortName>Description of Business - Textual (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>29</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R30.htm</HtmlFileName>
      <LongName>2405402 - Disclosure - Basis of Presentation and Summary of Significant Accounting Policies - Textual (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/BasisofPresentationandSummaryofSignificantAccountingPoliciesTextualDetails</Role>
      <ShortName>Basis of Presentation and Summary of Significant Accounting Policies - Textual (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.codexis.com/role/BasisofPresentationandSummaryofSignificantAccountingPoliciesPolicies</ParentRole>
      <Position>30</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R31.htm</HtmlFileName>
      <LongName>2408403 - Disclosure - Revenue Recognition - Disaggregation of Revenue (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/RevenueRecognitionDisaggregationofRevenueDetails</Role>
      <ShortName>Revenue Recognition - Disaggregation of Revenue (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>31</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R32.htm</HtmlFileName>
      <LongName>2409404 - Disclosure - Revenue Recognition - Contracts with Customer (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/RevenueRecognitionContractswithCustomerDetails</Role>
      <ShortName>Revenue Recognition - Contracts with Customer (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>32</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R33.htm</HtmlFileName>
      <LongName>2410405 - Disclosure - Revenue Recognition - Additional Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/RevenueRecognitionAdditionalInformationDetails</Role>
      <ShortName>Revenue Recognition - Additional Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>33</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R34.htm</HtmlFileName>
      <LongName>2411406 - Disclosure - Revenue Recognition - Revenue Recognized During Period (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/RevenueRecognitionRevenueRecognizedDuringPeriodDetails</Role>
      <ShortName>Revenue Recognition - Revenue Recognized During Period (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>34</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R35.htm</HtmlFileName>
      <LongName>2412407 - Disclosure - Revenue Recognition - Performance Obligation (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/RevenueRecognitionPerformanceObligationDetails</Role>
      <ShortName>Revenue Recognition - Performance Obligation (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>35</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R36.htm</HtmlFileName>
      <LongName>2415408 - Disclosure - Net loss per Share - Anti-Dilutive Securities (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/NetlossperShareAntiDilutiveSecuritiesDetails</Role>
      <ShortName>Net loss per Share - Anti-Dilutive Securities (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>36</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R37.htm</HtmlFileName>
      <LongName>2417409 - Disclosure - Collaborative Arrangements - Textual (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/CollaborativeArrangementsTextualDetails</Role>
      <ShortName>Collaborative Arrangements - Textual (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>37</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R38.htm</HtmlFileName>
      <LongName>2420410 - Disclosure - Cash Equivalents - Components of Cash Equivalents (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/CashEquivalentsComponentsofCashEquivalentsDetails</Role>
      <ShortName>Cash Equivalents - Components of Cash Equivalents (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>38</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R39.htm</HtmlFileName>
      <LongName>2421411 - Disclosure - Cash Equivalents - Additional Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/CashEquivalentsAdditionalInformationDetails</Role>
      <ShortName>Cash Equivalents - Additional Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>39</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R40.htm</HtmlFileName>
      <LongName>2424412 - Disclosure - Fair Value Measurements - Schedule of Financial Instruments Measured at Fair Value on Recurring Basis (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/FairValueMeasurementsScheduleofFinancialInstrumentsMeasuredatFairValueonRecurringBasisDetails</Role>
      <ShortName>Fair Value Measurements - Schedule of Financial Instruments Measured at Fair Value on Recurring Basis (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>40</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R41.htm</HtmlFileName>
      <LongName>2427413 - Disclosure - Balance Sheets Details - Inventories (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/BalanceSheetsDetailsInventoriesDetails</Role>
      <ShortName>Balance Sheets Details - Inventories (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>41</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R42.htm</HtmlFileName>
      <LongName>2428414 - Disclosure - Balance Sheets Details - Property and Equipment, net (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/BalanceSheetsDetailsPropertyandEquipmentnetDetails</Role>
      <ShortName>Balance Sheets Details - Property and Equipment, net (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>42</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R43.htm</HtmlFileName>
      <LongName>2429415 - Disclosure - Balance Sheets Details - Goodwill (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/BalanceSheetsDetailsGoodwillDetails</Role>
      <ShortName>Balance Sheets Details - Goodwill (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>43</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R44.htm</HtmlFileName>
      <LongName>2430416 - Disclosure - Balance Sheets Details - Accrued Liabilities (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/BalanceSheetsDetailsAccruedLiabilitiesDetails</Role>
      <ShortName>Balance Sheets Details - Accrued Liabilities (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>44</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R45.htm</HtmlFileName>
      <LongName>2433417 - Disclosure - Stock-based Compensation - Textual (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/StockbasedCompensationTextualDetails</Role>
      <ShortName>Stock-based Compensation - Textual (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>45</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R46.htm</HtmlFileName>
      <LongName>2434418 - Disclosure - Stock-based Compensation - Stock-based Compensation Expense (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/StockbasedCompensationStockbasedCompensationExpenseDetails</Role>
      <ShortName>Stock-based Compensation - Stock-based Compensation Expense (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>46</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R47.htm</HtmlFileName>
      <LongName>2436419 - Disclosure - Capital Stock - Textual (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/CapitalStockTextualDetails</Role>
      <ShortName>Capital Stock - Textual (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>47</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R48.htm</HtmlFileName>
      <LongName>2439420 - Disclosure - Commitments and Contingencies - Textual (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/CommitmentsandContingenciesTextualDetails</Role>
      <ShortName>Commitments and Contingencies - Textual (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>48</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R49.htm</HtmlFileName>
      <LongName>2440421 - Disclosure - Commitments and Contingencies - Lease Cost (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/CommitmentsandContingenciesLeaseCostDetails</Role>
      <ShortName>Commitments and Contingencies - Lease Cost (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>49</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R50.htm</HtmlFileName>
      <LongName>2441422 - Disclosure - Commitments and Contingencies - Other Lease Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/CommitmentsandContingenciesOtherLeaseInformationDetails</Role>
      <ShortName>Commitments and Contingencies - Other Lease Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>50</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R51.htm</HtmlFileName>
      <LongName>2442423 - Disclosure - Commitments and Contingencies - Cash Paid for Lease Obligations (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/CommitmentsandContingenciesCashPaidforLeaseObligationsDetails</Role>
      <ShortName>Commitments and Contingencies - Cash Paid for Lease Obligations (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>51</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R52.htm</HtmlFileName>
      <LongName>2443424 - Disclosure - Commitments and Contingencies - Future Minimum Lease Payments (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/CommitmentsandContingenciesFutureMinimumLeasePaymentsDetails</Role>
      <ShortName>Commitments and Contingencies - Future Minimum Lease Payments (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>52</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R53.htm</HtmlFileName>
      <LongName>2444425 - Disclosure - Commitments and Contingencies - Other Commitments (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/CommitmentsandContingenciesOtherCommitmentsDetails</Role>
      <ShortName>Commitments and Contingencies - Other Commitments (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>53</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R54.htm</HtmlFileName>
      <LongName>2446426 - Disclosure - Related Party Transactions - Textual (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/RelatedPartyTransactionsTextualDetails</Role>
      <ShortName>Related Party Transactions - Textual (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>54</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R55.htm</HtmlFileName>
      <LongName>2449427 - Disclosure - Segment, Geographical and Other Revenue Information - Additional Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/SegmentGeographicalandOtherRevenueInformationAdditionalInformationDetails</Role>
      <ShortName>Segment, Geographical and Other Revenue Information - Additional Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>55</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R56.htm</HtmlFileName>
      <LongName>2450428 - Disclosure - Segment, Geographical and Other Revenue Information - Segment Reporting (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/SegmentGeographicalandOtherRevenueInformationSegmentReportingDetails</Role>
      <ShortName>Segment, Geographical and Other Revenue Information - Segment Reporting (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>56</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R57.htm</HtmlFileName>
      <LongName>2451429 - Disclosure - Segment, Geographical and Other Revenue Information - Concentration Risk (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/SegmentGeographicalandOtherRevenueInformationConcentrationRiskDetails</Role>
      <ShortName>Segment, Geographical and Other Revenue Information - Concentration Risk (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>57</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R58.htm</HtmlFileName>
      <LongName>2452430 - Disclosure - Segment, Geographical and Other Revenue Information - Revenues by Geographic Area (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/SegmentGeographicalandOtherRevenueInformationRevenuesbyGeographicAreaDetails</Role>
      <ShortName>Segment, Geographical and Other Revenue Information - Revenues by Geographic Area (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>58</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R59.htm</HtmlFileName>
      <LongName>2453431 - Disclosure - Segment, Geographical and Other Revenue Information - Long-Lived Assets by Geographic Area (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/SegmentGeographicalandOtherRevenueInformationLongLivedAssetsbyGeographicAreaDetails</Role>
      <ShortName>Segment, Geographical and Other Revenue Information - Long-Lived Assets by Geographic Area (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>59</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R60.htm</HtmlFileName>
      <LongName>2454432 - Disclosure - Segment, Geographical and Other Revenue Information - Goodwill (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/SegmentGeographicalandOtherRevenueInformationGoodwillDetails</Role>
      <ShortName>Segment, Geographical and Other Revenue Information - Goodwill (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.codexis.com/role/SegmentGeographicalandOtherRevenueInformationTables</ParentRole>
      <Position>60</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R61.htm</HtmlFileName>
      <LongName>2457433 - Disclosure - Allowance for Credit Losses - Analysis of Allowance for Credit Losses (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/AllowanceforCreditLossesAnalysisofAllowanceforCreditLossesDetails</Role>
      <ShortName>Allowance for Credit Losses - Analysis of Allowance for Credit Losses (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>61</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R62.htm</HtmlFileName>
      <LongName>2458434 - Disclosure - Allowance for Credit Losses - Summary of Finance Receivables by Aging Category (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/AllowanceforCreditLossesSummaryofFinanceReceivablesbyAgingCategoryDetails</Role>
      <ShortName>Allowance for Credit Losses - Summary of Finance Receivables by Aging Category (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>62</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R63.htm</HtmlFileName>
      <LongName>2460435 - Disclosure - Subsequent Events - Textual (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/SubsequentEventsTextualDetails</Role>
      <ShortName>Subsequent Events - Textual (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>63</Position>
    </Report>
    <Report instance="cdxs-20200331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R9999.htm</HtmlFileName>
      <LongName>Uncategorized Items - cdxs-20200331.htm</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xbrl.sec.gov/role/uncategorizedFacts</Role>
      <ShortName>Uncategorized Items - cdxs-20200331.htm</ShortName>
      <MenuCategory>Cover</MenuCategory>
      <Position>64</Position>
    </Report>
    <Report>
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <LongName>All Reports</LongName>
      <ReportType>Book</ReportType>
      <ShortName>All Reports</ShortName>
    </Report>
  </MyReports>
  <InputFiles>
    <File doctype="10-Q" original="cdxs-20200331.htm">cdxs-20200331.htm</File>
    <File>cdxs-20200331.xsd</File>
    <File>cdxs-20200331_cal.xml</File>
    <File>cdxs-20200331_def.xml</File>
    <File>cdxs-20200331_lab.xml</File>
    <File>cdxs-20200331_pre.xml</File>
    <File>cdxs10qq120exhibit102.htm</File>
    <File>cdxs20200331ex311sp.htm</File>
    <File>cdxs20200331ex312sp.htm</File>
    <File>cdxs20200331ex321sp.htm</File>
    <File>exhibit101q120.htm</File>
  </InputFiles>
  <SupplementalFiles/>
  <BaseTaxonomies>
    <BaseTaxonomy>http://xbrl.sec.gov/country/2017-01-31</BaseTaxonomy>
    <BaseTaxonomy>http://xbrl.sec.gov/dei/2019-01-31</BaseTaxonomy>
    <BaseTaxonomy>http://fasb.org/srt/2019-01-31</BaseTaxonomy>
    <BaseTaxonomy>http://fasb.org/us-gaap/2019-01-31</BaseTaxonomy>
  </BaseTaxonomies>
  <HasPresentationLinkbase>true</HasPresentationLinkbase>
  <HasCalculationLinkbase>true</HasCalculationLinkbase>
</FilingSummary>
