Exhibit 23.1
CONSENT OF INDEPENDENT REGISTERED PUBLIC ACCOUNTING FIRM
We consent to the incorporation by reference in the following Registration Statements:
of our reports dated November 14, 2024, with respect to the consolidated financial statements and schedule of UniFirst Corporation and subsidiaries, and the effectiveness of internal control over financial reporting of UniFirst Corporation and subsidiaries, included in this Annual Report (Form 10-K) of UniFirst Corporation for the year ended August 31, 2024.
/s/ Ernst & Young LLP
Boston, Massachusetts
November 14, 2024