<?xml version='1.0' encoding='UTF-8'?>
<FilingSummary>
  <Version>3.8.0.1</Version>
  <ProcessingTime/>
  <ReportFormat>html</ReportFormat>
  <ContextCount>288</ContextCount>
  <ElementCount>270</ElementCount>
  <EntityCount>1</EntityCount>
  <FootnotesReported>false</FootnotesReported>
  <SegmentCount>98</SegmentCount>
  <ScenarioCount>0</ScenarioCount>
  <TuplesReported>false</TuplesReported>
  <UnitCount>9</UnitCount>
  <MyReports>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R1.htm</HtmlFileName>
      <LongName>0001000 - Document - Document and Entity Information</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/DocumentAndEntityInformation</Role>
      <ShortName>Document and Entity Information</ShortName>
      <MenuCategory>Cover</MenuCategory>
      <Position>1</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R2.htm</HtmlFileName>
      <LongName>1001000 - 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-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R3.htm</HtmlFileName>
      <LongName>1001501 - 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-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R4.htm</HtmlFileName>
      <LongName>1002000 - 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-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R5.htm</HtmlFileName>
      <LongName>1003000 - Statement - Condensed Consolidated Statements of Comprehensive Income (Loss)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/CondensedConsolidatedStatementsOfComprehensiveIncomeLoss</Role>
      <ShortName>Condensed Consolidated Statements of Comprehensive Income (Loss)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>5</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R6.htm</HtmlFileName>
      <LongName>1003001 - Statement - Condensed Consolidated Statements of Comprehensive Income (Loss) (Parenthetical)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/CondensedConsolidatedStatementsOfComprehensiveIncomeLossParenthetical</Role>
      <ShortName>Condensed Consolidated Statements of Comprehensive Income (Loss) (Parenthetical)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>6</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R7.htm</HtmlFileName>
      <LongName>1004000 - 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>7</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R8.htm</HtmlFileName>
      <LongName>2101100 - 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>8</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R9.htm</HtmlFileName>
      <LongName>2102100 - 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>9</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R10.htm</HtmlFileName>
      <LongName>2103100 - Disclosure - Net Income (Loss) per Share</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/NetIncomeLossPerShare</Role>
      <ShortName>Net Income (Loss) per Share</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>10</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R11.htm</HtmlFileName>
      <LongName>2104100 - Disclosure - Collaborative Arrangements</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/CollaborativeArrangements</Role>
      <ShortName>Collaborative Arrangements</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>11</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R12.htm</HtmlFileName>
      <LongName>2105100 - Disclosure - Cash Equivalents and Marketable Securities</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/CashEquivalentsAndMarketableSecurities</Role>
      <ShortName>Cash Equivalents and Marketable Securities</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>12</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R13.htm</HtmlFileName>
      <LongName>2106100 - 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>13</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R14.htm</HtmlFileName>
      <LongName>2107100 - 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>14</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R15.htm</HtmlFileName>
      <LongName>2110100 - Disclosure - Stock-Based Compensation</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/StockBasedCompensation</Role>
      <ShortName>Stock-Based Compensation</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>15</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R16.htm</HtmlFileName>
      <LongName>2112100 - Disclosure - Capital Stock</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/CapitalStock</Role>
      <ShortName>Capital Stock</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>16</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R17.htm</HtmlFileName>
      <LongName>2113100 - Disclosure - Commitments and Contingencies</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/CommitmentsAndContingencies</Role>
      <ShortName>Commitments and Contingencies</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>17</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R18.htm</HtmlFileName>
      <LongName>2114100 - 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>18</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R19.htm</HtmlFileName>
      <LongName>2117100 - Disclosure - Significant Customer and Geographic Information</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/SignificantCustomerAndGeographicInformation</Role>
      <ShortName>Significant Customer and Geographic Information</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>19</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R20.htm</HtmlFileName>
      <LongName>2122100 - Disclosure - Subsequent Events</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/SubsequentEvents</Role>
      <ShortName>Subsequent Events</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>20</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R21.htm</HtmlFileName>
      <LongName>2202201 - 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>21</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R22.htm</HtmlFileName>
      <LongName>2303301 - Disclosure - Net Income (Loss) per Share (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/NetIncomeLossPerShareTables</Role>
      <ShortName>Net Income (Loss) per Share (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.codexis.com/role/NetIncomeLossPerShare</ParentRole>
      <Position>22</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R23.htm</HtmlFileName>
      <LongName>2305301 - Disclosure - Cash Equivalents and Marketable Securities (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/CashEquivalentsAndMarketableSecuritiesTables</Role>
      <ShortName>Cash Equivalents and Marketable Securities (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.codexis.com/role/CashEquivalentsAndMarketableSecurities</ParentRole>
      <Position>23</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R24.htm</HtmlFileName>
      <LongName>2306301 - 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>24</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R25.htm</HtmlFileName>
      <LongName>2307301 - 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>25</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R26.htm</HtmlFileName>
      <LongName>2310301 - 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>
      <ParentRole>http://www.codexis.com/role/StockBasedCompensation</ParentRole>
      <Position>26</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R27.htm</HtmlFileName>
      <LongName>2312301 - Disclosure - Capital Stock (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/CapitalStockTables</Role>
      <ShortName>Capital Stock (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.codexis.com/role/CapitalStock</ParentRole>
      <Position>27</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R28.htm</HtmlFileName>
      <LongName>2313301 - 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>
      <ParentRole>http://www.codexis.com/role/CommitmentsAndContingencies</ParentRole>
      <Position>28</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R29.htm</HtmlFileName>
      <LongName>2317301 - Disclosure - Significant Customer and Geographic Information (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/SignificantCustomerAndGeographicInformationTables</Role>
      <ShortName>Significant Customer and Geographic Information (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.codexis.com/role/SignificantCustomerAndGeographicInformation</ParentRole>
      <Position>29</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R30.htm</HtmlFileName>
      <LongName>2401401 - 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>30</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R31.htm</HtmlFileName>
      <LongName>2402402 - 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>31</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R32.htm</HtmlFileName>
      <LongName>2403402 - Disclosure - Net Income (Loss) per Share - Earnings Per Share (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/NetIncomeLossPerShareEarningsPerShareDetails</Role>
      <ShortName>Net Income (Loss) per Share - Earnings Per Share (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.codexis.com/role/NetIncomeLossPerShareTables</ParentRole>
      <Position>32</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R33.htm</HtmlFileName>
      <LongName>2403403 - Disclosure - Net Income (Loss) per Share - Anti-Dilutive Securities (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/NetIncomeLossPerShareAntiDilutiveSecuritiesDetails</Role>
      <ShortName>Net Income (Loss) per Share - Anti-Dilutive Securities (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.codexis.com/role/NetIncomeLossPerShareTables</ParentRole>
      <Position>33</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R34.htm</HtmlFileName>
      <LongName>2404401 - 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>34</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R35.htm</HtmlFileName>
      <LongName>2405402 - Disclosure - Cash Equivalents and Marketable Securities - Components of Cash Equivalents and Marketable Securities (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/CashEquivalentsAndMarketableSecuritiesComponentsOfCashEquivalentsAndMarketableSecuritiesDetails</Role>
      <ShortName>Cash Equivalents and Marketable Securities - Components of Cash Equivalents and Marketable Securities (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>35</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R36.htm</HtmlFileName>
      <LongName>2406402 - 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>36</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R37.htm</HtmlFileName>
      <LongName>2407402 - Disclosure - Balance Sheets Details - Accounts Receivable (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/BalanceSheetsDetailsAccountsReceivableDetails</Role>
      <ShortName>Balance Sheets Details - Accounts Receivable (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>37</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R38.htm</HtmlFileName>
      <LongName>2407403 - Disclosure - Balance Sheets Details  - Inventory (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/BalanceSheetsDetailsInventoryDetails</Role>
      <ShortName>Balance Sheets Details  - Inventory (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>38</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R39.htm</HtmlFileName>
      <LongName>2407404 - 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>39</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R40.htm</HtmlFileName>
      <LongName>2407405 - 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>40</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R41.htm</HtmlFileName>
      <LongName>2410402 - 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>41</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R42.htm</HtmlFileName>
      <LongName>2410403 - 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>42</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R43.htm</HtmlFileName>
      <LongName>2410404 - Disclosure - Stock-Based Compensation  - Valuation Assumptions (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/StockBasedCompensationValuationAssumptionsDetails</Role>
      <ShortName>Stock-Based Compensation  - Valuation Assumptions (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>43</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R44.htm</HtmlFileName>
      <LongName>2412402 - 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>44</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R45.htm</HtmlFileName>
      <LongName>2412403 - Disclosure - Capital Stock  - Stockholders' Equity (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/CapitalStockStockholdersEquityDetails</Role>
      <ShortName>Capital Stock  - Stockholders' Equity (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>45</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R46.htm</HtmlFileName>
      <LongName>2413402 - 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>46</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R47.htm</HtmlFileName>
      <LongName>2413403 - 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>47</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R48.htm</HtmlFileName>
      <LongName>2413404 - 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>48</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R49.htm</HtmlFileName>
      <LongName>2413405 - Disclosure - Commitments and Contingencies  - Prepayment Fees of Term Debt  (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/CommitmentsAndContingenciesPrepaymentFeesOfTermDebtDetails</Role>
      <ShortName>Commitments and Contingencies  - Prepayment Fees of Term Debt  (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>49</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R50.htm</HtmlFileName>
      <LongName>2414401 - 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>50</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R51.htm</HtmlFileName>
      <LongName>2417402 - Disclosure - Significant Customer and Geographic Information  - Concentration Risk (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/SignificantCustomerAndGeographicInformationConcentrationRiskDetails</Role>
      <ShortName>Significant Customer and Geographic Information  - Concentration Risk (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>51</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R52.htm</HtmlFileName>
      <LongName>2417403 - Disclosure - Significant Customer and Geographic Information  - Revenues by Geographic Area (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/SignificantCustomerAndGeographicInformationRevenuesByGeographicAreaDetails</Role>
      <ShortName>Significant Customer and Geographic Information  - Revenues by Geographic Area (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>52</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R53.htm</HtmlFileName>
      <LongName>2417404 - Disclosure - Significant Customer and Geographic Information  - Long-Lived Assets by Geographic Area (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/SignificantCustomerAndGeographicInformationLongLivedAssetsByGeographicAreaDetails</Role>
      <ShortName>Significant Customer and Geographic Information  - Long-Lived Assets by Geographic Area (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>53</Position>
    </Report>
    <Report instance="cdxs-20170930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R54.htm</HtmlFileName>
      <LongName>2422401 - 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>54</Position>
    </Report>
    <Report>
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <LongName>All Reports</LongName>
      <ReportType>Book</ReportType>
      <ShortName>All Reports</ShortName>
    </Report>
  </MyReports>
  <InputFiles>
    <File>cdxs-20170930.xml</File>
    <File>cdxs-20170930.xsd</File>
    <File>cdxs-20170930_cal.xml</File>
    <File>cdxs-20170930_def.xml</File>
    <File>cdxs-20170930_lab.xml</File>
    <File>cdxs-20170930_pre.xml</File>
  </InputFiles>
  <SupplementalFiles/>
  <BaseTaxonomies>
    <BaseTaxonomy>http://xbrl.sec.gov/country/2017-01-31</BaseTaxonomy>
    <BaseTaxonomy>http://fasb.org/us-gaap/2017-01-31</BaseTaxonomy>
    <BaseTaxonomy>http://xbrl.sec.gov/dei/2014-01-31</BaseTaxonomy>
    <BaseTaxonomy>http://xbrl.sec.gov/invest/2013-01-31</BaseTaxonomy>
  </BaseTaxonomies>
  <HasPresentationLinkbase>true</HasPresentationLinkbase>
  <HasCalculationLinkbase>true</HasCalculationLinkbase>
</FilingSummary>
