Exhibit 23.1

Consent of Independent Registered Public Accounting Firm

We consent to the incorporation by reference in the Registration Statement (Form S-8 No. 333-230498) pertaining to the McDonald’s Corporation 401(k) Plan of McDonald’s Corporation of our report dated June 18, 2026, with respect to the financial statements and schedule of the McDonald’s Corporation 401(k) Plan included in this Annual Report (Form 11-K) for the year ended December 31, 2025.

/s/ Ernst & Young LLP

Chicago, Illinois

June 18, 2026