Exhibit 23.1

Consent of Independent Registered Public Accounting Firm

We consent to the reference to our firm under the caption “Experts” in the Registration Statement (Form S-1) and related Prospectus of Medline Inc. for the registration of shares of its Class A common stock and to the incorporation by reference therein of our report dated February 25, 2026, with respect to the consolidated financial statements of Medline Inc. incorporated by reference in its Annual Report (Form 10-K) for the year ended December 31, 2025, filed with the Securities and Exchange Commission.

/s/ Ernst & Young LLP

Chicago, Illinois

March 2, 2026