<?xml version='1.0' encoding='UTF-8'?>
<FilingSummary>
  <Version>3.7.0.1</Version>
  <ProcessingTime/>
  <ReportFormat>html</ReportFormat>
  <ContextCount>215</ContextCount>
  <ElementCount>352</ElementCount>
  <EntityCount>1</EntityCount>
  <FootnotesReported>true</FootnotesReported>
  <SegmentCount>72</SegmentCount>
  <ScenarioCount>0</ScenarioCount>
  <TuplesReported>false</TuplesReported>
  <UnitCount>8</UnitCount>
  <MyReports>
    <Report instance="cdxs-20161231.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-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R2.htm</HtmlFileName>
      <LongName>1001000 - Statement - Consolidated Balance Sheets</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/ConsolidatedBalanceSheets</Role>
      <ShortName>Consolidated Balance Sheets</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>2</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R3.htm</HtmlFileName>
      <LongName>1001501 - Statement - Consolidated Balance Sheets (Parenthetical)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/ConsolidatedBalanceSheetsParenthetical</Role>
      <ShortName>Consolidated Balance Sheets (Parenthetical)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>3</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R4.htm</HtmlFileName>
      <LongName>1002000 - Statement - Consolidated Statements of Operations</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/ConsolidatedStatementsOfOperations</Role>
      <ShortName>Consolidated Statements of Operations</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>4</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R5.htm</HtmlFileName>
      <LongName>1003000 - Statement - Consolidated Statements of Comprehensive Loss</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/ConsolidatedStatementsOfComprehensiveLoss</Role>
      <ShortName>Consolidated Statements of Comprehensive Loss</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>5</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R6.htm</HtmlFileName>
      <LongName>1003001 - Statement - Consolidated Statements of Comprehensive Loss (Parenthetical)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/ConsolidatedStatementsOfComprehensiveLossParenthetical</Role>
      <ShortName>Consolidated Statements of Comprehensive Loss (Parenthetical)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>6</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R7.htm</HtmlFileName>
      <LongName>1004000 - Statement - Consolidated Statements Stockholders' Equity</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/ConsolidatedStatementsStockholdersEquity</Role>
      <ShortName>Consolidated Statements Stockholders' Equity</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>7</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R8.htm</HtmlFileName>
      <LongName>1005000 - Statement - Consolidated Statements of Cash Flows</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/ConsolidatedStatementsOfCashFlows</Role>
      <ShortName>Consolidated Statements of Cash Flows</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>8</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R9.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>9</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R10.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>10</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R11.htm</HtmlFileName>
      <LongName>2103100 - 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>11</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R12.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>12</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R13.htm</HtmlFileName>
      <LongName>2106100 - 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>13</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R14.htm</HtmlFileName>
      <LongName>2107100 - 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>14</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R15.htm</HtmlFileName>
      <LongName>2108100 - 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>15</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R16.htm</HtmlFileName>
      <LongName>2109100 - Disclosure - Assets Held for Sale and Sale of Former Hungarian Subsidiary</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/AssetsHeldForSaleAndSaleOfFormerHungarianSubsidiary</Role>
      <ShortName>Assets Held for Sale and Sale of Former Hungarian Subsidiary</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>16</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R17.htm</HtmlFileName>
      <LongName>2111100 - 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>17</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R18.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>18</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R19.htm</HtmlFileName>
      <LongName>2113100 - Disclosure - 401(k) Plan</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/A401KPlan</Role>
      <ShortName>401(k) Plan</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>19</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R20.htm</HtmlFileName>
      <LongName>2114100 - Disclosure - Income Taxes</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/IncomeTaxes</Role>
      <ShortName>Income Taxes</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>20</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R21.htm</HtmlFileName>
      <LongName>2115100 - 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>21</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R22.htm</HtmlFileName>
      <LongName>2116100 - 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>22</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R23.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>23</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R24.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>24</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R25.htm</HtmlFileName>
      <LongName>2302302 - Disclosure - Basis of Presentation and Summary of Significant Accounting Policies (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/BasisOfPresentationAndSummaryOfSignificantAccountingPoliciesTables</Role>
      <ShortName>Basis of Presentation and Summary of Significant Accounting Policies (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.codexis.com/role/BasisOfPresentationAndSummaryOfSignificantAccountingPolicies</ParentRole>
      <Position>25</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R26.htm</HtmlFileName>
      <LongName>2303301 - 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>26</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R27.htm</HtmlFileName>
      <LongName>2306301 - 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>27</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R28.htm</HtmlFileName>
      <LongName>2307301 - 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>28</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R29.htm</HtmlFileName>
      <LongName>2308301 - 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>29</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R30.htm</HtmlFileName>
      <LongName>2311301 - 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>30</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R31.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>31</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R32.htm</HtmlFileName>
      <LongName>2314301 - Disclosure - Income Taxes (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/IncomeTaxesTables</Role>
      <ShortName>Income Taxes (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.codexis.com/role/IncomeTaxes</ParentRole>
      <Position>32</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R33.htm</HtmlFileName>
      <LongName>2315301 - 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>33</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R34.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>34</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R35.htm</HtmlFileName>
      <LongName>2402403 - Disclosure - Basis of Presentation and Summary of Significant Accounting Policies - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/BasisOfPresentationAndSummaryOfSignificantAccountingPoliciesNarrativeDetails</Role>
      <ShortName>Basis of Presentation and Summary of Significant Accounting Policies - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.codexis.com/role/BasisOfPresentationAndSummaryOfSignificantAccountingPoliciesTables</ParentRole>
      <Position>35</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R36.htm</HtmlFileName>
      <LongName>2402404 - Disclosure - Basis of Presentation and Summary of Significant Accounting Policies - Plant, Property, and Equipment (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/BasisOfPresentationAndSummaryOfSignificantAccountingPoliciesPlantPropertyAndEquipmentDetails</Role>
      <ShortName>Basis of Presentation and Summary of Significant Accounting Policies - Plant, Property, and Equipment (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>36</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R37.htm</HtmlFileName>
      <LongName>2403402 - Disclosure - Net Loss per Share (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/NetLossPerShareDetails</Role>
      <ShortName>Net Loss per Share (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.codexis.com/role/NetLossPerShareTables</ParentRole>
      <Position>37</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R38.htm</HtmlFileName>
      <LongName>2404401 - Disclosure - Collaborative Arrangements (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/CollaborativeArrangementsDetails</Role>
      <ShortName>Collaborative Arrangements (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.codexis.com/role/CollaborativeArrangements</ParentRole>
      <Position>38</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R39.htm</HtmlFileName>
      <LongName>2406402 - 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>
      <ParentRole>http://www.codexis.com/role/CashEquivalentsAndMarketableSecuritiesTables</ParentRole>
      <Position>39</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R40.htm</HtmlFileName>
      <LongName>2406403 - Disclosure - Cash Equivalents and Marketable Securities (Additional Information) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/CashEquivalentsAndMarketableSecuritiesAdditionalInformationDetails</Role>
      <ShortName>Cash Equivalents and Marketable Securities (Additional Information) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.codexis.com/role/CashEquivalentsAndMarketableSecuritiesTables</ParentRole>
      <Position>40</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R41.htm</HtmlFileName>
      <LongName>2407403 - Disclosure - Fair Value Measurements - Financial Assets measured at Fair Value on a Recurring Basis (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/FairValueMeasurementsFinancialAssetsMeasuredAtFairValueOnRecurringBasisDetails</Role>
      <ShortName>Fair Value Measurements - Financial Assets measured at Fair Value on a Recurring Basis (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>41</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R42.htm</HtmlFileName>
      <LongName>2407404 - Disclosure - Fair Value Measurements - Textual (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/FairValueMeasurementsTextualDetails</Role>
      <ShortName>Fair Value Measurements - Textual (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>42</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R43.htm</HtmlFileName>
      <LongName>2408402 - Disclosure - Balance Sheets Details - Allowance for Doubtful Accounts Receivable (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/BalanceSheetsDetailsAllowanceForDoubtfulAccountsReceivableDetails</Role>
      <ShortName>Balance Sheets Details - Allowance for Doubtful Accounts Receivable (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>43</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R44.htm</HtmlFileName>
      <LongName>2408403 - Disclosure - Balance Sheets Details - Schedule of Inventory Components (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/BalanceSheetsDetailsScheduleOfInventoryComponentsDetails</Role>
      <ShortName>Balance Sheets Details - Schedule of Inventory Components (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>44</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R45.htm</HtmlFileName>
      <LongName>2408404 - 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>45</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R46.htm</HtmlFileName>
      <LongName>2408405 - Disclosure - Balance Sheets Details - Intangible Assets (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/BalanceSheetsDetailsIntangibleAssetsDetails</Role>
      <ShortName>Balance Sheets Details - Intangible Assets (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>46</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R47.htm</HtmlFileName>
      <LongName>2408406 - Disclosure - Balance Sheets Details - Textual (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/BalanceSheetsDetailsTextualDetails</Role>
      <ShortName>Balance Sheets Details - Textual (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>47</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R48.htm</HtmlFileName>
      <LongName>2408407 - 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>48</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R49.htm</HtmlFileName>
      <LongName>2409401 - Disclosure - Assets Held for Sale and Sale of Former Hungarian Subsidiary - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/AssetsHeldForSaleAndSaleOfFormerHungarianSubsidiaryNarrativeDetails</Role>
      <ShortName>Assets Held for Sale and Sale of Former Hungarian Subsidiary - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.codexis.com/role/AssetsHeldForSaleAndSaleOfFormerHungarianSubsidiary</ParentRole>
      <Position>49</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R50.htm</HtmlFileName>
      <LongName>2411402 - 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>50</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R51.htm</HtmlFileName>
      <LongName>2411403 - 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>51</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R52.htm</HtmlFileName>
      <LongName>2411404 - Disclosure - Stock-based Compensation - Stock Option Assumptions (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/StockBasedCompensationStockOptionAssumptionsDetails</Role>
      <ShortName>Stock-based Compensation - Stock Option Assumptions (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>52</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R53.htm</HtmlFileName>
      <LongName>2411405 - Disclosure - Stock-based Compensation - Option Activity (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/StockBasedCompensationOptionActivityDetails</Role>
      <ShortName>Stock-based Compensation - Option Activity (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>53</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R54.htm</HtmlFileName>
      <LongName>2411406 - Disclosure - Stock-based Compensation - Equity Instruments Other than Options Activity (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/StockBasedCompensationEquityInstrumentsOtherThanOptionsActivityDetails</Role>
      <ShortName>Stock-based Compensation - Equity Instruments Other than Options Activity (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>54</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R55.htm</HtmlFileName>
      <LongName>2412402 - Disclosure - Capital Stock - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/CapitalStockNarrativeDetails</Role>
      <ShortName>Capital Stock - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>55</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R56.htm</HtmlFileName>
      <LongName>2412403 - Disclosure - Capital Stock - Warrants (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/CapitalStockWarrantsDetails</Role>
      <ShortName>Capital Stock - Warrants (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>56</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R57.htm</HtmlFileName>
      <LongName>2413401 - Disclosure - 401(k) Plan (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/A401KPlanDetails</Role>
      <ShortName>401(k) Plan (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.codexis.com/role/A401KPlan</ParentRole>
      <Position>57</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R58.htm</HtmlFileName>
      <LongName>2414402 - Disclosure - Income Taxes - Components of Loss Before Provision for Income Taxes (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/IncomeTaxesComponentsOfLossBeforeProvisionForIncomeTaxesDetails</Role>
      <ShortName>Income Taxes - Components of Loss Before Provision for Income Taxes (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>58</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R59.htm</HtmlFileName>
      <LongName>2414403 - Disclosure - Income Taxes - Components of Provision for Income Taxes (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/IncomeTaxesComponentsOfProvisionForIncomeTaxesDetails</Role>
      <ShortName>Income Taxes - Components of Provision for Income Taxes (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>59</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R60.htm</HtmlFileName>
      <LongName>2414404 - Disclosure - Income Taxes - Tax Rate Reconciliation (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/IncomeTaxesTaxRateReconciliationDetails</Role>
      <ShortName>Income Taxes - Tax Rate Reconciliation (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>60</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R61.htm</HtmlFileName>
      <LongName>2414405 - Disclosure - Income Taxes - Components of Deferred Tax Assets and Liabilities (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/IncomeTaxesComponentsOfDeferredTaxAssetsAndLiabilitiesDetails</Role>
      <ShortName>Income Taxes - Components of Deferred Tax Assets and Liabilities (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>61</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R62.htm</HtmlFileName>
      <LongName>2414406 - Disclosure - Income Taxes - Unrecognized Tax Benefit Rollforward (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/IncomeTaxesUnrecognizedTaxBenefitRollforwardDetails</Role>
      <ShortName>Income Taxes - Unrecognized Tax Benefit Rollforward (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>62</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R63.htm</HtmlFileName>
      <LongName>2414407 - Disclosure - Income Taxes - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/IncomeTaxesNarrativeDetails</Role>
      <ShortName>Income Taxes - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>63</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R64.htm</HtmlFileName>
      <LongName>2415402 - Disclosure - Commitments and Contingencies - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/CommitmentsAndContingenciesNarrativeDetails</Role>
      <ShortName>Commitments and Contingencies - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>64</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R65.htm</HtmlFileName>
      <LongName>2415403 - Disclosure - Commitments and Contingencies - Future Minimum Payments Under Operating Leases (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/CommitmentsAndContingenciesFutureMinimumPaymentsUnderOperatingLeasesDetails</Role>
      <ShortName>Commitments and Contingencies - Future Minimum Payments Under Operating Leases (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>65</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R66.htm</HtmlFileName>
      <LongName>2416401 - Disclosure - Related Party Transactions (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/RelatedPartyTransactionsDetails</Role>
      <ShortName>Related Party Transactions (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.codexis.com/role/RelatedPartyTransactions</ParentRole>
      <Position>66</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R67.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>67</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R68.htm</HtmlFileName>
      <LongName>2417403 - Disclosure - Significant Customer and Geographic Information - Revenues (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/SignificantCustomerAndGeographicInformationRevenuesDetails</Role>
      <ShortName>Significant Customer and Geographic Information - Revenues (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.codexis.com/role/SignificantCustomerAndGeographicInformationTables</ParentRole>
      <Position>68</Position>
    </Report>
    <Report instance="cdxs-20161231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R69.htm</HtmlFileName>
      <LongName>2417404 - Disclosure - Significant Customer and Geographic Information - Long-lived assets (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.codexis.com/role/SignificantCustomerAndGeographicInformationLongLivedAssetsDetails</Role>
      <ShortName>Significant Customer and Geographic Information - Long-lived assets (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>69</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-20161231.xml</File>
    <File>cdxs-20161231.xsd</File>
    <File>cdxs-20161231_cal.xml</File>
    <File>cdxs-20161231_def.xml</File>
    <File>cdxs-20161231_lab.xml</File>
    <File>cdxs-20161231_pre.xml</File>
  </InputFiles>
  <SupplementalFiles/>
  <BaseTaxonomies/>
  <HasPresentationLinkbase>true</HasPresentationLinkbase>
  <HasCalculationLinkbase>true</HasCalculationLinkbase>
</FilingSummary>
