
February 21, 2025 Exelon Corporation 10 South Dearborn Street 49th Floor Chicago, Illinois 60603-3005 RE: Issuance of $500,000,000 of Exelon Corporation’s 5.125% notes due 2031 and $500,000,000 of its 5.875% notes due 2055 Ladies and Gentlemen: We have acted as counsel to Exelon Corporation (the “Company”), in connection with the issuance and sale by the Company of $500,000,000 of its 5.125% notes due 2031 (the “2031 Notes”) and $500,000,000 of its 5.875% notes due 2055 (the “2055 Notes” and, together with the 2031 Notes, the “Notes”), covered by the Registration Statement on Form S-3, No. 333-266487 (as amended, the “Registration Statement”), filed by the Company with the U.S. Securities and Exchange Commission (“SEC”) on August 3, 2022 under the Securities Act of 1933, as amended. The Notes were issued under the terms of the Indenture, dated as of June 11, 2015 (the “Base Indenture”) between the Company and The Bank of New York Mellon Trust Company, N. A., as trustee (the “Trustee”), as supplemented and amended by the First Supplemental Indenture, dated as of June 11, 2015 (the “First Supplemental Indenture”), the Second Supplemental Indenture, dated as of December 2, 2015 (the “Second Supplemental Indenture”), the Third Supplemental Indenture, dated as of April 7, 2016 (the “Third Supplemental Indenture”), the Fourth Supplemental Indenture, dated as of April 1, 2020 (the “Fourth Supplemental Indenture”), the Fifth Supplemental Indenture, dated as of March 7, 2022 (the “Fifth Supplemental Indenture”), the Sixth Supplemental Indenture, dated as of February 1, 2023 (the “Sixth Supplemental Indenture”), the Seventh Supplemental Indenture, dated as of February 27, 2024 (the “Seventh Supplemental Indenture”), and the Eighth Supplemental Indenture, dated as of February 1, 2025 (the “Eighth Supplemental Indenture” and, collectively with the First Supplemental Indenture, the Second Supplemental Indenture, the Third Supplemental Indenture, the Fourth Supplemental Indenture, the Fifth Supplemental Indenture, the Sixth Supplemental Indenture, the Seventh Supplemental Indenture, and the Base Indenture, the “Indenture”), which Indenture is governed under the laws of the State of New York, and sold by the Company pursuant to the Underwriting Agreement dated February 18, 2025 among the Company, Barclays Capital Inc., BNP Paribas Securities Corp., BofA Securities, Inc., J.P. Morgan Securities LLC, and Morgan Stanley & Co. LLC. We have examined originals or copies, certified or otherwise identified to our satisfaction, of (i) the Registration Statement and all exhibits thereto, (ii) the Prospectus Supplement, (iii) the Amended and Restated Articles of Incorporation of the Company, and (iv) the Amended and Restated Bylaws of the

Exelon Corporation February 21, 2025 Page 2 Company. We have also examined such corporate records and other agreements, documents and instruments, such certificates or comparable documents of public officials and officers and representatives of the Company, have made such inquiries of such officers and representatives and have considered such matters of law as we have deemed appropriate as the basis for the opinions hereinafter set forth. In delivering this opinion, we have assumed the genuineness of all signatures, the legal capacity of natural persons, the authenticity of all documents submitted to us as originals, the conformity to originals of all documents submitted to us as certified, photostatic or conformed copies, the authenticity of originals of all such latter documents, and the accuracy and completeness of all records, information and statements submitted to us by officers and representatives of the Company. In making our examination of documents executed by parties other than the Company, we have assumed that such parties had the power, corporate or other, to enter into and perform all obligations thereunder and have also assumed the due authorization of all requisite action, corporate or other, and execution and delivery by such parties of such documents and the validity and binding effect thereof with respect to such parties. Based upon and subject to the limitations and assumptions set forth herein, we are of the opinion that: 1. The Company is a corporation duly organized and validly subsisting under the laws of the Commonwealth of Pennsylvania; and 2. The Notes are legally issued and binding obligations of the Company enforceable against the Company in accordance with their respective terms (except to the extent enforceability may be limited by applicable bankruptcy, insolvency, reorganization, moratorium, fraudulent transfer or other similar laws affecting the enforcement of creditors’ rights generally and by the effect of general principles of equity, regardless of whether considered in a proceeding in equity or at law). We express no opinion as to the law of any jurisdiction other than the Commonwealth of Pennsylvania, the State of New York and the federal laws of the United States. We hereby consent to the filing of this letter as Exhibit 5.1 to the Registration Statement, and to the use therein of this firm’s name therein under the caption “Legal Matters.” In giving such consent, we do not hereby 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. Very truly yours,