Exhibit 5.1
omelvenylogoa.jpg
O’Melveny & Myers LLPT: +1 415 984 8700File Number:
Two Embarcadero CenterF: +1 415 984 87010368375-00001
28th Flooromm.com
San Francisco, CA 94111-3823

August 1, 2025
Heartflow, Inc.
331 E. Evelyn Avenue
Mountain View, California 94104
Re:    Registration Statement on Form S-1 (File No. 333-288733)
We have acted as special counsel to Heartflow, Inc., a Delaware corporation (the “Company”), in connection with the offer and sale by the Company of up to 14,375,000 shares (the “Shares”) of the Company’s common stock, par value $0.001 per share (the “Common Stock”), pursuant to an underwriting agreement (the “Agreement”) among the Company and J.P. Morgan Securities LLC, Morgan Stanley & Co. LLC and Piper Sandler & Co., as representatives of the underwriters. The Shares are being offered and sold pursuant to the registration statement on Form S-1 (File No. 333-288733) (as amended, the “Registration Statement”), including a related prospectus filed with the Registration Statement, initially filed by the Company with the Securities and Exchange Commission (the “Commission”) under the Securities Act of 1933, as amended (the “Securities Act”), on July 17, 2025. The term “Shares” is inclusive of 1,875,000 shares of Common Stock subject to the underwriters’ option to purchase additional shares of Common Stock from the Company pursuant to the Agreement, and shall include any additional shares of Common Stock registered by the Company pursuant to Rule 462(b) under the Securities Act in connection with the offering contemplated by the Registration Statement.
In our capacity as such counsel, we have examined originals or copies of those corporate and other records and documents we considered appropriate, including, among other things, the following:
(a)    the Registration Statement;
(b)    the Amended and Restated Certificate of Incorporation and Amended and Restated Bylaws of the Company, each as amended through the date hereof; and
(c)    originals or copies of resolutions and actions by written consent of the board of directors of the Company relating to the preparation and filing of the Registration Statement, the offering of the Shares and related matters.
We have assumed the genuineness of all signatures, the authenticity of all documents submitted to us as originals and the conformity with originals of all documents submitted to us as copies. In addition, we have obtained and relied upon those certificates of public officials we considered appropriate.
Based on this examination, our reliance upon the assumptions in this letter and our consideration of those questions of law we considered relevant, and subject to the limitations and qualifications in this letter, we are of the opinion that the issuance of the Shares has been duly authorized by all necessary corporate action on the part of the Company, and upon payment for and delivery of the Shares in accordance with the Agreement, the Shares will be validly issued, fully paid and non-assessable.
Austin • Century City • Dallas • Houston • Los Angeles • Newport Beach • New York • San Francisco • Silicon Valley • Washington, DC
Beijing • Brussels • Hong Kong • London • Seoul • Shanghai • Singapore • Tokyo

omelvenylogoa.jpg
The law covered by this letter is limited to the present General Corporation Law of the State of Delaware. We express no opinion as to the laws of any other jurisdiction and no opinion regarding the statutes, administrative decisions, rules, regulations or requirements of any county, municipality, subdivision or local authority of any jurisdiction.
This letter is being furnished in accordance with the requirements of Item 601(b)(5) of Regulation S-K promulgated under the Securities Act, and no opinion is expressed herein as to any matter pertaining to the contents of the Registration Statement, the prospectus included in the Registration Statement, any registration statement under Rule 462(b) or any prospectus supplement, other than as expressly stated herein with respect to the Shares.
This letter is expressly limited to the matters set forth above, and we render no opinion, whether by implication or otherwise, as to any other matters. This letter speaks only as of the date hereof and we assume no obligation to update or supplement this letter to reflect any facts or circumstances that arise after the date hereof and come to our attention or any future changes in laws.
We hereby consent to the use of this letter as an exhibit to the Registration Statement and to the reference to this firm under the heading “Legal matters” in the prospectus constituting part of the Registration Statement. We further consent to the incorporation by reference of this letter and the foregoing consent into any registration statement filed pursuant to Rule 462(b) under the Securities Act with respect to the Shares. In giving such consent, we do not admit that we are in the category of persons whose consent is required under Section 7 of the Securities Act or the rules and regulations of the Commission thereunder.
Respectfully submitted,
/s/ O’Melveny & Myers LLP
2