EX-23.1 5 hsy_20231231exhibit231.htm CONSENT OF ERNST & YOUNG LLP Document

EXHIBIT 23.1
CONSENT OF INDEPENDENT REGISTERED PUBLIC ACCOUNTING FIRM
We consent to the incorporation by reference in the following Registration Statements:

(1) Registration Statement (Form S-3 No. 333-256595) pertaining to the prospectus for the sale of Debt Securities of The Hershey Company,

(2) Registration Statement (Form S-8 No. 333-174123) pertaining to the Equity and Incentive Compensation Plan of The Hershey Company,

(3) Registration Statement (Form S-8 No. 333-143764) pertaining to the Equity and Incentive Compensation Plan of The Hershey Company,

(4) Registration Statement (Form S-8 No. 333-107706) pertaining to the Directors’ Compensation Plan of Hershey Foods Corporation,

(5) Registration Statement (Form S-8 No. 333-72100) pertaining to the 2001 Nonqualified Stock Option Agreement of Hershey Foods Corporation,

(6) Registration Statement (Form S-8 No. 333-72112) pertaining to the Broad-Based Stock Option Plan of Hershey Foods Corporation,

(7) Registration Statement (Form S-8 No. 333-52509) pertaining to the Key Employee Incentive Plan of Hershey Foods Corporation, and

(8) Registration Statement (Form S-8 No. 333-25853) pertaining to the Directors’ Compensation Plan of Hershey Foods Corporation;

of our reports dated February 20, 2024, with respect to the consolidated financial statements and schedule of The Hershey Company and the effectiveness of internal control over financial reporting of The Hershey Company included in this Annual Report on Form 10-K of The Hershey Company for the year ended December 31, 2023.

/s/ Ernst & Young LLP
Philadelphia, Pennsylvania
February 20, 2024