August 9, 2022 Exelon Corporation 10 South Dearborn Street P.O. Box 805379 Chicago, Illinois 60680-5379 RE: 12,995,000 shares of the Company’s Common Stock Ladies and Gentlemen: We have acted as counsel to Exelon Corporation (the “Company”), in connection with the issuance and sale by the Company of up to 12,995,000 shares of the Company’s Common Stock, no par value (the “Shares”), including up to 1,695,000 Shares that may be sold pursuant to the exercise of an option to purchase additional shares, covered by the Registration Statement on Form S-3, No. 333-266487 (the “Registration Statement”), that was filed by the Company with the U.S. Securities and Exchange Commission (“SEC”) and became effective on August 3, 2022 under the Securities Act of 1933, as amended. The Shares will be issued pursuant to that certain Underwriting Agreement, dated August 4, 2022, by and among the Company, Barclays Capital Inc., Goldman Sachs & Co. LLC, J.P. Morgan Securities LLC, and Morgan Stanley & Co. LLC, as representatives of the several underwriters named therein and as forward sellers. We have examined originals or copies, certified or otherwise identified to our satisfaction, of (i) the Registration Statement and all exhibits thereto, (ii) the base prospectus included in the Registration Statement, (iii) the prospectus supplement relating to the Shares filed with the SEC on August 8, 2022 (the “Prospectus Supplement”), (iv) the Amended and Restated Articles of Incorporation, as amended, of the Company, and (v) the Amended and Restated Bylaws, as amended, of the Company. We have also examined such corporate records and other agreements, documents and instruments, and such certificates or comparable documents of public officials and officers and representatives of the Company, and 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.
Exelon Corporation August 9, 2022 Page 2 Based upon and subject to the limitations and assumptions set forth herein, we are of the opinion that the shares have been duly authorized, and upon issuance and delivery against payment therefor in accordance with the terms of the Underwriting Agreement, will be validly issued, fully paid and non-assessable. We express no opinion as to the law of any jurisdiction other than the Commonwealth of Pennsylvania and the federal laws of the United States. We hereby consent to the filing of this opinion letter as an exhibit 5.1 to the Current Report on Form 8-K to which it is attached, and to the reference to our firm under the caption “Legal Matters” in the Prospectus Supplement relating to the Shares. 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, /s/ Ballard Spahr LLP