EXHIBIT 23.1

Consent of Independent Registered Public Accounting Firm

We consent to the incorporation by reference in the Registration Statement of United Fire Group, Inc. on Form S-8 (No. 333-107041) of our report dated June 10, 2026, with respect to the financial statements and supplemental schedule of the United Fire Group, Inc included in this Annual Report on Form 11-K as of December 31, 2025 and 2024 and for the year ended December 31, 2025.

/s/FORVIS MAZARS, LLP
West Des Moines, Iowa
June 10, 2026