
February 24, 2026
MGE Energy, Inc.
133 South Blair Street
Madison, Wisconsin 53788
Ladies and Gentlemen:
We refer to the filing of a Registration Statement on Form S-3 (the “Registration Statement”) by MGE Energy, Inc., a Wisconsin corporation (the “Company”), and Madison Gas and Electric Company, a Wisconsin corporation, with the Securities and Exchange Commission (“Commission”) under the Securities Act of 1933, as amended (the “Act”), relating, among other things, to (i) the offer and sale of a presently indeterminate number of shares of common stock, par value $1 per share, of the Company (“Common Stock”); (ii) an indeterminate amount of one or more series of unsecured debt securities of the Company (“Debt Securities”), which may be unsecured senior debt securities and/or unsecured subordinated debt securities; (iii) an indeterminate number of warrants to purchase Common Stock or Debt Securities (the “Warrants”); (iv) an indeterminate number of stock purchase contracts (the “Stock Purchase Contracts”) entitling or obligating the holders thereof to purchase from the Company, and the Company to sell to the holders thereof, shares of Common Stock at a future date or dates; (v) an indeterminate number of stock purchase units (the “Stock Purchase Units”), each representing ownership of a Stock Purchase Contract and a Debt Security or debt obligation of a third party, including United States Treasury securities, or any combination of the foregoing, securing the holder’s obligation to purchase shares of Common Stock under the applicable Stock Purchase Contract, and (vi) an indeterminate number of units (the “Other Units”), each representing ownership of two or more securities described in the preceding clauses (i) through (v). The Common Stock, Debt Securities, the Warrants, the Stock Purchase Contracts, the Stock Purchase Units and the Other Units are collectively referred to herein as the “Securities.”
The Common Stock may be sold in underwritten public offerings, through dealers, through sales agents, directly to purchasers or through a combination of these methods, or purchased under the Company’s Direct Stock Purchase and Dividend Reinvestment Plan (the “Plan”), the prospectus for which is included in the Registration Statement (the “Direct Stock Purchase Prospectus”).
Unless otherwise specified in the applicable prospectus supplement, the Debt Securities will be issued under one or more indentures (the “Indenture”) to be entered into between the Company and a trustee, substantially in the form that has been or will be filed and incorporated by reference as an exhibit to the Registration Statement.
We are also familiar with and have examined the Amended and Restated Articles of Incorporation, as amended to the date hereof (the “Articles of Incorporation”) and the Amended and Restated Bylaws of the Company, as amended to the date hereof (the “Bylaws”) and the resolutions (the “Resolutions”) of the Board of Directors of the Company relating to the Plan and the Registration Statement. We have examined originals, or copies of originals, of such agreements, documents, certificates and statements of the Company that we considered relevant for purposes of this opinion. In our examination, we have assumed the genuineness of all signatures, the authenticity of all documents submitted to us as certified or photostatic copies, and the authenticity of the originals of such latter documents. As to any facts material to the opinion expressed herein which were not independently established or verified by us, we have relied upon statements and representations of certain officers and other representatives of the Company and others.
Based upon the foregoing, we are of the opinion that:
1.The Company is validly existing under the laws of the State of Wisconsin and has the corporate authority to execute, deliver and perform its obligations under the Registration Statement and the Indenture.
2.With respect to shares of Common Stock issued under the Plan, such shares of Common Stock will be validly issued, fully paid and non-assessable when (i) such shares of Common Stock shall have been issued as authorized by the Company in accordance with the Plan; (ii) the Registration Statement (including any necessary post-effective amendments) and the Direct Stock Purchase Prospectus shall have become effective under the Act; (iii) appropriate certificates representing such shares of Common Stock issued under the Plan have been duly executed and have been registered and issued by the Company’s registrar or, if applicable, when book-entry shares shall have been duly registered on the books of the Company’s transfer agent and registrar (but which issuance, when combined with previous issuances of Common Stock by the Company, shall not result in the Company having issued more than 75 million shares of Common Stock); and (iv) upon receipt of the consideration to be received therefor in an amount not less than the par value thereof.
3.With respect to an offering of shares of Common Stock covered by the Registration Statement other than shares of Common Stock issued under the Plan, such shares of Common Stock will be validly issued, fully paid and non-assessable when (i) the Registration Statement (including any necessary post-effective amendments) shall have become effective under the Act; (ii) a prospectus supplement with respect to such shares of Common Stock shall have been filed with the Commission in compliance with the Act and the rules and regulations thereunder; (iii) the Company’s Board of Directors, or a duly authorized committee thereof, shall have approved the final resolutions in conformity with the Articles of Incorporation, the Bylaws and the Resolutions authorizing the issuance and sale of shares of Common Stock (but which issuance, when combined with previous issuances of Common Stock by the Company, shall not result in the Company having issued more than 75 million shares of Common Stock); and (iv) certificates representing such shares of Common Stock shall have been executed, countersigned and registered and duly delivered in accordance with the applicable definitive purchase, underwriting or similar agreement to the purchasers thereof against payment of the agreed consideration therefor in an amount not less than the par value thereof (or, if any such shares of Common Stock are issued in uncertificated form, the Company’s books shall reflect the issuance of such shares of Common Stock in accordance with the applicable definitive purchase, underwriting or similar agreement, against payment of the agreed consideration therefor in an amount not less than the par value thereof).
4.If the Company legally and validly reacquires issued and outstanding shares of Common Stock and thereafter, pursuant to the authorization by the Company’s Board of Directors or a duly authorized committee thereof, resells such shares, upon receipt by the Company of full payment therefor in accordance with the corporate authorization (but not less than the par value), such shares will be validly issued, fully paid and non-assessable.
In providing this opinion, we have assumed that, at the time of issuance, sale and delivery of any of the Securities, that:
•The applicable Securities being offered will be issued and sold as contemplated in the Registration Statement and the prospectus supplement relating thereto;
•The execution, delivery and performance by the Company of the Indenture and each supplemental indenture to the Indenture establishing the form and terms of the Debt Securities of each series, and the issuance, sale and delivery of the applicable Securities will not (A) contravene or violate the Articles of Incorporation or Bylaws; (B) violate any applicable law, rule or regulation applicable to the Company; (C) result in a default under or breach of any agreement or instrument binding upon the Company or any order, judgment or decree of any court or governmental authority applicable to the Company; or (D) require any authorization, approval or other action by, or notice or filing with, any court or governmental authority (other than such authorizations, approvals, actions, notices or filings which shall have been obtained or made, as the case may be, and which shall be in full force and effect);
•The authorization by the Company of the transactions described above and the instruments, agreements and other documents entered into and to be entered into by the Company as described above will not have been modified or rescinded, and there will not have occurred any change in law affecting the validity, legally binding character or enforceability of any such agreements, instruments or other documents; and
•The Articles of Incorporation and the Bylaws, as currently in effect, will not have been modified or amended and will be in full force and effect.
Our opinions are limited to the laws of the State of Wisconsin and the General Corporation Law of the State of Wisconsin, and we express no opinion as to the laws, rules or regulations of any other jurisdiction, including, without limitation, the federal laws of the United States of America or any state securities or blue sky laws. We assume no obligation to update or supplement this opinion to reflect any facts or circumstances which may hereafter come to our attention with respect to the opinions expressed above, including any changes in applicable law which may hereafter occur. We hereby consent to the filing of this opinion letter as an exhibit to the Registration Statement and to all references to our firm included in or made part of the Registration Statement. In giving such consent, we do not admit that we are within the category of persons whose consent is required by Section 7 of the Act or the related rules promulgated by the Commission.
Very truly yours,
/s/ STAFFORD ROSENBAUM LLP