EXHIBIT 23.1

CONSENT OF INDEPENDENT REGISTERED PUBLIC ACCOUNTING FIRM

We hereby consent to the incorporation by reference in the Registration Statements on Form S-3 (No. 333-271733) and Form S-8 (No. 333-251518) of MGE Energy, Inc. of our report dated February 24, 2026 relating to the financial statements, financial statement schedules and the effectiveness of internal control over financial reporting, which appears in this Form 10-K.

/s/ PricewaterhouseCoopers LLP

Chicago, Illinois

February 24, 2026

1