Exhibit 5.1





August 3, 2023

  505 Montgomery Street, Suite 2000
  San Francisco, California 94111-6538

Tel: +1.415.391.0600 Fax: +1.415.395.8095


  Austin    Milan
  Beijing    Munich
  Boston    New York
  Brussels    Orange County
  Century City    Paris
  Chicago    Riyadh
  Dubai    San Diego
  Düsseldorf    San Francisco
  Frankfurt    Seoul
  Hamburg    Shanghai
  Hong Kong    Silicon Valley
  Houston    Singapore
  London    Tel Aviv
  Los Angeles    Tokyo
  Madrid    Washington, D.C.

Codexis, Inc.

200 Penobscot Drive

Redwood City, California 94063



Registration Statement on Form S-8; 2,000,000 shares of Common Stock of Codexis, Inc., par value $0.0001 per share

To the addressee set forth above:

We have acted as special counsel to Codexis, Inc., a Delaware corporation (the “Company”), in connection with the registration by the Company of an aggregate of 2,000,000 shares of common stock of the Company, par value $0.0001 per share (the “Shares”), issuable pursuant to the Company’s 2023 Employee Stock Purchase Plan, as amended (the “Plan”). The Shares are included in a registration statement on Form S-8 under the Securities Act of 1933, as amended (the “Act”), filed with the Securities and Exchange Commission (the “Commission”) on August 3, 2023 (the “Registration Statement”). This opinion is being furnished in connection with the requirements of Item 601(b)(5) of Regulation S-K under the Act, and no opinion is expressed herein as to any matter pertaining to the contents of the Registration Statement or the related prospectus, other than as expressly stated herein with respect to the issuance of the Shares.

As such counsel, we have examined such matters of fact and questions of law as we have considered appropriate for purposes of this letter. With your consent, we have relied upon certificates and other assurances of officers of the Company and others as to factual matters without having independently verified such factual matters. We are opining herein as to the General Corporation Law of the State of Delaware (the “DGCL”), and we express no opinion with respect to any other laws.

August 3, 2023

Page 2




Subject to the foregoing and the other matters set forth herein, it is our opinion that, as of the date hereof, when the Shares shall have been duly registered on the books of the transfer agent and registrar therefor in the name or on behalf of the purchasers, or certificates representing the Shares have been manually signed by an authorized officer of the transfer agent and registrar therefor, and have been issued by the Company for legal consideration (not less than par value) in the circumstances contemplated by the Plan, assuming in each case that the individual issuances, grants or awards under the Plan are duly authorized by all necessary corporate action and duly issued, granted or awarded and exercised in accordance with the requirements of law and the Plan (and the agreements and awards duly adopted thereunder and in accordance therewith), the issuance and sale of the Shares will have been duly authorized by all necessary corporate action of the Company, and the Shares will be validly issued, fully paid and nonassessable. In rendering the foregoing opinion, we have assumed that the Company will comply with all applicable notice requirements regarding uncertificated shares provided in the DGCL.

This opinion is for your benefit in connection with the Registration Statement and may be relied upon by you and by persons entitled to rely upon it pursuant to the applicable provisions of the Act. We consent to your filing this opinion as an exhibit to the Registration Statement. In giving such consent, we do not thereby admit that we are in the category of persons whose consent is required under Section 7 of the Act or the rules and regulations of the Commission thereunder.



/s/ Latham & Watkins LLP