<?xml version="1.0" encoding="UTF-8"?>

<!--XBRL Document Created with the Workiva Platform-->
<!--Copyright 2026 Workiva-->
<!--r:019fdcb7-c7a4-7a5f-9a46-51ca6c023f86,g:9b7cf642-c294-4dd9-b23e-5a7c81e0e69e-->
<link:linkbase xmlns:link="http://www.xbrl.org/2003/linkbase" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xbrldt="http://xbrl.org/2005/xbrldt" xsi:schemaLocation="http://www.xbrl.org/2003/linkbase http://www.xbrl.org/2003/xbrl-linkbase-2003-12-31.xsd">
  <link:arcroleRef arcroleURI="http://xbrl.org/int/dim/arcrole/all" xlink:type="simple" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#all"/>
  <link:arcroleRef arcroleURI="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:type="simple" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#hypercube-dimension"/>
  <link:arcroleRef arcroleURI="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:type="simple" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#dimension-default"/>
  <link:arcroleRef arcroleURI="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:type="simple" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#dimension-domain"/>
  <link:arcroleRef arcroleURI="http://xbrl.org/int/dim/arcrole/domain-member" xlink:type="simple" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#domain-member"/>
  <link:roleRef roleURI="http://www.hersheys.com/role/DOCUMENTANDENTITYINFORMATION" xlink:type="simple" xlink:href="hsy-20260927.xsd#DOCUMENTANDENTITYINFORMATION"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/DOCUMENTANDENTITYINFORMATION" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityInformationLineItems_019fdcb7-c9c3-75bf-b6cf-3e094b67da8f" xlink:href="https://xbrl.sec.gov/dei/2026/dei-2026.xsd#dei_EntityInformationLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntitiesTable_019fdcb7-c9c3-7cd7-837e-6ee35225a493" xlink:href="https://xbrl.sec.gov/dei/2026/dei-2026.xsd#dei_EntitiesTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_dei_EntityInformationLineItems_019fdcb7-c9c3-75bf-b6cf-3e094b67da8f" xlink:to="loc_dei_EntitiesTable_019fdcb7-c9c3-7cd7-837e-6ee35225a493" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementClassOfStockAxis_019fdcb7-c9c3-7b89-82d5-f10efe8862cf" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_StatementClassOfStockAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_dei_EntitiesTable_019fdcb7-c9c3-7cd7-837e-6ee35225a493" xlink:to="loc_us-gaap_StatementClassOfStockAxis_019fdcb7-c9c3-7b89-82d5-f10efe8862cf" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_019fdcb7-c9c3-7b89-82d5-f10efe8862cf_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementClassOfStockAxis_019fdcb7-c9c3-7b89-82d5-f10efe8862cf" xlink:to="loc_us-gaap_ClassOfStockDomain_019fdcb7-c9c3-7b89-82d5-f10efe8862cf_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_019fdcb7-c9c3-7e80-a84d-37c5ef7c0a8a" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementClassOfStockAxis_019fdcb7-c9c3-7b89-82d5-f10efe8862cf" xlink:to="loc_us-gaap_ClassOfStockDomain_019fdcb7-c9c3-7e80-a84d-37c5ef7c0a8a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockMember_019fdcb7-c9c3-76e3-b5bc-5a199474ebff" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CommonStockMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_019fdcb7-c9c3-7e80-a84d-37c5ef7c0a8a" xlink:to="loc_us-gaap_CommonStockMember_019fdcb7-c9c3-76e3-b5bc-5a199474ebff" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonClassBMember_019fdcb7-c9c3-7b9f-a18b-6014ae9ef9c6" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CommonClassBMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_019fdcb7-c9c3-7e80-a84d-37c5ef7c0a8a" xlink:to="loc_us-gaap_CommonClassBMember_019fdcb7-c9c3-7b9f-a18b-6014ae9ef9c6" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_DocumentType_019fdcb7-c9c3-74ef-ae46-81cfb0d37c6b" xlink:href="https://xbrl.sec.gov/dei/2026/dei-2026.xsd#dei_DocumentType"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_019fdcb7-c9c3-75bf-b6cf-3e094b67da8f" xlink:to="loc_dei_DocumentType_019fdcb7-c9c3-74ef-ae46-81cfb0d37c6b" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_DocumentQuarterlyReport_019fdcb7-c9c3-7a4b-8734-7de823904dee" xlink:href="https://xbrl.sec.gov/dei/2026/dei-2026.xsd#dei_DocumentQuarterlyReport"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_019fdcb7-c9c3-75bf-b6cf-3e094b67da8f" xlink:to="loc_dei_DocumentQuarterlyReport_019fdcb7-c9c3-7a4b-8734-7de823904dee" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_DocumentPeriodEndDate_019fdcb7-c9c3-7d2a-bbb7-0439cddf67b5" xlink:href="https://xbrl.sec.gov/dei/2026/dei-2026.xsd#dei_DocumentPeriodEndDate"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_019fdcb7-c9c3-75bf-b6cf-3e094b67da8f" xlink:to="loc_dei_DocumentPeriodEndDate_019fdcb7-c9c3-7d2a-bbb7-0439cddf67b5" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_DocumentTransitionReport_019fdcb7-c9c3-7b20-b492-e658d291cb05" xlink:href="https://xbrl.sec.gov/dei/2026/dei-2026.xsd#dei_DocumentTransitionReport"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_019fdcb7-c9c3-75bf-b6cf-3e094b67da8f" xlink:to="loc_dei_DocumentTransitionReport_019fdcb7-c9c3-7b20-b492-e658d291cb05" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityFileNumber_019fdcb7-c9c3-79b5-a204-f14e9fc65513" xlink:href="https://xbrl.sec.gov/dei/2026/dei-2026.xsd#dei_EntityFileNumber"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_019fdcb7-c9c3-75bf-b6cf-3e094b67da8f" xlink:to="loc_dei_EntityFileNumber_019fdcb7-c9c3-79b5-a204-f14e9fc65513" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityRegistrantName_019fdcb7-c9c3-782e-a405-f499cef02e9f" xlink:href="https://xbrl.sec.gov/dei/2026/dei-2026.xsd#dei_EntityRegistrantName"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_019fdcb7-c9c3-75bf-b6cf-3e094b67da8f" xlink:to="loc_dei_EntityRegistrantName_019fdcb7-c9c3-782e-a405-f499cef02e9f" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityIncorporationStateCountryCode_019fdcb7-c9c3-7d31-ba38-70a1c853d79e" xlink:href="https://xbrl.sec.gov/dei/2026/dei-2026.xsd#dei_EntityIncorporationStateCountryCode"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_019fdcb7-c9c3-75bf-b6cf-3e094b67da8f" xlink:to="loc_dei_EntityIncorporationStateCountryCode_019fdcb7-c9c3-7d31-ba38-70a1c853d79e" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityTaxIdentificationNumber_019fdcb7-c9c3-7811-845d-f4d87617f40a" xlink:href="https://xbrl.sec.gov/dei/2026/dei-2026.xsd#dei_EntityTaxIdentificationNumber"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_019fdcb7-c9c3-75bf-b6cf-3e094b67da8f" xlink:to="loc_dei_EntityTaxIdentificationNumber_019fdcb7-c9c3-7811-845d-f4d87617f40a" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityAddressAddressLine1_019fdcb7-c9c3-76d8-9c6d-5f6b3054e464" xlink:href="https://xbrl.sec.gov/dei/2026/dei-2026.xsd#dei_EntityAddressAddressLine1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_019fdcb7-c9c3-75bf-b6cf-3e094b67da8f" xlink:to="loc_dei_EntityAddressAddressLine1_019fdcb7-c9c3-76d8-9c6d-5f6b3054e464" xlink:type="arc" order="8"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityAddressCityOrTown_019fdcb7-c9c3-710c-b66d-77e20a75dc7c" xlink:href="https://xbrl.sec.gov/dei/2026/dei-2026.xsd#dei_EntityAddressCityOrTown"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_019fdcb7-c9c3-75bf-b6cf-3e094b67da8f" xlink:to="loc_dei_EntityAddressCityOrTown_019fdcb7-c9c3-710c-b66d-77e20a75dc7c" xlink:type="arc" order="9"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityAddressStateOrProvince_019fdcb7-c9c3-7e1e-a0a2-dc09b5581c07" xlink:href="https://xbrl.sec.gov/dei/2026/dei-2026.xsd#dei_EntityAddressStateOrProvince"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_019fdcb7-c9c3-75bf-b6cf-3e094b67da8f" xlink:to="loc_dei_EntityAddressStateOrProvince_019fdcb7-c9c3-7e1e-a0a2-dc09b5581c07" xlink:type="arc" order="10"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityAddressPostalZipCode_019fdcb7-c9c3-7790-8314-f2c7a1c74b09" xlink:href="https://xbrl.sec.gov/dei/2026/dei-2026.xsd#dei_EntityAddressPostalZipCode"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_019fdcb7-c9c3-75bf-b6cf-3e094b67da8f" xlink:to="loc_dei_EntityAddressPostalZipCode_019fdcb7-c9c3-7790-8314-f2c7a1c74b09" xlink:type="arc" order="11"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_CityAreaCode_019fdcb7-c9c3-79d8-9d2d-16830660c460" xlink:href="https://xbrl.sec.gov/dei/2026/dei-2026.xsd#dei_CityAreaCode"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_019fdcb7-c9c3-75bf-b6cf-3e094b67da8f" xlink:to="loc_dei_CityAreaCode_019fdcb7-c9c3-79d8-9d2d-16830660c460" xlink:type="arc" order="12"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_LocalPhoneNumber_019fdcb7-c9c3-704a-863f-8d401acbb4ae" xlink:href="https://xbrl.sec.gov/dei/2026/dei-2026.xsd#dei_LocalPhoneNumber"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_019fdcb7-c9c3-75bf-b6cf-3e094b67da8f" xlink:to="loc_dei_LocalPhoneNumber_019fdcb7-c9c3-704a-863f-8d401acbb4ae" xlink:type="arc" order="13"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_Security12bTitle_019fdcb7-c9c3-7f91-9e4f-5b65f4c7e3d5" xlink:href="https://xbrl.sec.gov/dei/2026/dei-2026.xsd#dei_Security12bTitle"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_019fdcb7-c9c3-75bf-b6cf-3e094b67da8f" xlink:to="loc_dei_Security12bTitle_019fdcb7-c9c3-7f91-9e4f-5b65f4c7e3d5" xlink:type="arc" order="14"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_TradingSymbol_019fdcb7-c9c3-7caa-97d8-1d0d98b58494" xlink:href="https://xbrl.sec.gov/dei/2026/dei-2026.xsd#dei_TradingSymbol"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_019fdcb7-c9c3-75bf-b6cf-3e094b67da8f" xlink:to="loc_dei_TradingSymbol_019fdcb7-c9c3-7caa-97d8-1d0d98b58494" xlink:type="arc" order="15"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_SecurityExchangeName_019fdcb7-c9c3-7974-bd39-41b6ac519f45" xlink:href="https://xbrl.sec.gov/dei/2026/dei-2026.xsd#dei_SecurityExchangeName"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_019fdcb7-c9c3-75bf-b6cf-3e094b67da8f" xlink:to="loc_dei_SecurityExchangeName_019fdcb7-c9c3-7974-bd39-41b6ac519f45" xlink:type="arc" order="16"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityCurrentReportingStatus_019fdcb7-c9c3-77e4-8886-08a45d58f9b1" xlink:href="https://xbrl.sec.gov/dei/2026/dei-2026.xsd#dei_EntityCurrentReportingStatus"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_019fdcb7-c9c3-75bf-b6cf-3e094b67da8f" xlink:to="loc_dei_EntityCurrentReportingStatus_019fdcb7-c9c3-77e4-8886-08a45d58f9b1" xlink:type="arc" order="17"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityInteractiveDataCurrent_019fdcb7-c9c3-7f82-b7d2-9b12194b4f3e" xlink:href="https://xbrl.sec.gov/dei/2026/dei-2026.xsd#dei_EntityInteractiveDataCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_019fdcb7-c9c3-75bf-b6cf-3e094b67da8f" xlink:to="loc_dei_EntityInteractiveDataCurrent_019fdcb7-c9c3-7f82-b7d2-9b12194b4f3e" xlink:type="arc" order="18"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityFilerCategory_019fdcb7-c9c3-7eb2-8976-70ab4118892f" xlink:href="https://xbrl.sec.gov/dei/2026/dei-2026.xsd#dei_EntityFilerCategory"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_019fdcb7-c9c3-75bf-b6cf-3e094b67da8f" xlink:to="loc_dei_EntityFilerCategory_019fdcb7-c9c3-7eb2-8976-70ab4118892f" xlink:type="arc" order="19"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntitySmallBusiness_019fdcb7-c9c3-7297-a022-344c9744b26c" xlink:href="https://xbrl.sec.gov/dei/2026/dei-2026.xsd#dei_EntitySmallBusiness"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_019fdcb7-c9c3-75bf-b6cf-3e094b67da8f" xlink:to="loc_dei_EntitySmallBusiness_019fdcb7-c9c3-7297-a022-344c9744b26c" xlink:type="arc" order="20"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityEmergingGrowthCompany_019fdcb7-c9c3-7e04-80b2-5a6ceba9b852" xlink:href="https://xbrl.sec.gov/dei/2026/dei-2026.xsd#dei_EntityEmergingGrowthCompany"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_019fdcb7-c9c3-75bf-b6cf-3e094b67da8f" xlink:to="loc_dei_EntityEmergingGrowthCompany_019fdcb7-c9c3-7e04-80b2-5a6ceba9b852" xlink:type="arc" order="21"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityShellCompany_019fdcb7-c9c3-7a9c-b785-f578a7a8de54" xlink:href="https://xbrl.sec.gov/dei/2026/dei-2026.xsd#dei_EntityShellCompany"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_019fdcb7-c9c3-75bf-b6cf-3e094b67da8f" xlink:to="loc_dei_EntityShellCompany_019fdcb7-c9c3-7a9c-b785-f578a7a8de54" xlink:type="arc" order="22"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityCommonStockSharesOutstanding_019fdcb7-c9c3-7e2a-9ca8-fbb5d354dde9" xlink:href="https://xbrl.sec.gov/dei/2026/dei-2026.xsd#dei_EntityCommonStockSharesOutstanding"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_019fdcb7-c9c3-75bf-b6cf-3e094b67da8f" xlink:to="loc_dei_EntityCommonStockSharesOutstanding_019fdcb7-c9c3-7e2a-9ca8-fbb5d354dde9" xlink:type="arc" order="23"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityCentralIndexKey_019fdcb7-c9c3-7378-9c3f-70ee62c6781a" xlink:href="https://xbrl.sec.gov/dei/2026/dei-2026.xsd#dei_EntityCentralIndexKey"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_019fdcb7-c9c3-75bf-b6cf-3e094b67da8f" xlink:to="loc_dei_EntityCentralIndexKey_019fdcb7-c9c3-7378-9c3f-70ee62c6781a" xlink:type="arc" order="24"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_DocumentFiscalYearFocus_019fdcb7-c9c3-7d4a-aab7-00646093c04c" xlink:href="https://xbrl.sec.gov/dei/2026/dei-2026.xsd#dei_DocumentFiscalYearFocus"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_019fdcb7-c9c3-75bf-b6cf-3e094b67da8f" xlink:to="loc_dei_DocumentFiscalYearFocus_019fdcb7-c9c3-7d4a-aab7-00646093c04c" xlink:type="arc" order="25"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_CurrentFiscalYearEndDate_019fdcb7-c9c3-798e-83ca-72c4bbc46328" xlink:href="https://xbrl.sec.gov/dei/2026/dei-2026.xsd#dei_CurrentFiscalYearEndDate"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_019fdcb7-c9c3-75bf-b6cf-3e094b67da8f" xlink:to="loc_dei_CurrentFiscalYearEndDate_019fdcb7-c9c3-798e-83ca-72c4bbc46328" xlink:type="arc" order="26"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_DocumentFiscalPeriodFocus_019fdcb7-c9c3-75d7-bd34-be0be15446ab" xlink:href="https://xbrl.sec.gov/dei/2026/dei-2026.xsd#dei_DocumentFiscalPeriodFocus"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_019fdcb7-c9c3-75bf-b6cf-3e094b67da8f" xlink:to="loc_dei_DocumentFiscalPeriodFocus_019fdcb7-c9c3-75d7-bd34-be0be15446ab" xlink:type="arc" order="27"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_AmendmentFlag_019fdcb7-c9c3-7d50-a5b2-02bfb78488b3" xlink:href="https://xbrl.sec.gov/dei/2026/dei-2026.xsd#dei_AmendmentFlag"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_019fdcb7-c9c3-75bf-b6cf-3e094b67da8f" xlink:to="loc_dei_AmendmentFlag_019fdcb7-c9c3-7d50-a5b2-02bfb78488b3" xlink:type="arc" order="28"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/CONSOLIDATEDSTATEMENTSOFINCOME" xlink:type="simple" xlink:href="hsy-20260927.xsd#CONSOLIDATEDSTATEMENTSOFINCOME"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/CONSOLIDATEDSTATEMENTSOFINCOME" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementLineItems_019fdcb7-c9c3-766d-8928-e2d6a3a34fa7" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_StatementLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementTable_019fdcb7-c9c3-7476-a57b-746a4873dc3d" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_StatementTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_StatementLineItems_019fdcb7-c9c3-766d-8928-e2d6a3a34fa7" xlink:to="loc_us-gaap_StatementTable_019fdcb7-c9c3-7476-a57b-746a4873dc3d" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementClassOfStockAxis_019fdcb7-c9c3-7a5c-86fc-63a19336f333" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_StatementClassOfStockAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_StatementTable_019fdcb7-c9c3-7476-a57b-746a4873dc3d" xlink:to="loc_us-gaap_StatementClassOfStockAxis_019fdcb7-c9c3-7a5c-86fc-63a19336f333" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_019fdcb7-c9c3-7a5c-86fc-63a19336f333_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementClassOfStockAxis_019fdcb7-c9c3-7a5c-86fc-63a19336f333" xlink:to="loc_us-gaap_ClassOfStockDomain_019fdcb7-c9c3-7a5c-86fc-63a19336f333_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_019fdcb7-c9c3-70ca-a765-5128e7df97aa" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementClassOfStockAxis_019fdcb7-c9c3-7a5c-86fc-63a19336f333" xlink:to="loc_us-gaap_ClassOfStockDomain_019fdcb7-c9c3-70ca-a765-5128e7df97aa" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockMember_019fdcb7-c9c3-7ce1-8156-8eb003d5085d" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CommonStockMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_019fdcb7-c9c3-70ca-a765-5128e7df97aa" xlink:to="loc_us-gaap_CommonStockMember_019fdcb7-c9c3-7ce1-8156-8eb003d5085d" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonClassBMember_019fdcb7-c9c3-7778-a1c0-758e1ed5b130" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CommonClassBMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_019fdcb7-c9c3-70ca-a765-5128e7df97aa" xlink:to="loc_us-gaap_CommonClassBMember_019fdcb7-c9c3-7778-a1c0-758e1ed5b130" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax_019fdcb7-c9c3-78cf-b00f-f1b44a57cf11" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_019fdcb7-c9c3-766d-8928-e2d6a3a34fa7" xlink:to="loc_us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax_019fdcb7-c9c3-78cf-b00f-f1b44a57cf11" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CostOfGoodsAndServicesSold_019fdcb7-c9c3-7ad6-a12f-a7b49bcb8800" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CostOfGoodsAndServicesSold"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_019fdcb7-c9c3-766d-8928-e2d6a3a34fa7" xlink:to="loc_us-gaap_CostOfGoodsAndServicesSold_019fdcb7-c9c3-7ad6-a12f-a7b49bcb8800" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GrossProfit_019fdcb7-c9c3-7cf6-b390-2bb0b113aafd" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_GrossProfit"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_019fdcb7-c9c3-766d-8928-e2d6a3a34fa7" xlink:to="loc_us-gaap_GrossProfit_019fdcb7-c9c3-7cf6-b390-2bb0b113aafd" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SellingGeneralAndAdministrativeExpense_019fdcb7-c9c3-774d-9e41-9a7fa5e15efc" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_SellingGeneralAndAdministrativeExpense"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_019fdcb7-c9c3-766d-8928-e2d6a3a34fa7" xlink:to="loc_us-gaap_SellingGeneralAndAdministrativeExpense_019fdcb7-c9c3-774d-9e41-9a7fa5e15efc" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_RestructuringChargesBusinessRealignment_019fdcb7-c9c3-7fad-be6f-cd071450e1fe" xlink:href="hsy-20260927.xsd#hsy_RestructuringChargesBusinessRealignment"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_019fdcb7-c9c3-766d-8928-e2d6a3a34fa7" xlink:to="loc_hsy_RestructuringChargesBusinessRealignment_019fdcb7-c9c3-7fad-be6f-cd071450e1fe" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingIncomeLoss_019fdcb7-c9c3-7226-b0cd-53b1de347d45" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OperatingIncomeLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_019fdcb7-c9c3-766d-8928-e2d6a3a34fa7" xlink:to="loc_us-gaap_OperatingIncomeLoss_019fdcb7-c9c3-7226-b0cd-53b1de347d45" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InterestIncomeExpenseNonoperatingNet_019fdcb7-c9c3-76e8-ae81-a9c7d62fc3e8" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_InterestIncomeExpenseNonoperatingNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_019fdcb7-c9c3-766d-8928-e2d6a3a34fa7" xlink:to="loc_us-gaap_InterestIncomeExpenseNonoperatingNet_019fdcb7-c9c3-76e8-ae81-a9c7d62fc3e8" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherNonoperatingIncomeExpense_019fdcb7-c9c3-744e-a946-eea414977104" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OtherNonoperatingIncomeExpense"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_019fdcb7-c9c3-766d-8928-e2d6a3a34fa7" xlink:to="loc_us-gaap_OtherNonoperatingIncomeExpense_019fdcb7-c9c3-744e-a946-eea414977104" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_019fdcb7-c9c3-7bd0-b911-e9f105e039ff" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_019fdcb7-c9c3-766d-8928-e2d6a3a34fa7" xlink:to="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_019fdcb7-c9c3-7bd0-b911-e9f105e039ff" xlink:type="arc" order="8"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeTaxExpenseBenefit_019fdcb7-c9c3-7906-b59d-75fede1b88ff" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_IncomeTaxExpenseBenefit"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_019fdcb7-c9c3-766d-8928-e2d6a3a34fa7" xlink:to="loc_us-gaap_IncomeTaxExpenseBenefit_019fdcb7-c9c3-7906-b59d-75fede1b88ff" xlink:type="arc" order="9"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetIncomeLoss_019fdcb7-c9c3-78b4-a7be-f9b2e99d458a" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_NetIncomeLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_019fdcb7-c9c3-766d-8928-e2d6a3a34fa7" xlink:to="loc_us-gaap_NetIncomeLoss_019fdcb7-c9c3-78b4-a7be-f9b2e99d458a" xlink:type="arc" order="10"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EarningsPerShareBasicAbstract_019fdcb7-c9c3-7035-b709-6b009a766932" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_EarningsPerShareBasicAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_019fdcb7-c9c3-766d-8928-e2d6a3a34fa7" xlink:to="loc_us-gaap_EarningsPerShareBasicAbstract_019fdcb7-c9c3-7035-b709-6b009a766932" xlink:type="arc" order="11"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EarningsPerShareBasic_019fdcb7-c9c3-7ce5-b43f-f7604ab7115d" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_EarningsPerShareBasic"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareBasicAbstract_019fdcb7-c9c3-7035-b709-6b009a766932" xlink:to="loc_us-gaap_EarningsPerShareBasic_019fdcb7-c9c3-7ce5-b43f-f7604ab7115d" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EarningsPerShareDilutedAbstract_019fdcb7-c9c3-7787-ac30-6bab50603cfe" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_EarningsPerShareDilutedAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_019fdcb7-c9c3-766d-8928-e2d6a3a34fa7" xlink:to="loc_us-gaap_EarningsPerShareDilutedAbstract_019fdcb7-c9c3-7787-ac30-6bab50603cfe" xlink:type="arc" order="12"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EarningsPerShareDiluted_019fdcb7-c9c3-7158-a2eb-2960b1ccee47" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_EarningsPerShareDiluted"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareDilutedAbstract_019fdcb7-c9c3-7787-ac30-6bab50603cfe" xlink:to="loc_us-gaap_EarningsPerShareDiluted_019fdcb7-c9c3-7158-a2eb-2960b1ccee47" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/CONSOLIDATEDBALANCESHEETS" xlink:type="simple" xlink:href="hsy-20260927.xsd#CONSOLIDATEDBALANCESHEETS"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/CONSOLIDATEDBALANCESHEETS" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementLineItems_019fdcb7-c9c3-7a16-ac3c-61c069b3480d" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_StatementLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementTable_019fdcb7-c9c3-7313-aae5-4142f65cbcd5" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_StatementTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_StatementLineItems_019fdcb7-c9c3-7a16-ac3c-61c069b3480d" xlink:to="loc_us-gaap_StatementTable_019fdcb7-c9c3-7313-aae5-4142f65cbcd5" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementClassOfStockAxis_019fdcb7-c9c3-7551-9073-ad0eae3460b5" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_StatementClassOfStockAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_StatementTable_019fdcb7-c9c3-7313-aae5-4142f65cbcd5" xlink:to="loc_us-gaap_StatementClassOfStockAxis_019fdcb7-c9c3-7551-9073-ad0eae3460b5" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_019fdcb7-c9c3-7551-9073-ad0eae3460b5_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementClassOfStockAxis_019fdcb7-c9c3-7551-9073-ad0eae3460b5" xlink:to="loc_us-gaap_ClassOfStockDomain_019fdcb7-c9c3-7551-9073-ad0eae3460b5_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_019fdcb7-c9c3-7e2b-86ff-69c8b6215fc3" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementClassOfStockAxis_019fdcb7-c9c3-7551-9073-ad0eae3460b5" xlink:to="loc_us-gaap_ClassOfStockDomain_019fdcb7-c9c3-7e2b-86ff-69c8b6215fc3" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockMember_019fdcb7-c9c3-7932-bf29-4822a6a9702d" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CommonStockMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_019fdcb7-c9c3-7e2b-86ff-69c8b6215fc3" xlink:to="loc_us-gaap_CommonStockMember_019fdcb7-c9c3-7932-bf29-4822a6a9702d" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonClassBMember_019fdcb7-c9c3-727b-a5a5-38f75ed678e9" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CommonClassBMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_019fdcb7-c9c3-7e2b-86ff-69c8b6215fc3" xlink:to="loc_us-gaap_CommonClassBMember_019fdcb7-c9c3-727b-a5a5-38f75ed678e9" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AssetsAbstract_019fdcb7-c9c3-728e-af84-b4e16dd955ee" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AssetsAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_019fdcb7-c9c3-7a16-ac3c-61c069b3480d" xlink:to="loc_us-gaap_AssetsAbstract_019fdcb7-c9c3-728e-af84-b4e16dd955ee" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AssetsCurrentAbstract_019fdcb7-c9c3-76c0-9135-b50b35cb03cd" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AssetsCurrentAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsAbstract_019fdcb7-c9c3-728e-af84-b4e16dd955ee" xlink:to="loc_us-gaap_AssetsCurrentAbstract_019fdcb7-c9c3-76c0-9135-b50b35cb03cd" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_019fdcb7-c9c3-7614-9f48-0ba7d305e958" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsCurrentAbstract_019fdcb7-c9c3-76c0-9135-b50b35cb03cd" xlink:to="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_019fdcb7-c9c3-7614-9f48-0ba7d305e958" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccountsReceivableNetCurrent_019fdcb7-c9c3-7b61-ade6-191ad5553d79" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AccountsReceivableNetCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsCurrentAbstract_019fdcb7-c9c3-76c0-9135-b50b35cb03cd" xlink:to="loc_us-gaap_AccountsReceivableNetCurrent_019fdcb7-c9c3-7b61-ade6-191ad5553d79" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InventoryNet_019fdcb7-c9c3-799e-9889-eacebaca1aa9" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_InventoryNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsCurrentAbstract_019fdcb7-c9c3-76c0-9135-b50b35cb03cd" xlink:to="loc_us-gaap_InventoryNet_019fdcb7-c9c3-799e-9889-eacebaca1aa9" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PrepaidExpenseAndOtherAssetsCurrent_019fdcb7-c9c3-726e-bf06-1ac348f93b23" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_PrepaidExpenseAndOtherAssetsCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsCurrentAbstract_019fdcb7-c9c3-76c0-9135-b50b35cb03cd" xlink:to="loc_us-gaap_PrepaidExpenseAndOtherAssetsCurrent_019fdcb7-c9c3-726e-bf06-1ac348f93b23" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AssetsCurrent_019fdcb7-c9c3-75ea-8788-1ef14a537c80" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AssetsCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsCurrentAbstract_019fdcb7-c9c3-76c0-9135-b50b35cb03cd" xlink:to="loc_us-gaap_AssetsCurrent_019fdcb7-c9c3-75ea-8788-1ef14a537c80" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentNet_019fdcb7-c9c3-7a7c-8f05-eddf5c45df95" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_PropertyPlantAndEquipmentNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsAbstract_019fdcb7-c9c3-728e-af84-b4e16dd955ee" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentNet_019fdcb7-c9c3-7a7c-8f05-eddf5c45df95" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Goodwill_019fdcb7-c9c3-7b3d-80eb-9c499d48369a" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_Goodwill"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsAbstract_019fdcb7-c9c3-728e-af84-b4e16dd955ee" xlink:to="loc_us-gaap_Goodwill_019fdcb7-c9c3-7b3d-80eb-9c499d48369a" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IntangibleAssetsNetExcludingGoodwill_019fdcb7-c9c3-70f1-b2df-9cf97f04da89" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_IntangibleAssetsNetExcludingGoodwill"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsAbstract_019fdcb7-c9c3-728e-af84-b4e16dd955ee" xlink:to="loc_us-gaap_IntangibleAssetsNetExcludingGoodwill_019fdcb7-c9c3-70f1-b2df-9cf97f04da89" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherAssetsNoncurrent_019fdcb7-c9c3-7347-af53-c943079fe79c" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OtherAssetsNoncurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsAbstract_019fdcb7-c9c3-728e-af84-b4e16dd955ee" xlink:to="loc_us-gaap_OtherAssetsNoncurrent_019fdcb7-c9c3-7347-af53-c943079fe79c" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredIncomeTaxAssetsNet_019fdcb7-c9c3-7409-a75f-75bd27216df7" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DeferredIncomeTaxAssetsNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsAbstract_019fdcb7-c9c3-728e-af84-b4e16dd955ee" xlink:to="loc_us-gaap_DeferredIncomeTaxAssetsNet_019fdcb7-c9c3-7409-a75f-75bd27216df7" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Assets_019fdcb7-c9c3-779a-afe5-e74080dc1523" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_Assets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsAbstract_019fdcb7-c9c3-728e-af84-b4e16dd955ee" xlink:to="loc_us-gaap_Assets_019fdcb7-c9c3-779a-afe5-e74080dc1523" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesAndStockholdersEquityAbstract_019fdcb7-c9c3-7a99-8b65-02fa3ba2204d" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_LiabilitiesAndStockholdersEquityAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_019fdcb7-c9c3-7a16-ac3c-61c069b3480d" xlink:to="loc_us-gaap_LiabilitiesAndStockholdersEquityAbstract_019fdcb7-c9c3-7a99-8b65-02fa3ba2204d" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesCurrentAbstract_019fdcb7-c9c3-7cd5-ac68-4f5d2dc14815" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_LiabilitiesCurrentAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquityAbstract_019fdcb7-c9c3-7a99-8b65-02fa3ba2204d" xlink:to="loc_us-gaap_LiabilitiesCurrentAbstract_019fdcb7-c9c3-7cd5-ac68-4f5d2dc14815" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccountsPayableCurrent_019fdcb7-c9c3-7cff-b8d8-c85feb81007a" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AccountsPayableCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesCurrentAbstract_019fdcb7-c9c3-7cd5-ac68-4f5d2dc14815" xlink:to="loc_us-gaap_AccountsPayableCurrent_019fdcb7-c9c3-7cff-b8d8-c85feb81007a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccruedLiabilitiesCurrent_019fdcb7-c9c3-7a01-b4b3-5a52ae638a98" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AccruedLiabilitiesCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesCurrentAbstract_019fdcb7-c9c3-7cd5-ac68-4f5d2dc14815" xlink:to="loc_us-gaap_AccruedLiabilitiesCurrent_019fdcb7-c9c3-7a01-b4b3-5a52ae638a98" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccruedIncomeTaxesCurrent_019fdcb7-c9c3-7792-b4a0-46c9a485c678" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AccruedIncomeTaxesCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesCurrentAbstract_019fdcb7-c9c3-7cd5-ac68-4f5d2dc14815" xlink:to="loc_us-gaap_AccruedIncomeTaxesCurrent_019fdcb7-c9c3-7792-b4a0-46c9a485c678" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShortTermBorrowings_019fdcb7-c9c3-7438-a607-8dfefe812fd7" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ShortTermBorrowings"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesCurrentAbstract_019fdcb7-c9c3-7cd5-ac68-4f5d2dc14815" xlink:to="loc_us-gaap_ShortTermBorrowings_019fdcb7-c9c3-7438-a607-8dfefe812fd7" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongTermDebtCurrent_019fdcb7-c9c3-74e7-90a9-430d3a12124e" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_LongTermDebtCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesCurrentAbstract_019fdcb7-c9c3-7cd5-ac68-4f5d2dc14815" xlink:to="loc_us-gaap_LongTermDebtCurrent_019fdcb7-c9c3-74e7-90a9-430d3a12124e" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesCurrent_019fdcb7-c9c3-7e6d-aefe-82ee4469ec91" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_LiabilitiesCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesCurrentAbstract_019fdcb7-c9c3-7cd5-ac68-4f5d2dc14815" xlink:to="loc_us-gaap_LiabilitiesCurrent_019fdcb7-c9c3-7e6d-aefe-82ee4469ec91" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongTermDebtAndCapitalLeaseObligations_019fdcb7-c9c3-7f82-9258-df2448b82e59" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_LongTermDebtAndCapitalLeaseObligations"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquityAbstract_019fdcb7-c9c3-7a99-8b65-02fa3ba2204d" xlink:to="loc_us-gaap_LongTermDebtAndCapitalLeaseObligations_019fdcb7-c9c3-7f82-9258-df2448b82e59" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherLiabilitiesNoncurrent_019fdcb7-c9c3-7cb6-ad7c-f7ce2ee7962e" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OtherLiabilitiesNoncurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquityAbstract_019fdcb7-c9c3-7a99-8b65-02fa3ba2204d" xlink:to="loc_us-gaap_OtherLiabilitiesNoncurrent_019fdcb7-c9c3-7cb6-ad7c-f7ce2ee7962e" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredIncomeTaxLiabilitiesNet_019fdcb7-c9c3-7276-ad91-006c5d8182ff" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DeferredIncomeTaxLiabilitiesNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquityAbstract_019fdcb7-c9c3-7a99-8b65-02fa3ba2204d" xlink:to="loc_us-gaap_DeferredIncomeTaxLiabilitiesNet_019fdcb7-c9c3-7276-ad91-006c5d8182ff" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Liabilities_019fdcb7-c9c3-7739-a8ca-61a54617ed75" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_Liabilities"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquityAbstract_019fdcb7-c9c3-7a99-8b65-02fa3ba2204d" xlink:to="loc_us-gaap_Liabilities_019fdcb7-c9c3-7739-a8ca-61a54617ed75" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterestAbstract_019fdcb7-c9c3-7dd4-a72a-d4d2df1a8557" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterestAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquityAbstract_019fdcb7-c9c3-7a99-8b65-02fa3ba2204d" xlink:to="loc_us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterestAbstract_019fdcb7-c9c3-7dd4-a72a-d4d2df1a8557" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PreferredStockValue_019fdcb7-c9c3-78ad-993a-36a61e1c3790" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_PreferredStockValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterestAbstract_019fdcb7-c9c3-7dd4-a72a-d4d2df1a8557" xlink:to="loc_us-gaap_PreferredStockValue_019fdcb7-c9c3-78ad-993a-36a61e1c3790" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockValue_019fdcb7-c9c3-7b30-a60e-98368532377d" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CommonStockValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterestAbstract_019fdcb7-c9c3-7dd4-a72a-d4d2df1a8557" xlink:to="loc_us-gaap_CommonStockValue_019fdcb7-c9c3-7b30-a60e-98368532377d" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AdditionalPaidInCapital_019fdcb7-c9c3-791e-85a3-dccc41527c14" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AdditionalPaidInCapital"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterestAbstract_019fdcb7-c9c3-7dd4-a72a-d4d2df1a8557" xlink:to="loc_us-gaap_AdditionalPaidInCapital_019fdcb7-c9c3-791e-85a3-dccc41527c14" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetainedEarningsAccumulatedDeficit_019fdcb7-c9c3-7119-995c-5db38a50c9a0" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RetainedEarningsAccumulatedDeficit"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterestAbstract_019fdcb7-c9c3-7dd4-a72a-d4d2df1a8557" xlink:to="loc_us-gaap_RetainedEarningsAccumulatedDeficit_019fdcb7-c9c3-7119-995c-5db38a50c9a0" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TreasuryStockCommonValue_019fdcb7-c9c3-7ec8-ab39-1858722c82fe" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_TreasuryStockCommonValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterestAbstract_019fdcb7-c9c3-7dd4-a72a-d4d2df1a8557" xlink:to="loc_us-gaap_TreasuryStockCommonValue_019fdcb7-c9c3-7ec8-ab39-1858722c82fe" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax_019fdcb7-c9c3-73b7-ad88-728235a334e7" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterestAbstract_019fdcb7-c9c3-7dd4-a72a-d4d2df1a8557" xlink:to="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax_019fdcb7-c9c3-73b7-ad88-728235a334e7" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterest_019fdcb7-c9c3-712f-a711-7714b98482c8" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterest"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterestAbstract_019fdcb7-c9c3-7dd4-a72a-d4d2df1a8557" xlink:to="loc_us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterest_019fdcb7-c9c3-712f-a711-7714b98482c8" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesAndStockholdersEquity_019fdcb7-c9c3-7370-ac33-c9f470f8fafb" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_LiabilitiesAndStockholdersEquity"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquityAbstract_019fdcb7-c9c3-7a99-8b65-02fa3ba2204d" xlink:to="loc_us-gaap_LiabilitiesAndStockholdersEquity_019fdcb7-c9c3-7370-ac33-c9f470f8fafb" xlink:type="arc" order="7"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/CONSOLIDATEDBALANCESHEETSParenthetical" xlink:type="simple" xlink:href="hsy-20260927.xsd#CONSOLIDATEDBALANCESHEETSParenthetical"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/CONSOLIDATEDBALANCESHEETSParenthetical" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementLineItems_019fdcb7-c9c3-7544-9473-eeb9293857f8" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_StatementLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementTable_019fdcb7-c9c3-78d1-8430-945fcf2a5a4a" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_StatementTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_StatementLineItems_019fdcb7-c9c3-7544-9473-eeb9293857f8" xlink:to="loc_us-gaap_StatementTable_019fdcb7-c9c3-78d1-8430-945fcf2a5a4a" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementClassOfStockAxis_019fdcb7-c9c3-7df2-ae9d-664406ca006f" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_StatementClassOfStockAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_StatementTable_019fdcb7-c9c3-78d1-8430-945fcf2a5a4a" xlink:to="loc_us-gaap_StatementClassOfStockAxis_019fdcb7-c9c3-7df2-ae9d-664406ca006f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_019fdcb7-c9c3-7df2-ae9d-664406ca006f_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementClassOfStockAxis_019fdcb7-c9c3-7df2-ae9d-664406ca006f" xlink:to="loc_us-gaap_ClassOfStockDomain_019fdcb7-c9c3-7df2-ae9d-664406ca006f_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_019fdcb7-c9c3-7727-8de8-95e65c752681" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementClassOfStockAxis_019fdcb7-c9c3-7df2-ae9d-664406ca006f" xlink:to="loc_us-gaap_ClassOfStockDomain_019fdcb7-c9c3-7727-8de8-95e65c752681" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockMember_019fdcb7-c9c3-7d30-90e5-bf7f56bc2365" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CommonStockMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_019fdcb7-c9c3-7727-8de8-95e65c752681" xlink:to="loc_us-gaap_CommonStockMember_019fdcb7-c9c3-7d30-90e5-bf7f56bc2365" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonClassBMember_019fdcb7-c9c3-7e2f-b4a2-a75fedfa6bb7" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CommonClassBMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_019fdcb7-c9c3-7727-8de8-95e65c752681" xlink:to="loc_us-gaap_CommonClassBMember_019fdcb7-c9c3-7e2f-b4a2-a75fedfa6bb7" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PreferredStockSharesIssued_019fdcb7-c9c3-70b3-8306-76fff85037eb" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_PreferredStockSharesIssued"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_019fdcb7-c9c3-7544-9473-eeb9293857f8" xlink:to="loc_us-gaap_PreferredStockSharesIssued_019fdcb7-c9c3-70b3-8306-76fff85037eb" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockSharesIssued_019fdcb7-c9c3-7a36-bd69-4dff215da1a1" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CommonStockSharesIssued"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_019fdcb7-c9c3-7544-9473-eeb9293857f8" xlink:to="loc_us-gaap_CommonStockSharesIssued_019fdcb7-c9c3-7a36-bd69-4dff215da1a1" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TreasuryStockCommonShares_019fdcb7-c9c3-7cbc-bfe1-171012a81bb9" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_TreasuryStockCommonShares"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_019fdcb7-c9c3-7544-9473-eeb9293857f8" xlink:to="loc_us-gaap_TreasuryStockCommonShares_019fdcb7-c9c3-7cbc-bfe1-171012a81bb9" xlink:type="arc" order="2"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/CONSOLIDATEDSTATEMENTSOFSTOCKHOLDERSEQUITY" xlink:type="simple" xlink:href="hsy-20260927.xsd#CONSOLIDATEDSTATEMENTSOFSTOCKHOLDERSEQUITY"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/CONSOLIDATEDSTATEMENTSOFSTOCKHOLDERSEQUITY" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementLineItems_019fdcb7-c9c3-7c6f-980f-2ab5b7742d2a" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_StatementLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementTable_019fdcb7-c9c3-76d6-9b07-a753633e5bbb" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_StatementTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_StatementLineItems_019fdcb7-c9c3-7c6f-980f-2ab5b7742d2a" xlink:to="loc_us-gaap_StatementTable_019fdcb7-c9c3-76d6-9b07-a753633e5bbb" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementEquityComponentsAxis_019fdcb7-c9c3-7d21-92ec-2e8f696b3acd" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_StatementEquityComponentsAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_StatementTable_019fdcb7-c9c3-76d6-9b07-a753633e5bbb" xlink:to="loc_us-gaap_StatementEquityComponentsAxis_019fdcb7-c9c3-7d21-92ec-2e8f696b3acd" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquityComponentDomain_019fdcb7-c9c3-7d21-92ec-2e8f696b3acd_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_EquityComponentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementEquityComponentsAxis_019fdcb7-c9c3-7d21-92ec-2e8f696b3acd" xlink:to="loc_us-gaap_EquityComponentDomain_019fdcb7-c9c3-7d21-92ec-2e8f696b3acd_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquityComponentDomain_019fdcb7-c9c3-7fa1-b6d1-700d97c8a53d" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_EquityComponentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementEquityComponentsAxis_019fdcb7-c9c3-7d21-92ec-2e8f696b3acd" xlink:to="loc_us-gaap_EquityComponentDomain_019fdcb7-c9c3-7fa1-b6d1-700d97c8a53d" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PreferredStockMember_019fdcb7-c9c3-7180-8b8a-fc3b0eb398f9" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_PreferredStockMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_019fdcb7-c9c3-7fa1-b6d1-700d97c8a53d" xlink:to="loc_us-gaap_PreferredStockMember_019fdcb7-c9c3-7180-8b8a-fc3b0eb398f9" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockMember_019fdcb7-c9c3-7f84-983e-8e5c8d45ff41" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CommonStockMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_019fdcb7-c9c3-7fa1-b6d1-700d97c8a53d" xlink:to="loc_us-gaap_CommonStockMember_019fdcb7-c9c3-7f84-983e-8e5c8d45ff41" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AdditionalPaidInCapitalMember_019fdcb7-c9c3-7dd8-a6e6-95dc780501e4" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AdditionalPaidInCapitalMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_019fdcb7-c9c3-7fa1-b6d1-700d97c8a53d" xlink:to="loc_us-gaap_AdditionalPaidInCapitalMember_019fdcb7-c9c3-7dd8-a6e6-95dc780501e4" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetainedEarningsMember_019fdcb7-c9c3-7dd7-959b-c2025ff723a9" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RetainedEarningsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_019fdcb7-c9c3-7fa1-b6d1-700d97c8a53d" xlink:to="loc_us-gaap_RetainedEarningsMember_019fdcb7-c9c3-7dd7-959b-c2025ff723a9" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TreasuryStockCommonMember_019fdcb7-c9c3-7399-b380-8e76ca58d9d5" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_TreasuryStockCommonMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_019fdcb7-c9c3-7fa1-b6d1-700d97c8a53d" xlink:to="loc_us-gaap_TreasuryStockCommonMember_019fdcb7-c9c3-7399-b380-8e76ca58d9d5" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccumulatedOtherComprehensiveIncomeMember_019fdcb7-c9c3-7566-b1a5-4e0fc4df0024" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AccumulatedOtherComprehensiveIncomeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_019fdcb7-c9c3-7fa1-b6d1-700d97c8a53d" xlink:to="loc_us-gaap_AccumulatedOtherComprehensiveIncomeMember_019fdcb7-c9c3-7566-b1a5-4e0fc4df0024" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementClassOfStockAxis_019fdcb7-c9c3-7404-a0d2-61b74b470c14" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_StatementClassOfStockAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_StatementTable_019fdcb7-c9c3-76d6-9b07-a753633e5bbb" xlink:to="loc_us-gaap_StatementClassOfStockAxis_019fdcb7-c9c3-7404-a0d2-61b74b470c14" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_019fdcb7-c9c3-7404-a0d2-61b74b470c14_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementClassOfStockAxis_019fdcb7-c9c3-7404-a0d2-61b74b470c14" xlink:to="loc_us-gaap_ClassOfStockDomain_019fdcb7-c9c3-7404-a0d2-61b74b470c14_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_019fdcb7-c9c3-7591-98bb-12e65e90a5f7" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementClassOfStockAxis_019fdcb7-c9c3-7404-a0d2-61b74b470c14" xlink:to="loc_us-gaap_ClassOfStockDomain_019fdcb7-c9c3-7591-98bb-12e65e90a5f7" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockMember_019fdcb7-c9c3-7d96-b2c8-7e2225e0daa4" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CommonStockMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_019fdcb7-c9c3-7591-98bb-12e65e90a5f7" xlink:to="loc_us-gaap_CommonStockMember_019fdcb7-c9c3-7d96-b2c8-7e2225e0daa4" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonClassBMember_019fdcb7-c9c3-7816-a981-c8f3ee7c979e" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CommonClassBMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_019fdcb7-c9c3-7591-98bb-12e65e90a5f7" xlink:to="loc_us-gaap_CommonClassBMember_019fdcb7-c9c3-7816-a981-c8f3ee7c979e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_019fdcb7-c9c3-7862-b3a4-874f6c6a5147" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_IncreaseDecreaseInStockholdersEquityRollForward"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_019fdcb7-c9c3-7c6f-980f-2ab5b7742d2a" xlink:to="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_019fdcb7-c9c3-7862-b3a4-874f6c6a5147" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterest_019fdcb7-c9c3-7313-a0e7-b62ba229fdd2" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterest"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_019fdcb7-c9c3-7862-b3a4-874f6c6a5147" xlink:to="loc_us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterest_019fdcb7-c9c3-7313-a0e7-b62ba229fdd2" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetIncomeLoss_019fdcb7-c9c3-711e-af31-1621f42f81c0" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_NetIncomeLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_019fdcb7-c9c3-7862-b3a4-874f6c6a5147" xlink:to="loc_us-gaap_NetIncomeLoss_019fdcb7-c9c3-711e-af31-1621f42f81c0" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTax_019fdcb7-c9c3-7a8c-81a6-51f7731d9265" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OtherComprehensiveIncomeLossNetOfTax"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_019fdcb7-c9c3-7862-b3a4-874f6c6a5147" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTax_019fdcb7-c9c3-7a8c-81a6-51f7731d9265" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DividendsCommonStockAbstract_019fdcb7-c9c3-735f-ab89-87232a8d9bb2" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DividendsCommonStockAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_019fdcb7-c9c3-7862-b3a4-874f6c6a5147" xlink:to="loc_us-gaap_DividendsCommonStockAbstract_019fdcb7-c9c3-735f-ab89-87232a8d9bb2" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DividendsCommonStockCash_019fdcb7-c9c3-7c61-91f7-c86e7b5d6eea" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DividendsCommonStockCash"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DividendsCommonStockAbstract_019fdcb7-c9c3-735f-ab89-87232a8d9bb2" xlink:to="loc_us-gaap_DividendsCommonStockCash_019fdcb7-c9c3-7c61-91f7-c86e7b5d6eea" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AdjustmentsToAdditionalPaidInCapitalSharebasedCompensationRequisiteServicePeriodRecognitionValue_019fdcb7-c9c3-71d6-b2a6-be7ecb7ddd8b" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AdjustmentsToAdditionalPaidInCapitalSharebasedCompensationRequisiteServicePeriodRecognitionValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_019fdcb7-c9c3-7862-b3a4-874f6c6a5147" xlink:to="loc_us-gaap_AdjustmentsToAdditionalPaidInCapitalSharebasedCompensationRequisiteServicePeriodRecognitionValue_019fdcb7-c9c3-71d6-b2a6-be7ecb7ddd8b" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_StockIssuedDuringPeriodValueStockOptionsExercisedAndIncentiveBasedTransactions_019fdcb7-c9c3-7d9c-a7ab-712c7ba31836" xlink:href="hsy-20260927.xsd#hsy_StockIssuedDuringPeriodValueStockOptionsExercisedAndIncentiveBasedTransactions"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_019fdcb7-c9c3-7862-b3a4-874f6c6a5147" xlink:to="loc_hsy_StockIssuedDuringPeriodValueStockOptionsExercisedAndIncentiveBasedTransactions_019fdcb7-c9c3-7d9c-a7ab-712c7ba31836" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_TreasuryStockValueAcquiredCostMethodIncludingExciseTax_019fdcb7-c9c3-7c8e-9ab3-dcdd0b9c3ceb" xlink:href="hsy-20260927.xsd#hsy_TreasuryStockValueAcquiredCostMethodIncludingExciseTax"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_019fdcb7-c9c3-7862-b3a4-874f6c6a5147" xlink:to="loc_hsy_TreasuryStockValueAcquiredCostMethodIncludingExciseTax_019fdcb7-c9c3-7c8e-9ab3-dcdd0b9c3ceb" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterest_019fdcb7-c9c3-767a-a021-eaca1af238b4" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterest"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/CONSOLIDATEDSTATEMENTSOFSTOCKHOLDERSEQUITYParenthetical" xlink:type="simple" xlink:href="hsy-20260927.xsd#CONSOLIDATEDSTATEMENTSOFSTOCKHOLDERSEQUITYParenthetical"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/CONSOLIDATEDSTATEMENTSOFSTOCKHOLDERSEQUITYParenthetical" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementLineItems_019fdcb7-c9c3-7a7c-b9d4-280d00a9a2a5" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_StatementLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementTable_019fdcb7-c9c3-7ff9-a1dc-dd1f4981bbcc" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_StatementTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_StatementLineItems_019fdcb7-c9c3-7a7c-b9d4-280d00a9a2a5" xlink:to="loc_us-gaap_StatementTable_019fdcb7-c9c3-7ff9-a1dc-dd1f4981bbcc" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementClassOfStockAxis_019fdcb7-c9c3-7140-a3f8-2c7378afcc83" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_StatementClassOfStockAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_StatementTable_019fdcb7-c9c3-7ff9-a1dc-dd1f4981bbcc" xlink:to="loc_us-gaap_StatementClassOfStockAxis_019fdcb7-c9c3-7140-a3f8-2c7378afcc83" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_019fdcb7-c9c3-7140-a3f8-2c7378afcc83_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementClassOfStockAxis_019fdcb7-c9c3-7140-a3f8-2c7378afcc83" xlink:to="loc_us-gaap_ClassOfStockDomain_019fdcb7-c9c3-7140-a3f8-2c7378afcc83_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_019fdcb7-c9c3-7ee6-a8ff-7b15291fd270" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementClassOfStockAxis_019fdcb7-c9c3-7140-a3f8-2c7378afcc83" xlink:to="loc_us-gaap_ClassOfStockDomain_019fdcb7-c9c3-7ee6-a8ff-7b15291fd270" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockMember_019fdcb7-c9c3-7007-baaa-f05ea5f2b854" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CommonStockMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_019fdcb7-c9c3-7ee6-a8ff-7b15291fd270" xlink:to="loc_us-gaap_CommonStockMember_019fdcb7-c9c3-7007-baaa-f05ea5f2b854" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonClassBMember_019fdcb7-c9c3-7f5f-91f1-97a98c75dbd6" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CommonClassBMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_019fdcb7-c9c3-7ee6-a8ff-7b15291fd270" xlink:to="loc_us-gaap_CommonClassBMember_019fdcb7-c9c3-7f5f-91f1-97a98c75dbd6" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockDividendsPerShareCashPaid_019fdcb7-c9c3-715d-83d8-5ab2629d2ed1" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CommonStockDividendsPerShareCashPaid"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_019fdcb7-c9c3-7a7c-b9d4-280d00a9a2a5" xlink:to="loc_us-gaap_CommonStockDividendsPerShareCashPaid_019fdcb7-c9c3-715d-83d8-5ab2629d2ed1" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/BUSINESSACQUISITIONSLESSEREVILLLCNARRATIVEDetails" xlink:type="simple" xlink:href="hsy-20260927.xsd#BUSINESSACQUISITIONSLESSEREVILLLCNARRATIVEDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/BUSINESSACQUISITIONSLESSEREVILLLCNARRATIVEDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionLineItems_019fdcb7-c9c3-7ebf-ab1d-deee298f1bed" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_BusinessAcquisitionLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_019fdcb7-c9c3-7f8d-b077-b11907f2638f" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_019fdcb7-c9c3-7ebf-ab1d-deee298f1bed" xlink:to="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_019fdcb7-c9c3-7f8d-b077-b11907f2638f" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAxis_019fdcb7-c9c3-7951-9d0d-dc086aafc6d8" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_BusinessAcquisitionAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_019fdcb7-c9c3-7f8d-b077-b11907f2638f" xlink:to="loc_us-gaap_BusinessAcquisitionAxis_019fdcb7-c9c3-7951-9d0d-dc086aafc6d8" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_019fdcb7-c9c3-7951-9d0d-dc086aafc6d8_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_BusinessAcquisitionAcquireeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_019fdcb7-c9c3-7951-9d0d-dc086aafc6d8" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_019fdcb7-c9c3-7951-9d0d-dc086aafc6d8_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_019fdcb7-c9c3-789a-86b7-06cb1c7fa324" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_BusinessAcquisitionAcquireeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_019fdcb7-c9c3-7951-9d0d-dc086aafc6d8" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_019fdcb7-c9c3-789a-86b7-06cb1c7fa324" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_LesserEvilLLCMember_019fdcb7-c9c3-7b8d-b50f-50b8585efb79" xlink:href="hsy-20260927.xsd#hsy_LesserEvilLLCMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionAcquireeDomain_019fdcb7-c9c3-789a-86b7-06cb1c7fa324" xlink:to="loc_hsy_LesserEvilLLCMember_019fdcb7-c9c3-7b8d-b50f-50b8585efb79" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeAxis_019fdcb7-c9c3-7acf-8fe7-03075c887568" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_RangeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_019fdcb7-c9c3-7f8d-b077-b11907f2638f" xlink:to="loc_srt_RangeAxis_019fdcb7-c9c3-7acf-8fe7-03075c887568" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_019fdcb7-c9c3-7acf-8fe7-03075c887568_default" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_RangeAxis_019fdcb7-c9c3-7acf-8fe7-03075c887568" xlink:to="loc_srt_RangeMember_019fdcb7-c9c3-7acf-8fe7-03075c887568_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_019fdcb7-c9c3-7430-bd8e-e0f005a51422" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_RangeAxis_019fdcb7-c9c3-7acf-8fe7-03075c887568" xlink:to="loc_srt_RangeMember_019fdcb7-c9c3-7430-bd8e-e0f005a51422" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MinimumMember_019fdcb7-c9c3-7ecb-a3a6-7babad1c13bd" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_MinimumMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_019fdcb7-c9c3-7430-bd8e-e0f005a51422" xlink:to="loc_srt_MinimumMember_019fdcb7-c9c3-7ecb-a3a6-7babad1c13bd" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MaximumMember_019fdcb7-c9c3-738f-a639-c8f2d12d8916" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_MaximumMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_019fdcb7-c9c3-7430-bd8e-e0f005a51422" xlink:to="loc_srt_MaximumMember_019fdcb7-c9c3-738f-a639-c8f2d12d8916" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationConsiderationTransferred1_019fdcb7-c9c3-71f9-b362-4fbe98f6fe66" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_BusinessCombinationConsiderationTransferred1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_019fdcb7-c9c3-7ebf-ab1d-deee298f1bed" xlink:to="loc_us-gaap_BusinessCombinationConsiderationTransferred1_019fdcb7-c9c3-71f9-b362-4fbe98f6fe66" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationContingentConsiderationLiability_019fdcb7-c9c3-7e5b-a6f4-c8fb9fa2c9a7" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_BusinessCombinationContingentConsiderationLiability"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_019fdcb7-c9c3-7ebf-ab1d-deee298f1bed" xlink:to="loc_us-gaap_BusinessCombinationContingentConsiderationLiability_019fdcb7-c9c3-7e5b-a6f4-c8fb9fa2c9a7" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/BUSINESSACQUISITIONSLESSEREVILLLCASSETSACQUIREDANDLIABILITIESASSUMEDALLOCATIONDetails" xlink:type="simple" xlink:href="hsy-20260927.xsd#BUSINESSACQUISITIONSLESSEREVILLLCASSETSACQUIREDANDLIABILITIESASSUMEDALLOCATIONDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/BUSINESSACQUISITIONSLESSEREVILLLCASSETSACQUIREDANDLIABILITIESASSUMEDALLOCATIONDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionLineItems_019fdcb7-c9c3-7fc9-9c8a-5c441f1387d7" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_BusinessAcquisitionLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_019fdcb7-c9c3-7153-a70e-cefd8fadf655" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_019fdcb7-c9c3-7fc9-9c8a-5c441f1387d7" xlink:to="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_019fdcb7-c9c3-7153-a70e-cefd8fadf655" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAxis_019fdcb7-c9c3-74ce-8cd6-c56d939bc8ae" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_BusinessAcquisitionAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_019fdcb7-c9c3-7153-a70e-cefd8fadf655" xlink:to="loc_us-gaap_BusinessAcquisitionAxis_019fdcb7-c9c3-74ce-8cd6-c56d939bc8ae" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_019fdcb7-c9c3-74ce-8cd6-c56d939bc8ae_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_BusinessAcquisitionAcquireeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_019fdcb7-c9c3-74ce-8cd6-c56d939bc8ae" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_019fdcb7-c9c3-74ce-8cd6-c56d939bc8ae_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_019fdcb7-c9c3-72dd-b92a-aaf8d60316d9" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_BusinessAcquisitionAcquireeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_019fdcb7-c9c3-74ce-8cd6-c56d939bc8ae" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_019fdcb7-c9c3-72dd-b92a-aaf8d60316d9" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_LesserEvilLLCMember_019fdcb7-c9c3-7592-a113-25ed5beadfe9" xlink:href="hsy-20260927.xsd#hsy_LesserEvilLLCMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionAcquireeDomain_019fdcb7-c9c3-72dd-b92a-aaf8d60316d9" xlink:to="loc_hsy_LesserEvilLLCMember_019fdcb7-c9c3-7592-a113-25ed5beadfe9" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Goodwill_019fdcb7-c9c3-73ec-b12e-781c60629e69" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_Goodwill"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_019fdcb7-c9c3-7fc9-9c8a-5c441f1387d7" xlink:to="loc_us-gaap_Goodwill_019fdcb7-c9c3-73ec-b12e-781c60629e69" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibleAssetsOtherThanGoodwill_019fdcb7-c9c3-7c04-b5b1-4e9c9435a666" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibleAssetsOtherThanGoodwill"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_019fdcb7-c9c3-7fc9-9c8a-5c441f1387d7" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibleAssetsOtherThanGoodwill_019fdcb7-c9c3-7c04-b5b1-4e9c9435a666" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCurrentAssets_019fdcb7-c9c3-7bdc-8e1d-0627797afbe6" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCurrentAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_019fdcb7-c9c3-7fc9-9c8a-5c441f1387d7" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCurrentAssets_019fdcb7-c9c3-7bdc-8e1d-0627797afbe6" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedPropertyPlantAndEquipment_019fdcb7-c9c3-76a1-9413-8b1f190f1605" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedPropertyPlantAndEquipment"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_019fdcb7-c9c3-7fc9-9c8a-5c441f1387d7" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedPropertyPlantAndEquipment_019fdcb7-c9c3-76a1-9413-8b1f190f1605" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedOtherNoncurrentAssets_019fdcb7-c9c3-77ef-b599-fc6b50b91947" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedOtherNoncurrentAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_019fdcb7-c9c3-7fc9-9c8a-5c441f1387d7" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedOtherNoncurrentAssets_019fdcb7-c9c3-77ef-b599-fc6b50b91947" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCurrentLiabilities_019fdcb7-c9c3-74da-b743-2d06b0099808" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCurrentLiabilities"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_019fdcb7-c9c3-7fc9-9c8a-5c441f1387d7" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCurrentLiabilities_019fdcb7-c9c3-74da-b743-2d06b0099808" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedNoncurrentLiabilities_019fdcb7-c9c3-776d-8782-cc48f26658cc" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedNoncurrentLiabilities"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_019fdcb7-c9c3-7fc9-9c8a-5c441f1387d7" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedNoncurrentLiabilities_019fdcb7-c9c3-776d-8782-cc48f26658cc" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedDeferredTaxLiabilities_019fdcb7-c9c3-7d8b-adc5-ecddf37c9fae" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedDeferredTaxLiabilities"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_019fdcb7-c9c3-7fc9-9c8a-5c441f1387d7" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedDeferredTaxLiabilities_019fdcb7-c9c3-7d8b-adc5-ecddf37c9fae" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredGoodwillAndLiabilitiesAssumedNet_019fdcb7-c9c3-7d49-a553-371278e4851a" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredGoodwillAndLiabilitiesAssumedNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_019fdcb7-c9c3-7fc9-9c8a-5c441f1387d7" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredGoodwillAndLiabilitiesAssumedNet_019fdcb7-c9c3-7d49-a553-371278e4851a" xlink:type="arc" order="8"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/BUSINESSACQUISITIONSLESSEREVILLLCOTHERINTANGIBLEASSETSDetails" xlink:type="simple" xlink:href="hsy-20260927.xsd#BUSINESSACQUISITIONSLESSEREVILLLCOTHERINTANGIBLEASSETSDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/BUSINESSACQUISITIONSLESSEREVILLLCOTHERINTANGIBLEASSETSDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionLineItems_019fdcb7-c9c3-7d94-854c-f690436ed304" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_BusinessAcquisitionLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_019fdcb7-c9c3-7afd-8660-957f8bc1f719" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_019fdcb7-c9c3-7d94-854c-f690436ed304" xlink:to="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_019fdcb7-c9c3-7afd-8660-957f8bc1f719" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAxis_019fdcb7-c9c3-7461-9a75-e230c70ba627" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_BusinessAcquisitionAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_019fdcb7-c9c3-7afd-8660-957f8bc1f719" xlink:to="loc_us-gaap_BusinessAcquisitionAxis_019fdcb7-c9c3-7461-9a75-e230c70ba627" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_019fdcb7-c9c3-7461-9a75-e230c70ba627_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_BusinessAcquisitionAcquireeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_019fdcb7-c9c3-7461-9a75-e230c70ba627" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_019fdcb7-c9c3-7461-9a75-e230c70ba627_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_019fdcb7-c9c3-7fed-870b-5a8164ff88e6" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_BusinessAcquisitionAcquireeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_019fdcb7-c9c3-7461-9a75-e230c70ba627" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_019fdcb7-c9c3-7fed-870b-5a8164ff88e6" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_LesserEvilLLCMember_019fdcb7-c9c3-75ad-b621-cae33966f6f4" xlink:href="hsy-20260927.xsd#hsy_LesserEvilLLCMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionAcquireeDomain_019fdcb7-c9c3-7fed-870b-5a8164ff88e6" xlink:to="loc_hsy_LesserEvilLLCMember_019fdcb7-c9c3-75ad-b621-cae33966f6f4" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis_019fdcb7-c9c3-7993-8911-b94d528b6164" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_019fdcb7-c9c3-7afd-8660-957f8bc1f719" xlink:to="loc_us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis_019fdcb7-c9c3-7993-8911-b94d528b6164" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain_019fdcb7-c9c3-7993-8911-b94d528b6164_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis_019fdcb7-c9c3-7993-8911-b94d528b6164" xlink:to="loc_us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain_019fdcb7-c9c3-7993-8911-b94d528b6164_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain_019fdcb7-c9c3-77b9-8dff-7564d5574666" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis_019fdcb7-c9c3-7993-8911-b94d528b6164" xlink:to="loc_us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain_019fdcb7-c9c3-77b9-8dff-7564d5574666" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TrademarksMember_019fdcb7-c9c3-7154-8299-1d3a9c92ed33" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_TrademarksMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain_019fdcb7-c9c3-77b9-8dff-7564d5574666" xlink:to="loc_us-gaap_TrademarksMember_019fdcb7-c9c3-7154-8299-1d3a9c92ed33" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_019fdcb7-c9c3-781d-9779-03fbc436b2f3" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_019fdcb7-c9c3-7afd-8660-957f8bc1f719" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_019fdcb7-c9c3-781d-9779-03fbc436b2f3" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_019fdcb7-c9c3-781d-9779-03fbc436b2f3_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_019fdcb7-c9c3-781d-9779-03fbc436b2f3" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_019fdcb7-c9c3-781d-9779-03fbc436b2f3_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_019fdcb7-c9c3-7462-9baa-6c484c069e37" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_019fdcb7-c9c3-781d-9779-03fbc436b2f3" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_019fdcb7-c9c3-7462-9baa-6c484c069e37" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CustomerRelatedIntangibleAssetsMember_019fdcb7-c9c3-752f-94a3-57d422531f34" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CustomerRelatedIntangibleAssetsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_019fdcb7-c9c3-7462-9baa-6c484c069e37" xlink:to="loc_us-gaap_CustomerRelatedIntangibleAssetsMember_019fdcb7-c9c3-752f-94a3-57d422531f34" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibleAssetsOtherThanGoodwill_019fdcb7-c9c3-7ed4-ac88-2166e249ab7b" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibleAssetsOtherThanGoodwill"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_019fdcb7-c9c3-7d94-854c-f690436ed304" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibleAssetsOtherThanGoodwill_019fdcb7-c9c3-7ed4-ac88-2166e249ab7b" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetUsefulLife_019fdcb7-c9c3-79e1-8668-cef5bbb4ab9f" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FiniteLivedIntangibleAssetUsefulLife"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_019fdcb7-c9c3-7d94-854c-f690436ed304" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetUsefulLife_019fdcb7-c9c3-79e1-8668-cef5bbb4ab9f" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/BUSINESSACQUISITIONSSOURSTRIPSNARRATIVEDetails" xlink:type="simple" xlink:href="hsy-20260927.xsd#BUSINESSACQUISITIONSSOURSTRIPSNARRATIVEDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/BUSINESSACQUISITIONSSOURSTRIPSNARRATIVEDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionLineItems_019fdcb7-c9c3-7c88-8242-cef496926ab0" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_BusinessAcquisitionLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_019fdcb7-c9c3-7568-9ab8-6f905022e7f1" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_019fdcb7-c9c3-7c88-8242-cef496926ab0" xlink:to="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_019fdcb7-c9c3-7568-9ab8-6f905022e7f1" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAxis_019fdcb7-c9c3-75b1-971e-a10695d20dee" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_BusinessAcquisitionAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_019fdcb7-c9c3-7568-9ab8-6f905022e7f1" xlink:to="loc_us-gaap_BusinessAcquisitionAxis_019fdcb7-c9c3-75b1-971e-a10695d20dee" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_019fdcb7-c9c3-75b1-971e-a10695d20dee_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_BusinessAcquisitionAcquireeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_019fdcb7-c9c3-75b1-971e-a10695d20dee" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_019fdcb7-c9c3-75b1-971e-a10695d20dee_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_019fdcb7-c9c3-7e97-afb2-5fc7df1934c7" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_BusinessAcquisitionAcquireeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_019fdcb7-c9c3-75b1-971e-a10695d20dee" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_019fdcb7-c9c3-7e97-afb2-5fc7df1934c7" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_SourStripsMember_019fdcb7-c9c3-705c-8675-5f2deb1ac581" xlink:href="hsy-20260927.xsd#hsy_SourStripsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionAcquireeDomain_019fdcb7-c9c3-7e97-afb2-5fc7df1934c7" xlink:to="loc_hsy_SourStripsMember_019fdcb7-c9c3-705c-8675-5f2deb1ac581" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_019fdcb7-c9c3-7ef8-9bfe-ce028595a689" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_019fdcb7-c9c3-7568-9ab8-6f905022e7f1" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_019fdcb7-c9c3-7ef8-9bfe-ce028595a689" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_019fdcb7-c9c3-7ef8-9bfe-ce028595a689_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_019fdcb7-c9c3-7ef8-9bfe-ce028595a689" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_019fdcb7-c9c3-7ef8-9bfe-ce028595a689_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_019fdcb7-c9c3-7a9d-a777-4309a81c2bf1" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_019fdcb7-c9c3-7ef8-9bfe-ce028595a689" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_019fdcb7-c9c3-7a9d-a777-4309a81c2bf1" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TrademarksMember_019fdcb7-c9c3-7f3d-b411-2b667696b45b" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_TrademarksMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_019fdcb7-c9c3-7a9d-a777-4309a81c2bf1" xlink:to="loc_us-gaap_TrademarksMember_019fdcb7-c9c3-7f3d-b411-2b667696b45b" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CustomerRelationshipsMember_019fdcb7-c9c3-7ef2-9305-8c8dab676932" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CustomerRelationshipsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_019fdcb7-c9c3-7a9d-a777-4309a81c2bf1" xlink:to="loc_us-gaap_CustomerRelationshipsMember_019fdcb7-c9c3-7ef2-9305-8c8dab676932" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeAxis_019fdcb7-c9c3-7349-824f-445e9b82ecb8" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_RangeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_019fdcb7-c9c3-7568-9ab8-6f905022e7f1" xlink:to="loc_srt_RangeAxis_019fdcb7-c9c3-7349-824f-445e9b82ecb8" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_019fdcb7-c9c3-7349-824f-445e9b82ecb8_default" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_RangeAxis_019fdcb7-c9c3-7349-824f-445e9b82ecb8" xlink:to="loc_srt_RangeMember_019fdcb7-c9c3-7349-824f-445e9b82ecb8_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_019fdcb7-c9c3-7daf-8f81-4fb518b1033f" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_RangeAxis_019fdcb7-c9c3-7349-824f-445e9b82ecb8" xlink:to="loc_srt_RangeMember_019fdcb7-c9c3-7daf-8f81-4fb518b1033f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MinimumMember_019fdcb7-c9c3-76c0-b729-a9f17fbff288" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_MinimumMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_019fdcb7-c9c3-7daf-8f81-4fb518b1033f" xlink:to="loc_srt_MinimumMember_019fdcb7-c9c3-76c0-b729-a9f17fbff288" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MaximumMember_019fdcb7-c9c3-7aa2-b379-c04efa4c9aa2" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_MaximumMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_019fdcb7-c9c3-7daf-8f81-4fb518b1033f" xlink:to="loc_srt_MaximumMember_019fdcb7-c9c3-7aa2-b379-c04efa4c9aa2" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedTrademarksGross_019fdcb7-c9c3-70f6-8dad-e289fa8596b1" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FiniteLivedTrademarksGross"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_019fdcb7-c9c3-7c88-8242-cef496926ab0" xlink:to="loc_us-gaap_FiniteLivedTrademarksGross_019fdcb7-c9c3-70f6-8dad-e289fa8596b1" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedCustomerRelationshipsGross_019fdcb7-c9c3-72c4-9911-17db2c71c020" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FiniteLivedCustomerRelationshipsGross"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_019fdcb7-c9c3-7c88-8242-cef496926ab0" xlink:to="loc_us-gaap_FiniteLivedCustomerRelationshipsGross_019fdcb7-c9c3-72c4-9911-17db2c71c020" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetUsefulLife_019fdcb7-c9c3-75f0-8970-cee336074c5d" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FiniteLivedIntangibleAssetUsefulLife"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_019fdcb7-c9c3-7c88-8242-cef496926ab0" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetUsefulLife_019fdcb7-c9c3-75f0-8970-cee336074c5d" xlink:type="arc" order="2"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/GOODWILLANDINTANGIBLEASSETSSCHEDULEOFCHANGESINCARRYINGVALUEOFGOODWILLBYREPORTABLESEGMENTDetails" xlink:type="simple" xlink:href="hsy-20260927.xsd#GOODWILLANDINTANGIBLEASSETSSCHEDULEOFCHANGESINCARRYINGVALUEOFGOODWILLBYREPORTABLESEGMENTDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/GOODWILLANDINTANGIBLEASSETSSCHEDULEOFCHANGESINCARRYINGVALUEOFGOODWILLBYREPORTABLESEGMENTDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GoodwillLineItems_019fdcb7-c9c4-7cba-9fd3-3dd3164bacc0" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_GoodwillLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfGoodwillTable_019fdcb7-c9c4-7155-bf62-dc3d79ab3704" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ScheduleOfGoodwillTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_GoodwillLineItems_019fdcb7-c9c4-7cba-9fd3-3dd3164bacc0" xlink:to="loc_us-gaap_ScheduleOfGoodwillTable_019fdcb7-c9c4-7155-bf62-dc3d79ab3704" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsAxis_019fdcb7-c9c4-709f-b1cd-c974e78f1212" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_ConsolidationItemsAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfGoodwillTable_019fdcb7-c9c4-7155-bf62-dc3d79ab3704" xlink:to="loc_srt_ConsolidationItemsAxis_019fdcb7-c9c4-709f-b1cd-c974e78f1212" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsDomain_019fdcb7-c9c4-709f-b1cd-c974e78f1212_default" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_ConsolidationItemsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_ConsolidationItemsAxis_019fdcb7-c9c4-709f-b1cd-c974e78f1212" xlink:to="loc_srt_ConsolidationItemsDomain_019fdcb7-c9c4-709f-b1cd-c974e78f1212_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsDomain_019fdcb7-c9c4-7efc-a789-8b55ffc04db7" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_ConsolidationItemsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_ConsolidationItemsAxis_019fdcb7-c9c4-709f-b1cd-c974e78f1212" xlink:to="loc_srt_ConsolidationItemsDomain_019fdcb7-c9c4-7efc-a789-8b55ffc04db7" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingSegmentsMember_019fdcb7-c9c4-73c8-93da-9b1529e28b6f" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OperatingSegmentsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ConsolidationItemsDomain_019fdcb7-c9c4-7efc-a789-8b55ffc04db7" xlink:to="loc_us-gaap_OperatingSegmentsMember_019fdcb7-c9c4-73c8-93da-9b1529e28b6f" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementBusinessSegmentsAxis_019fdcb7-c9c4-7224-b8db-9d1ca1a49a71" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_StatementBusinessSegmentsAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfGoodwillTable_019fdcb7-c9c4-7155-bf62-dc3d79ab3704" xlink:to="loc_us-gaap_StatementBusinessSegmentsAxis_019fdcb7-c9c4-7224-b8db-9d1ca1a49a71" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SegmentDomain_019fdcb7-c9c4-7224-b8db-9d1ca1a49a71_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_SegmentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementBusinessSegmentsAxis_019fdcb7-c9c4-7224-b8db-9d1ca1a49a71" xlink:to="loc_us-gaap_SegmentDomain_019fdcb7-c9c4-7224-b8db-9d1ca1a49a71_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SegmentDomain_019fdcb7-c9c4-7393-bba6-a51757b56267" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_SegmentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementBusinessSegmentsAxis_019fdcb7-c9c4-7224-b8db-9d1ca1a49a71" xlink:to="loc_us-gaap_SegmentDomain_019fdcb7-c9c4-7393-bba6-a51757b56267" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_NorthAmericaConfectionerySegmentMember_019fdcb7-c9c4-7b40-a812-f8bfc1580053" xlink:href="hsy-20260927.xsd#hsy_NorthAmericaConfectionerySegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentDomain_019fdcb7-c9c4-7393-bba6-a51757b56267" xlink:to="loc_hsy_NorthAmericaConfectionerySegmentMember_019fdcb7-c9c4-7b40-a812-f8bfc1580053" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_NorthAmericaSaltySnacksSegmentMember_019fdcb7-c9c4-7df7-96c5-59b22f5a4c23" xlink:href="hsy-20260927.xsd#hsy_NorthAmericaSaltySnacksSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentDomain_019fdcb7-c9c4-7393-bba6-a51757b56267" xlink:to="loc_hsy_NorthAmericaSaltySnacksSegmentMember_019fdcb7-c9c4-7df7-96c5-59b22f5a4c23" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_InternationalSegmentMember_019fdcb7-c9c4-7adc-8125-66a035ee3128" xlink:href="hsy-20260927.xsd#hsy_InternationalSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentDomain_019fdcb7-c9c4-7393-bba6-a51757b56267" xlink:to="loc_hsy_InternationalSegmentMember_019fdcb7-c9c4-7adc-8125-66a035ee3128" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GoodwillRollForward_019fdcb7-c9c4-7d75-9998-03e78fd65a95" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_GoodwillRollForward"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_GoodwillLineItems_019fdcb7-c9c4-7cba-9fd3-3dd3164bacc0" xlink:to="loc_us-gaap_GoodwillRollForward_019fdcb7-c9c4-7d75-9998-03e78fd65a95" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Goodwill_019fdcb7-c9c4-75d9-81db-d5ecc1b96bfa" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_Goodwill"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_GoodwillRollForward_019fdcb7-c9c4-7d75-9998-03e78fd65a95" xlink:to="loc_us-gaap_Goodwill_019fdcb7-c9c4-75d9-81db-d5ecc1b96bfa" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GoodwillPurchaseAccountingAdjustments_019fdcb7-c9c4-7414-8d62-fe7deea235cd" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_GoodwillPurchaseAccountingAdjustments"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_GoodwillRollForward_019fdcb7-c9c4-7d75-9998-03e78fd65a95" xlink:to="loc_us-gaap_GoodwillPurchaseAccountingAdjustments_019fdcb7-c9c4-7414-8d62-fe7deea235cd" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GoodwillForeignCurrencyTranslationGainLoss_019fdcb7-c9c4-7c9c-8126-b0281b6cefea" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_GoodwillForeignCurrencyTranslationGainLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_GoodwillRollForward_019fdcb7-c9c4-7d75-9998-03e78fd65a95" xlink:to="loc_us-gaap_GoodwillForeignCurrencyTranslationGainLoss_019fdcb7-c9c4-7c9c-8126-b0281b6cefea" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Goodwill_019fdcb7-c9c4-769d-b772-c2aa8372db76" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_Goodwill"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/GOODWILLANDINTANGIBLEASSETSSCHEDULEOFGROSSCARRYINGAMOUNTANDACCUMULATEDAMORTIZATIONFOREACHMAJORCLASSOFINTANGIBLEASSETDetails" xlink:type="simple" xlink:href="hsy-20260927.xsd#GOODWILLANDINTANGIBLEASSETSSCHEDULEOFGROSSCARRYINGAMOUNTANDACCUMULATEDAMORTIZATIONFOREACHMAJORCLASSOFINTANGIBLEASSETDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/GOODWILLANDINTANGIBLEASSETSSCHEDULEOFGROSSCARRYINGAMOUNTANDACCUMULATEDAMORTIZATIONFOREACHMAJORCLASSOFINTANGIBLEASSETDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_019fdcb7-c9c4-7dc0-be0a-1715a170bdfc" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FiniteLivedIntangibleAssetsLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTable_019fdcb7-c9c4-71b1-b2a4-121439e45aa5" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_019fdcb7-c9c4-7dc0-be0a-1715a170bdfc" xlink:to="loc_us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTable_019fdcb7-c9c4-71b1-b2a4-121439e45aa5" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_019fdcb7-c9c4-7ac8-80ad-65a443b8f2de" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTable_019fdcb7-c9c4-71b1-b2a4-121439e45aa5" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_019fdcb7-c9c4-7ac8-80ad-65a443b8f2de" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_019fdcb7-c9c4-7ac8-80ad-65a443b8f2de_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_019fdcb7-c9c4-7ac8-80ad-65a443b8f2de" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_019fdcb7-c9c4-7ac8-80ad-65a443b8f2de_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_019fdcb7-c9c4-7c36-ad1e-9e59087bee68" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_019fdcb7-c9c4-7ac8-80ad-65a443b8f2de" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_019fdcb7-c9c4-7c36-ad1e-9e59087bee68" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TrademarksMember_019fdcb7-c9c4-711d-bfd9-a89e1b1d2778" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_TrademarksMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_019fdcb7-c9c4-7c36-ad1e-9e59087bee68" xlink:to="loc_us-gaap_TrademarksMember_019fdcb7-c9c4-711d-bfd9-a89e1b1d2778" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CustomerRelatedIntangibleAssetsMember_019fdcb7-c9c4-74f8-985d-96e9b5b24234" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CustomerRelatedIntangibleAssetsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_019fdcb7-c9c4-7c36-ad1e-9e59087bee68" xlink:to="loc_us-gaap_CustomerRelatedIntangibleAssetsMember_019fdcb7-c9c4-74f8-985d-96e9b5b24234" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PatentsMember_019fdcb7-c9c4-7c95-b6d6-bd5fe4f0d3da" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_PatentsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_019fdcb7-c9c4-7c36-ad1e-9e59087bee68" xlink:to="loc_us-gaap_PatentsMember_019fdcb7-c9c4-7c95-b6d6-bd5fe4f0d3da" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis_019fdcb7-c9c4-722e-bede-65aba896838e" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTable_019fdcb7-c9c4-71b1-b2a4-121439e45aa5" xlink:to="loc_us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis_019fdcb7-c9c4-722e-bede-65aba896838e" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain_019fdcb7-c9c4-722e-bede-65aba896838e_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis_019fdcb7-c9c4-722e-bede-65aba896838e" xlink:to="loc_us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain_019fdcb7-c9c4-722e-bede-65aba896838e_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain_019fdcb7-c9c4-7798-9620-ad09c07dd162" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis_019fdcb7-c9c4-722e-bede-65aba896838e" xlink:to="loc_us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain_019fdcb7-c9c4-7798-9620-ad09c07dd162" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TrademarksMember_019fdcb7-c9c4-7d09-b5a4-d45c1432f802" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_TrademarksMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain_019fdcb7-c9c4-7798-9620-ad09c07dd162" xlink:to="loc_us-gaap_TrademarksMember_019fdcb7-c9c4-7d09-b5a4-d45c1432f802" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsGross_019fdcb7-c9c4-7b13-8469-7e262014b09a" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FiniteLivedIntangibleAssetsGross"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_019fdcb7-c9c4-7dc0-be0a-1715a170bdfc" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsGross_019fdcb7-c9c4-7b13-8469-7e262014b09a" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization_019fdcb7-c9c4-7675-bbee-4acfe62c199e" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_019fdcb7-c9c4-7dc0-be0a-1715a170bdfc" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization_019fdcb7-c9c4-7675-bbee-4acfe62c199e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IndefiniteLivedIntangibleAssetsExcludingGoodwill_019fdcb7-c9c4-786f-99f8-346f954b038d" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_IndefiniteLivedIntangibleAssetsExcludingGoodwill"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_019fdcb7-c9c4-7dc0-be0a-1715a170bdfc" xlink:to="loc_us-gaap_IndefiniteLivedIntangibleAssetsExcludingGoodwill_019fdcb7-c9c4-786f-99f8-346f954b038d" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IntangibleAssetsNetExcludingGoodwill_019fdcb7-c9c4-7cf2-9efc-abc332d6c9dc" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_IntangibleAssetsNetExcludingGoodwill"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_019fdcb7-c9c4-7dc0-be0a-1715a170bdfc" xlink:to="loc_us-gaap_IntangibleAssetsNetExcludingGoodwill_019fdcb7-c9c4-7cf2-9efc-abc332d6c9dc" xlink:type="arc" order="3"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/SHORTANDLONGTERMDEBTSCHEDULEOFSHORTTERMDEBTDetails" xlink:type="simple" xlink:href="hsy-20260927.xsd#SHORTANDLONGTERMDEBTSCHEDULEOFSHORTTERMDEBTDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/SHORTANDLONGTERMDEBTSCHEDULEOFSHORTTERMDEBTDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LineOfCreditFacilityLineItems_019fdcb7-c9c4-752b-a4ea-e0d61161ee17" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_LineOfCreditFacilityLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LineOfCreditFacilityTable_019fdcb7-c9c4-746d-af10-bc7e167099cf" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_LineOfCreditFacilityTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_LineOfCreditFacilityLineItems_019fdcb7-c9c4-752b-a4ea-e0d61161ee17" xlink:to="loc_us-gaap_LineOfCreditFacilityTable_019fdcb7-c9c4-746d-af10-bc7e167099cf" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CreditFacilityAxis_019fdcb7-c9c4-72c0-b1c0-fb2bf2d102c4" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CreditFacilityAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_LineOfCreditFacilityTable_019fdcb7-c9c4-746d-af10-bc7e167099cf" xlink:to="loc_us-gaap_CreditFacilityAxis_019fdcb7-c9c4-72c0-b1c0-fb2bf2d102c4" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CreditFacilityDomain_019fdcb7-c9c4-72c0-b1c0-fb2bf2d102c4_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CreditFacilityDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_CreditFacilityAxis_019fdcb7-c9c4-72c0-b1c0-fb2bf2d102c4" xlink:to="loc_us-gaap_CreditFacilityDomain_019fdcb7-c9c4-72c0-b1c0-fb2bf2d102c4_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CreditFacilityDomain_019fdcb7-c9c4-77e9-bdf5-b8dc6d6c6d5e" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CreditFacilityDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_CreditFacilityAxis_019fdcb7-c9c4-72c0-b1c0-fb2bf2d102c4" xlink:to="loc_us-gaap_CreditFacilityDomain_019fdcb7-c9c4-77e9-bdf5-b8dc6d6c6d5e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RevolvingCreditFacilityMember_019fdcb7-c9c4-77a8-9648-c49328543f7c" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RevolvingCreditFacilityMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CreditFacilityDomain_019fdcb7-c9c4-77e9-bdf5-b8dc6d6c6d5e" xlink:to="loc_us-gaap_RevolvingCreditFacilityMember_019fdcb7-c9c4-77a8-9648-c49328543f7c" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongtermDebtTypeAxis_019fdcb7-c9c4-7642-a456-7fd2faad8bc6" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_LongtermDebtTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_LineOfCreditFacilityTable_019fdcb7-c9c4-746d-af10-bc7e167099cf" xlink:to="loc_us-gaap_LongtermDebtTypeAxis_019fdcb7-c9c4-7642-a456-7fd2faad8bc6" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongtermDebtTypeDomain_019fdcb7-c9c4-7642-a456-7fd2faad8bc6_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_LongtermDebtTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_LongtermDebtTypeAxis_019fdcb7-c9c4-7642-a456-7fd2faad8bc6" xlink:to="loc_us-gaap_LongtermDebtTypeDomain_019fdcb7-c9c4-7642-a456-7fd2faad8bc6_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongtermDebtTypeDomain_019fdcb7-c9c4-7af1-86cd-02a4231de924" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_LongtermDebtTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_LongtermDebtTypeAxis_019fdcb7-c9c4-7642-a456-7fd2faad8bc6" xlink:to="loc_us-gaap_LongtermDebtTypeDomain_019fdcb7-c9c4-7af1-86cd-02a4231de924" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ForeignLineOfCreditMember_019fdcb7-c9c4-7836-aad2-13c561ca716a" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ForeignLineOfCreditMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LongtermDebtTypeDomain_019fdcb7-c9c4-7af1-86cd-02a4231de924" xlink:to="loc_us-gaap_ForeignLineOfCreditMember_019fdcb7-c9c4-7836-aad2-13c561ca716a" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShortTermDebtTypeAxis_019fdcb7-c9c4-7c49-80b4-0c3f32322807" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ShortTermDebtTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_LineOfCreditFacilityTable_019fdcb7-c9c4-746d-af10-bc7e167099cf" xlink:to="loc_us-gaap_ShortTermDebtTypeAxis_019fdcb7-c9c4-7c49-80b4-0c3f32322807" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShortTermDebtTypeDomain_019fdcb7-c9c4-7c49-80b4-0c3f32322807_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ShortTermDebtTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_ShortTermDebtTypeAxis_019fdcb7-c9c4-7c49-80b4-0c3f32322807" xlink:to="loc_us-gaap_ShortTermDebtTypeDomain_019fdcb7-c9c4-7c49-80b4-0c3f32322807_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShortTermDebtTypeDomain_019fdcb7-c9c4-73eb-822a-d8fed38094f9" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ShortTermDebtTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_ShortTermDebtTypeAxis_019fdcb7-c9c4-7c49-80b4-0c3f32322807" xlink:to="loc_us-gaap_ShortTermDebtTypeDomain_019fdcb7-c9c4-73eb-822a-d8fed38094f9" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommercialPaperMember_019fdcb7-c9c4-7c70-9b2a-0b66da7d603a" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CommercialPaperMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShortTermDebtTypeDomain_019fdcb7-c9c4-73eb-822a-d8fed38094f9" xlink:to="loc_us-gaap_CommercialPaperMember_019fdcb7-c9c4-7c70-9b2a-0b66da7d603a" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LinesOfCreditCurrent_019fdcb7-c9c4-7f6f-9c6e-d5fa74d36c1d" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_LinesOfCreditCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LineOfCreditFacilityLineItems_019fdcb7-c9c4-752b-a4ea-e0d61161ee17" xlink:to="loc_us-gaap_LinesOfCreditCurrent_019fdcb7-c9c4-7f6f-9c6e-d5fa74d36c1d" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShortTermBorrowings_019fdcb7-c9c4-7c32-8daf-48b09c803a73" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ShortTermBorrowings"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LineOfCreditFacilityLineItems_019fdcb7-c9c4-752b-a4ea-e0d61161ee17" xlink:to="loc_us-gaap_ShortTermBorrowings_019fdcb7-c9c4-7c32-8daf-48b09c803a73" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShortTermDebtWeightedAverageInterestRate_019fdcb7-c9c4-7893-ade3-862084bd36b1" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ShortTermDebtWeightedAverageInterestRate"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LineOfCreditFacilityLineItems_019fdcb7-c9c4-752b-a4ea-e0d61161ee17" xlink:to="loc_us-gaap_ShortTermDebtWeightedAverageInterestRate_019fdcb7-c9c4-7893-ade3-862084bd36b1" xlink:type="arc" order="2"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/SHORTANDLONGTERMDEBTSHORTTERMDEBTNARRATIVEDetails" xlink:type="simple" xlink:href="hsy-20260927.xsd#SHORTANDLONGTERMDEBTSHORTTERMDEBTNARRATIVEDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/SHORTANDLONGTERMDEBTSHORTTERMDEBTNARRATIVEDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LineOfCreditFacilityLineItems_019fdcb7-c9c4-76a3-a2d0-88020d081024" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_LineOfCreditFacilityLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LineOfCreditFacilityTable_019fdcb7-c9c4-77b8-aaa3-57709f9ef0c2" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_LineOfCreditFacilityTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_LineOfCreditFacilityLineItems_019fdcb7-c9c4-76a3-a2d0-88020d081024" xlink:to="loc_us-gaap_LineOfCreditFacilityTable_019fdcb7-c9c4-77b8-aaa3-57709f9ef0c2" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentAxis_019fdcb7-c9c4-7aab-a80f-36d1e8786ee3" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DebtInstrumentAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_LineOfCreditFacilityTable_019fdcb7-c9c4-77b8-aaa3-57709f9ef0c2" xlink:to="loc_us-gaap_DebtInstrumentAxis_019fdcb7-c9c4-7aab-a80f-36d1e8786ee3" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentNameDomain_019fdcb7-c9c4-7aab-a80f-36d1e8786ee3_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DebtInstrumentNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DebtInstrumentAxis_019fdcb7-c9c4-7aab-a80f-36d1e8786ee3" xlink:to="loc_us-gaap_DebtInstrumentNameDomain_019fdcb7-c9c4-7aab-a80f-36d1e8786ee3_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentNameDomain_019fdcb7-c9c4-7d15-8ab4-08e5dcefdcfa" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DebtInstrumentNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DebtInstrumentAxis_019fdcb7-c9c4-7aab-a80f-36d1e8786ee3" xlink:to="loc_us-gaap_DebtInstrumentNameDomain_019fdcb7-c9c4-7d15-8ab4-08e5dcefdcfa" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LineOfCreditMember_019fdcb7-c9c4-73f4-8998-28d672d3e187" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_LineOfCreditMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_019fdcb7-c9c4-7d15-8ab4-08e5dcefdcfa" xlink:to="loc_us-gaap_LineOfCreditMember_019fdcb7-c9c4-73f4-8998-28d672d3e187" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CreditFacilityAxis_019fdcb7-c9c4-7f1f-86b8-4cadceaae4fd" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CreditFacilityAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_LineOfCreditFacilityTable_019fdcb7-c9c4-77b8-aaa3-57709f9ef0c2" xlink:to="loc_us-gaap_CreditFacilityAxis_019fdcb7-c9c4-7f1f-86b8-4cadceaae4fd" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CreditFacilityDomain_019fdcb7-c9c4-7f1f-86b8-4cadceaae4fd_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CreditFacilityDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_CreditFacilityAxis_019fdcb7-c9c4-7f1f-86b8-4cadceaae4fd" xlink:to="loc_us-gaap_CreditFacilityDomain_019fdcb7-c9c4-7f1f-86b8-4cadceaae4fd_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CreditFacilityDomain_019fdcb7-c9c4-7f4f-a3a4-88396014a5cc" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CreditFacilityDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_CreditFacilityAxis_019fdcb7-c9c4-7f1f-86b8-4cadceaae4fd" xlink:to="loc_us-gaap_CreditFacilityDomain_019fdcb7-c9c4-7f4f-a3a4-88396014a5cc" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RevolvingCreditFacilityMember_019fdcb7-c9c4-718a-a6dd-7b400f0f39ac" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RevolvingCreditFacilityMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CreditFacilityDomain_019fdcb7-c9c4-7f4f-a3a4-88396014a5cc" xlink:to="loc_us-gaap_RevolvingCreditFacilityMember_019fdcb7-c9c4-718a-a6dd-7b400f0f39ac" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongtermDebtTypeAxis_019fdcb7-c9c4-7da6-9046-ed7da44e5dc0" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_LongtermDebtTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_LineOfCreditFacilityTable_019fdcb7-c9c4-77b8-aaa3-57709f9ef0c2" xlink:to="loc_us-gaap_LongtermDebtTypeAxis_019fdcb7-c9c4-7da6-9046-ed7da44e5dc0" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongtermDebtTypeDomain_019fdcb7-c9c4-7da6-9046-ed7da44e5dc0_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_LongtermDebtTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_LongtermDebtTypeAxis_019fdcb7-c9c4-7da6-9046-ed7da44e5dc0" xlink:to="loc_us-gaap_LongtermDebtTypeDomain_019fdcb7-c9c4-7da6-9046-ed7da44e5dc0_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongtermDebtTypeDomain_019fdcb7-c9c4-79fc-9c00-a7f4004a40c8" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_LongtermDebtTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_LongtermDebtTypeAxis_019fdcb7-c9c4-7da6-9046-ed7da44e5dc0" xlink:to="loc_us-gaap_LongtermDebtTypeDomain_019fdcb7-c9c4-79fc-9c00-a7f4004a40c8" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LineOfCreditMember_019fdcb7-c9c4-74fe-8501-9ec2c008d848" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_LineOfCreditMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LongtermDebtTypeDomain_019fdcb7-c9c4-79fc-9c00-a7f4004a40c8" xlink:to="loc_us-gaap_LineOfCreditMember_019fdcb7-c9c4-74fe-8501-9ec2c008d848" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LineOfCreditFacilityMaximumBorrowingCapacity_019fdcb7-c9c4-7862-95dc-cf2aad079a91" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_LineOfCreditFacilityMaximumBorrowingCapacity"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LineOfCreditFacilityLineItems_019fdcb7-c9c4-76a3-a2d0-88020d081024" xlink:to="loc_us-gaap_LineOfCreditFacilityMaximumBorrowingCapacity_019fdcb7-c9c4-7862-95dc-cf2aad079a91" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_LineOfCreditFacilityAccordionFeatureIncreaseLimit_019fdcb7-c9c4-7da4-a4e6-9066e2c116e6" xlink:href="hsy-20260927.xsd#hsy_LineOfCreditFacilityAccordionFeatureIncreaseLimit"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LineOfCreditFacilityLineItems_019fdcb7-c9c4-76a3-a2d0-88020d081024" xlink:to="loc_hsy_LineOfCreditFacilityAccordionFeatureIncreaseLimit_019fdcb7-c9c4-7da4-a4e6-9066e2c116e6" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_DebtTerminationDateNumberOfExtensionOption_019fdcb7-c9c4-7f2e-9ab9-4f36d261c308" xlink:href="hsy-20260927.xsd#hsy_DebtTerminationDateNumberOfExtensionOption"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LineOfCreditFacilityLineItems_019fdcb7-c9c4-76a3-a2d0-88020d081024" xlink:to="loc_hsy_DebtTerminationDateNumberOfExtensionOption_019fdcb7-c9c4-7f2e-9ab9-4f36d261c308" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_DebtTerminationDateExtensionTerm_019fdcb7-c9c4-7c2b-b53a-3a057ed29745" xlink:href="hsy-20260927.xsd#hsy_DebtTerminationDateExtensionTerm"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LineOfCreditFacilityLineItems_019fdcb7-c9c4-76a3-a2d0-88020d081024" xlink:to="loc_hsy_DebtTerminationDateExtensionTerm_019fdcb7-c9c4-7c2b-b53a-3a057ed29745" xlink:type="arc" order="3"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/SHORTANDLONGTERMDEBTSCHEDULEOFLONGTERMDEBTINSTRUMENTSDetails" xlink:type="simple" xlink:href="hsy-20260927.xsd#SHORTANDLONGTERMDEBTSCHEDULEOFLONGTERMDEBTINSTRUMENTSDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/SHORTANDLONGTERMDEBTSCHEDULEOFLONGTERMDEBTINSTRUMENTSDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentLineItems_019fdcb7-c9c4-7a97-8e57-63bbfc5e2b1b" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DebtInstrumentLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentTable_019fdcb7-c9c4-72ab-bf21-e5b4b0e00d78" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DebtInstrumentTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_DebtInstrumentLineItems_019fdcb7-c9c4-7a97-8e57-63bbfc5e2b1b" xlink:to="loc_us-gaap_DebtInstrumentTable_019fdcb7-c9c4-72ab-bf21-e5b4b0e00d78" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongtermDebtTypeAxis_019fdcb7-c9c4-7588-960c-de2c0291ab30" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_LongtermDebtTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DebtInstrumentTable_019fdcb7-c9c4-72ab-bf21-e5b4b0e00d78" xlink:to="loc_us-gaap_LongtermDebtTypeAxis_019fdcb7-c9c4-7588-960c-de2c0291ab30" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongtermDebtTypeDomain_019fdcb7-c9c4-7588-960c-de2c0291ab30_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_LongtermDebtTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_LongtermDebtTypeAxis_019fdcb7-c9c4-7588-960c-de2c0291ab30" xlink:to="loc_us-gaap_LongtermDebtTypeDomain_019fdcb7-c9c4-7588-960c-de2c0291ab30_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongtermDebtTypeDomain_019fdcb7-c9c4-7dd3-bd34-bdfbce26baba" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_LongtermDebtTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_LongtermDebtTypeAxis_019fdcb7-c9c4-7588-960c-de2c0291ab30" xlink:to="loc_us-gaap_LongtermDebtTypeDomain_019fdcb7-c9c4-7dd3-bd34-bdfbce26baba" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DomesticCorporateDebtSecuritiesMember_019fdcb7-c9c4-7f45-9bda-c649f43b8c57" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DomesticCorporateDebtSecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LongtermDebtTypeDomain_019fdcb7-c9c4-7dd3-bd34-bdfbce26baba" xlink:to="loc_us-gaap_DomesticCorporateDebtSecuritiesMember_019fdcb7-c9c4-7f45-9bda-c649f43b8c57" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentAxis_019fdcb7-c9c4-79ad-a21c-64637751cee5" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DebtInstrumentAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DebtInstrumentTable_019fdcb7-c9c4-72ab-bf21-e5b4b0e00d78" xlink:to="loc_us-gaap_DebtInstrumentAxis_019fdcb7-c9c4-79ad-a21c-64637751cee5" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentNameDomain_019fdcb7-c9c4-79ad-a21c-64637751cee5_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DebtInstrumentNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DebtInstrumentAxis_019fdcb7-c9c4-79ad-a21c-64637751cee5" xlink:to="loc_us-gaap_DebtInstrumentNameDomain_019fdcb7-c9c4-79ad-a21c-64637751cee5_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentNameDomain_019fdcb7-c9c4-75d4-a889-29899f73e7c8" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DebtInstrumentNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DebtInstrumentAxis_019fdcb7-c9c4-79ad-a21c-64637751cee5" xlink:to="loc_us-gaap_DebtInstrumentNameDomain_019fdcb7-c9c4-75d4-a889-29899f73e7c8" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes2.30Due2026Member_019fdcb7-c9c4-71bb-a677-f1a8cc6d4d03" xlink:href="hsy-20260927.xsd#hsy_Notes2.30Due2026Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_019fdcb7-c9c4-75d4-a889-29899f73e7c8" xlink:to="loc_hsy_Notes2.30Due2026Member_019fdcb7-c9c4-71bb-a677-f1a8cc6d4d03" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Debentures7.200Due2027Member_019fdcb7-c9c4-7008-956c-f882b63c5410" xlink:href="hsy-20260927.xsd#hsy_Debentures7.200Due2027Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_019fdcb7-c9c4-75d4-a889-29899f73e7c8" xlink:to="loc_hsy_Debentures7.200Due2027Member_019fdcb7-c9c4-7008-956c-f882b63c5410" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes4.550Due2028Member_019fdcb7-c9c4-7e0b-b3c0-2a95963a7aea" xlink:href="hsy-20260927.xsd#hsy_Notes4.550Due2028Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_019fdcb7-c9c4-75d4-a889-29899f73e7c8" xlink:to="loc_hsy_Notes4.550Due2028Member_019fdcb7-c9c4-7e0b-b3c0-2a95963a7aea" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes4250Due2028Member_019fdcb7-c9c4-7187-8597-e6c78fabcafb" xlink:href="hsy-20260927.xsd#hsy_Notes4250Due2028Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_019fdcb7-c9c4-75d4-a889-29899f73e7c8" xlink:to="loc_hsy_Notes4250Due2028Member_019fdcb7-c9c4-7187-8597-e6c78fabcafb" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes2.450Due2029Member_019fdcb7-c9c4-795b-9e25-aeb753c2034b" xlink:href="hsy-20260927.xsd#hsy_Notes2.450Due2029Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_019fdcb7-c9c4-75d4-a889-29899f73e7c8" xlink:to="loc_hsy_Notes2.450Due2029Member_019fdcb7-c9c4-795b-9e25-aeb753c2034b" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes4.750Due2030Member_019fdcb7-c9c4-7fdd-bddf-e99d376e5669" xlink:href="hsy-20260927.xsd#hsy_Notes4.750Due2030Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_019fdcb7-c9c4-75d4-a889-29899f73e7c8" xlink:to="loc_hsy_Notes4.750Due2030Member_019fdcb7-c9c4-7fdd-bddf-e99d376e5669" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes1700Due2030Member_019fdcb7-c9c4-77da-90dc-c35936bdd658" xlink:href="hsy-20260927.xsd#hsy_Notes1700Due2030Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_019fdcb7-c9c4-75d4-a889-29899f73e7c8" xlink:to="loc_hsy_Notes1700Due2030Member_019fdcb7-c9c4-77da-90dc-c35936bdd658" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes4.950Due2032Member_019fdcb7-c9c4-7ff6-9c07-6301a97cad1a" xlink:href="hsy-20260927.xsd#hsy_Notes4.950Due2032Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_019fdcb7-c9c4-75d4-a889-29899f73e7c8" xlink:to="loc_hsy_Notes4.950Due2032Member_019fdcb7-c9c4-7ff6-9c07-6301a97cad1a" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes4500Due2033Member_019fdcb7-c9c4-7821-a3df-6ba9eb9aa283" xlink:href="hsy-20260927.xsd#hsy_Notes4500Due2033Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_019fdcb7-c9c4-75d4-a889-29899f73e7c8" xlink:to="loc_hsy_Notes4500Due2033Member_019fdcb7-c9c4-7821-a3df-6ba9eb9aa283" xlink:type="arc" order="8"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes5.100Due2035Member_019fdcb7-c9c4-754b-a09a-308048233003" xlink:href="hsy-20260927.xsd#hsy_Notes5.100Due2035Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_019fdcb7-c9c4-75d4-a889-29899f73e7c8" xlink:to="loc_hsy_Notes5.100Due2035Member_019fdcb7-c9c4-754b-a09a-308048233003" xlink:type="arc" order="9"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes3.375Due2046Member_019fdcb7-c9c4-7999-9d55-f39a477838a8" xlink:href="hsy-20260927.xsd#hsy_Notes3.375Due2046Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_019fdcb7-c9c4-75d4-a889-29899f73e7c8" xlink:to="loc_hsy_Notes3.375Due2046Member_019fdcb7-c9c4-7999-9d55-f39a477838a8" xlink:type="arc" order="10"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes3.125Due2049Member_019fdcb7-c9c4-7b33-a584-151aa56b58bf" xlink:href="hsy-20260927.xsd#hsy_Notes3.125Due2049Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_019fdcb7-c9c4-75d4-a889-29899f73e7c8" xlink:to="loc_hsy_Notes3.125Due2049Member_019fdcb7-c9c4-7b33-a584-151aa56b58bf" xlink:type="arc" order="11"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes2650Due2050Member_019fdcb7-c9c4-7a19-8e71-717570547ff2" xlink:href="hsy-20260927.xsd#hsy_Notes2650Due2050Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_019fdcb7-c9c4-75d4-a889-29899f73e7c8" xlink:to="loc_hsy_Notes2650Due2050Member_019fdcb7-c9c4-7a19-8e71-717570547ff2" xlink:type="arc" order="12"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinanceLeaseLiability_019fdcb7-c9c4-7507-a972-1ba7ce24f943" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FinanceLeaseLiability"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_019fdcb7-c9c4-7a97-8e57-63bbfc5e2b1b" xlink:to="loc_us-gaap_FinanceLeaseLiability_019fdcb7-c9c4-7507-a972-1ba7ce24f943" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_DebtInstrumentImpactofDerivativesUnamortizedDiscountPremiumandDebtIssuanceCostsNet_019fdcb7-c9c4-75be-a0a1-972764d3b39e" xlink:href="hsy-20260927.xsd#hsy_DebtInstrumentImpactofDerivativesUnamortizedDiscountPremiumandDebtIssuanceCostsNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_019fdcb7-c9c4-7a97-8e57-63bbfc5e2b1b" xlink:to="loc_hsy_DebtInstrumentImpactofDerivativesUnamortizedDiscountPremiumandDebtIssuanceCostsNet_019fdcb7-c9c4-75be-a0a1-972764d3b39e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongTermDebt_019fdcb7-c9c4-7740-ad76-a967bc3dc729" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_LongTermDebt"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_019fdcb7-c9c4-7a97-8e57-63bbfc5e2b1b" xlink:to="loc_us-gaap_LongTermDebt_019fdcb7-c9c4-7740-ad76-a967bc3dc729" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongTermDebtCurrent_019fdcb7-c9c4-7ea4-a6cf-8ce49bff7090" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_LongTermDebtCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_019fdcb7-c9c4-7a97-8e57-63bbfc5e2b1b" xlink:to="loc_us-gaap_LongTermDebtCurrent_019fdcb7-c9c4-7ea4-a6cf-8ce49bff7090" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongTermDebtNoncurrent_019fdcb7-c9c4-735e-beb1-91e8fc1bd11f" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_LongTermDebtNoncurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_019fdcb7-c9c4-7a97-8e57-63bbfc5e2b1b" xlink:to="loc_us-gaap_LongTermDebtNoncurrent_019fdcb7-c9c4-735e-beb1-91e8fc1bd11f" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentInterestRateStatedPercentage_019fdcb7-c9c4-7cf5-8d6a-b7e05f9390b8" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DebtInstrumentInterestRateStatedPercentage"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_019fdcb7-c9c4-7a97-8e57-63bbfc5e2b1b" xlink:to="loc_us-gaap_DebtInstrumentInterestRateStatedPercentage_019fdcb7-c9c4-7cf5-8d6a-b7e05f9390b8" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RepaymentsOfLongTermDebt_01a15ad8-d562-704e-b22f-9ec062539115" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RepaymentsOfLongTermDebt"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_019fdcb7-c9c4-7a97-8e57-63bbfc5e2b1b" xlink:to="loc_us-gaap_RepaymentsOfLongTermDebt_01a15ad8-d562-704e-b22f-9ec062539115" xlink:type="arc" order="6"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/DERIVATIVEINSTRUMENTSNARRATIVEDetails" xlink:type="simple" xlink:href="hsy-20260927.xsd#DERIVATIVEINSTRUMENTSNARRATIVEDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/DERIVATIVEINSTRUMENTSNARRATIVEDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeLineItems_019fdcb7-c9c4-77bf-b292-08573929a413" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DerivativeLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeTable_019fdcb7-c9c4-7f23-a508-eb3f9c73c496" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DerivativeTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_DerivativeLineItems_019fdcb7-c9c4-77bf-b292-08573929a413" xlink:to="loc_us-gaap_DerivativeTable_019fdcb7-c9c4-7f23-a508-eb3f9c73c496" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeInstrumentRiskAxis_019fdcb7-c9c4-73c3-89f5-37f1424ef89a" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DerivativeInstrumentRiskAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DerivativeTable_019fdcb7-c9c4-7f23-a508-eb3f9c73c496" xlink:to="loc_us-gaap_DerivativeInstrumentRiskAxis_019fdcb7-c9c4-73c3-89f5-37f1424ef89a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_019fdcb7-c9c4-73c3-89f5-37f1424ef89a_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DerivativeContractTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_019fdcb7-c9c4-73c3-89f5-37f1424ef89a" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_019fdcb7-c9c4-73c3-89f5-37f1424ef89a_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_019fdcb7-c9c4-7eac-962f-572e0afb7b16" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DerivativeContractTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_019fdcb7-c9c4-73c3-89f5-37f1424ef89a" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_019fdcb7-c9c4-7eac-962f-572e0afb7b16" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommodityContractMember_019fdcb7-c9c4-7681-87dc-4da9f041eed9" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CommodityContractMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_019fdcb7-c9c4-7eac-962f-572e0afb7b16" xlink:to="loc_us-gaap_CommodityContractMember_019fdcb7-c9c4-7681-87dc-4da9f041eed9" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ForeignExchangeContractMember_019fdcb7-c9c4-7a28-a39b-b2f5e8f599bd" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ForeignExchangeContractMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_019fdcb7-c9c4-7eac-962f-572e0afb7b16" xlink:to="loc_us-gaap_ForeignExchangeContractMember_019fdcb7-c9c4-7a28-a39b-b2f5e8f599bd" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquitySwapMember_019fdcb7-c9c4-785c-b573-2bfaaa65d0e3" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_EquitySwapMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_019fdcb7-c9c4-7eac-962f-572e0afb7b16" xlink:to="loc_us-gaap_EquitySwapMember_019fdcb7-c9c4-785c-b573-2bfaaa65d0e3" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationAxis_019fdcb7-c9c4-7fe9-a1eb-823a047828bf" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_HedgingDesignationAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DerivativeTable_019fdcb7-c9c4-7f23-a508-eb3f9c73c496" xlink:to="loc_us-gaap_HedgingDesignationAxis_019fdcb7-c9c4-7fe9-a1eb-823a047828bf" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationDomain_019fdcb7-c9c4-7fe9-a1eb-823a047828bf_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_HedgingDesignationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_HedgingDesignationAxis_019fdcb7-c9c4-7fe9-a1eb-823a047828bf" xlink:to="loc_us-gaap_HedgingDesignationDomain_019fdcb7-c9c4-7fe9-a1eb-823a047828bf_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationDomain_019fdcb7-c9c4-7940-888d-73ad14edb64f" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_HedgingDesignationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_HedgingDesignationAxis_019fdcb7-c9c4-7fe9-a1eb-823a047828bf" xlink:to="loc_us-gaap_HedgingDesignationDomain_019fdcb7-c9c4-7940-888d-73ad14edb64f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NondesignatedMember_019fdcb7-c9c4-782b-a252-881cb06b3656" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_NondesignatedMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_HedgingDesignationDomain_019fdcb7-c9c4-7940-888d-73ad14edb64f" xlink:to="loc_us-gaap_NondesignatedMember_019fdcb7-c9c4-782b-a252-881cb06b3656" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DesignatedAsHedgingInstrumentMember_019fdcb7-c9c4-725c-b0a6-9b021eb50435" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DesignatedAsHedgingInstrumentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_HedgingDesignationDomain_019fdcb7-c9c4-7940-888d-73ad14edb64f" xlink:to="loc_us-gaap_DesignatedAsHedgingInstrumentMember_019fdcb7-c9c4-725c-b0a6-9b021eb50435" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_019fdcb7-c9c4-7633-a680-e2f6e252e06a" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DerivativeTable_019fdcb7-c9c4-7f23-a508-eb3f9c73c496" xlink:to="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_019fdcb7-c9c4-7633-a680-e2f6e252e06a" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingRelationshipDomain_019fdcb7-c9c4-7633-a680-e2f6e252e06a_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_HedgingRelationshipDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_019fdcb7-c9c4-7633-a680-e2f6e252e06a" xlink:to="loc_us-gaap_HedgingRelationshipDomain_019fdcb7-c9c4-7633-a680-e2f6e252e06a_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingRelationshipDomain_019fdcb7-c9c4-7039-9113-216744247d1b" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_HedgingRelationshipDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_019fdcb7-c9c4-7633-a680-e2f6e252e06a" xlink:to="loc_us-gaap_HedgingRelationshipDomain_019fdcb7-c9c4-7039-9113-216744247d1b" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashFlowHedgingMember_019fdcb7-c9c4-7fb4-b418-212cca5026a8" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CashFlowHedgingMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_HedgingRelationshipDomain_019fdcb7-c9c4-7039-9113-216744247d1b" xlink:to="loc_us-gaap_CashFlowHedgingMember_019fdcb7-c9c4-7fb4-b418-212cca5026a8" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeAxis_019fdcb7-c9c4-7129-95d7-61341b3dd8a4" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_RangeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DerivativeTable_019fdcb7-c9c4-7f23-a508-eb3f9c73c496" xlink:to="loc_srt_RangeAxis_019fdcb7-c9c4-7129-95d7-61341b3dd8a4" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_019fdcb7-c9c4-7129-95d7-61341b3dd8a4_default" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_RangeAxis_019fdcb7-c9c4-7129-95d7-61341b3dd8a4" xlink:to="loc_srt_RangeMember_019fdcb7-c9c4-7129-95d7-61341b3dd8a4_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_019fdcb7-c9c4-7cfe-8ba1-910bc65d586f" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_RangeAxis_019fdcb7-c9c4-7129-95d7-61341b3dd8a4" xlink:to="loc_srt_RangeMember_019fdcb7-c9c4-7cfe-8ba1-910bc65d586f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MinimumMember_019fdcb7-c9c4-72c5-bb4f-e490a6bd5e1d" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_MinimumMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_019fdcb7-c9c4-7cfe-8ba1-910bc65d586f" xlink:to="loc_srt_MinimumMember_019fdcb7-c9c4-72c5-bb4f-e490a6bd5e1d" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MaximumMember_019fdcb7-c9c4-7a3c-84fb-eeed29672c42" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_MaximumMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_019fdcb7-c9c4-7cfe-8ba1-910bc65d586f" xlink:to="loc_srt_MaximumMember_019fdcb7-c9c4-7a3c-84fb-eeed29672c42" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeTermOfContract_019fdcb7-c9c4-7a05-8454-f21eb340500d" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DerivativeTermOfContract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeLineItems_019fdcb7-c9c4-77bf-b292-08573929a413" xlink:to="loc_us-gaap_DerivativeTermOfContract_019fdcb7-c9c4-7a05-8454-f21eb340500d" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeNotionalAmount_019fdcb7-c9c4-7102-837d-afddba778dc5" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DerivativeNotionalAmount"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeLineItems_019fdcb7-c9c4-77bf-b292-08573929a413" xlink:to="loc_us-gaap_DerivativeNotionalAmount_019fdcb7-c9c4-7102-837d-afddba778dc5" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_MinimumLengthofTimeHedgedinCashFlowHedge_019fdcb7-c9c4-7964-90cb-e226521f35d9" xlink:href="hsy-20260927.xsd#hsy_MinimumLengthofTimeHedgedinCashFlowHedge"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeLineItems_019fdcb7-c9c4-77bf-b292-08573929a413" xlink:to="loc_hsy_MinimumLengthofTimeHedgedinCashFlowHedge_019fdcb7-c9c4-7964-90cb-e226521f35d9" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_MaximumLengthOfTimeHedgedInCashFlowHedge1_019fdcb7-c9c4-7ddd-828d-eebe94c28e63" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_MaximumLengthOfTimeHedgedInCashFlowHedge1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeLineItems_019fdcb7-c9c4-77bf-b292-08573929a413" xlink:to="loc_us-gaap_MaximumLengthOfTimeHedgedInCashFlowHedge1_019fdcb7-c9c4-7ddd-828d-eebe94c28e63" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashFlowHedgeGainLossToBeReclassifiedWithinTwelveMonths_019fdcb7-c9c4-736f-96ea-18c54257bd3f" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CashFlowHedgeGainLossToBeReclassifiedWithinTwelveMonths"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeLineItems_019fdcb7-c9c4-77bf-b292-08573929a413" xlink:to="loc_us-gaap_CashFlowHedgeGainLossToBeReclassifiedWithinTwelveMonths_019fdcb7-c9c4-736f-96ea-18c54257bd3f" xlink:type="arc" order="4"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/DERIVATIVEINSTRUMENTSSCHEDULEOFTHECLASSIFICATIONOFDERIVATIVEASSETSANDLIABILITIESWITHINTHECONSOLIDATEDBALANCESHEETSDetails" xlink:type="simple" xlink:href="hsy-20260927.xsd#DERIVATIVEINSTRUMENTSSCHEDULEOFTHECLASSIFICATIONOFDERIVATIVEASSETSANDLIABILITIESWITHINTHECONSOLIDATEDBALANCESHEETSDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/DERIVATIVEINSTRUMENTSSCHEDULEOFTHECLASSIFICATIONOFDERIVATIVEASSETSANDLIABILITIESWITHINTHECONSOLIDATEDBALANCESHEETSDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativesFairValueLineItems_019fdcb7-c9c4-7d55-b747-1b413968c626" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DerivativesFairValueLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable_019fdcb7-c9c4-7768-914f-996a0ca7faf0" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_019fdcb7-c9c4-7d55-b747-1b413968c626" xlink:to="loc_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable_019fdcb7-c9c4-7768-914f-996a0ca7faf0" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationAxis_019fdcb7-c9c4-785c-b969-06ebd5bcdd78" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_HedgingDesignationAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable_019fdcb7-c9c4-7768-914f-996a0ca7faf0" xlink:to="loc_us-gaap_HedgingDesignationAxis_019fdcb7-c9c4-785c-b969-06ebd5bcdd78" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationDomain_019fdcb7-c9c4-785c-b969-06ebd5bcdd78_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_HedgingDesignationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_HedgingDesignationAxis_019fdcb7-c9c4-785c-b969-06ebd5bcdd78" xlink:to="loc_us-gaap_HedgingDesignationDomain_019fdcb7-c9c4-785c-b969-06ebd5bcdd78_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationDomain_019fdcb7-c9c4-7340-9a2b-0654714275f4" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_HedgingDesignationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_HedgingDesignationAxis_019fdcb7-c9c4-785c-b969-06ebd5bcdd78" xlink:to="loc_us-gaap_HedgingDesignationDomain_019fdcb7-c9c4-7340-9a2b-0654714275f4" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DesignatedAsHedgingInstrumentMember_019fdcb7-c9c4-719c-954d-1025a1c02f74" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DesignatedAsHedgingInstrumentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_HedgingDesignationDomain_019fdcb7-c9c4-7340-9a2b-0654714275f4" xlink:to="loc_us-gaap_DesignatedAsHedgingInstrumentMember_019fdcb7-c9c4-719c-954d-1025a1c02f74" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NondesignatedMember_019fdcb7-c9c4-77a4-99bd-ab6bd6523dfd" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_NondesignatedMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_HedgingDesignationDomain_019fdcb7-c9c4-7340-9a2b-0654714275f4" xlink:to="loc_us-gaap_NondesignatedMember_019fdcb7-c9c4-77a4-99bd-ab6bd6523dfd" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_019fdcb7-c9c4-7a50-81b8-cf5e6aa435da" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable_019fdcb7-c9c4-7768-914f-996a0ca7faf0" xlink:to="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_019fdcb7-c9c4-7a50-81b8-cf5e6aa435da" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingRelationshipDomain_019fdcb7-c9c4-7a50-81b8-cf5e6aa435da_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_HedgingRelationshipDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_019fdcb7-c9c4-7a50-81b8-cf5e6aa435da" xlink:to="loc_us-gaap_HedgingRelationshipDomain_019fdcb7-c9c4-7a50-81b8-cf5e6aa435da_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingRelationshipDomain_019fdcb7-c9c4-7c91-a056-9dfabd397e46" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_HedgingRelationshipDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_019fdcb7-c9c4-7a50-81b8-cf5e6aa435da" xlink:to="loc_us-gaap_HedgingRelationshipDomain_019fdcb7-c9c4-7c91-a056-9dfabd397e46" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashFlowHedgingMember_019fdcb7-c9c4-740f-aa34-c2ad37c212d5" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CashFlowHedgingMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_HedgingRelationshipDomain_019fdcb7-c9c4-7c91-a056-9dfabd397e46" xlink:to="loc_us-gaap_CashFlowHedgingMember_019fdcb7-c9c4-740f-aa34-c2ad37c212d5" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeInstrumentRiskAxis_019fdcb7-c9c4-7507-a56c-544e09bf09a6" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DerivativeInstrumentRiskAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable_019fdcb7-c9c4-7768-914f-996a0ca7faf0" xlink:to="loc_us-gaap_DerivativeInstrumentRiskAxis_019fdcb7-c9c4-7507-a56c-544e09bf09a6" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_019fdcb7-c9c4-7507-a56c-544e09bf09a6_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DerivativeContractTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_019fdcb7-c9c4-7507-a56c-544e09bf09a6" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_019fdcb7-c9c4-7507-a56c-544e09bf09a6_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_019fdcb7-c9c4-7167-a267-475ff9c31255" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DerivativeContractTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_019fdcb7-c9c4-7507-a56c-544e09bf09a6" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_019fdcb7-c9c4-7167-a267-475ff9c31255" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ForeignExchangeContractMember_019fdcb7-c9c4-7516-904a-6ce6012946ab" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ForeignExchangeContractMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_019fdcb7-c9c4-7167-a267-475ff9c31255" xlink:to="loc_us-gaap_ForeignExchangeContractMember_019fdcb7-c9c4-7516-904a-6ce6012946ab" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommodityContractMember_019fdcb7-c9c4-7c7f-83ca-299b16ecfd89" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CommodityContractMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_019fdcb7-c9c4-7167-a267-475ff9c31255" xlink:to="loc_us-gaap_CommodityContractMember_019fdcb7-c9c4-7c7f-83ca-299b16ecfd89" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquitySwapMember_019fdcb7-c9c4-7bdb-bd6a-433728ba75bc" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_EquitySwapMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_019fdcb7-c9c4-7167-a267-475ff9c31255" xlink:to="loc_us-gaap_EquitySwapMember_019fdcb7-c9c4-7bdb-bd6a-433728ba75bc" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeAssets_019fdcb7-c9c4-71f4-a191-80e703700258" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DerivativeAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_019fdcb7-c9c4-7d55-b747-1b413968c626" xlink:to="loc_us-gaap_DerivativeAssets_019fdcb7-c9c4-71f4-a191-80e703700258" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeLiabilities_019fdcb7-c9c4-71fc-be87-b2fe1cd26e30" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DerivativeLiabilities"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_019fdcb7-c9c4-7d55-b747-1b413968c626" xlink:to="loc_us-gaap_DerivativeLiabilities_019fdcb7-c9c4-71fc-be87-b2fe1cd26e30" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_DerivativeAssetCashTransfersReceivablePayableChangeInQuotedMarketPricesOnTheLastDayOfTrading_019fdcb7-c9c4-7cd9-b42c-8de50f94322c" xlink:href="hsy-20260927.xsd#hsy_DerivativeAssetCashTransfersReceivablePayableChangeInQuotedMarketPricesOnTheLastDayOfTrading"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_019fdcb7-c9c4-7d55-b747-1b413968c626" xlink:to="loc_hsy_DerivativeAssetCashTransfersReceivablePayableChangeInQuotedMarketPricesOnTheLastDayOfTrading_019fdcb7-c9c4-7cd9-b42c-8de50f94322c" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_DerivativeLiabilityCashTransfersReceivablePayableChangeInQuotedMarketPricesOnTheLastDayOfTrading_019fdcb7-c9c4-70dd-b07b-26b99519b1fa" xlink:href="hsy-20260927.xsd#hsy_DerivativeLiabilityCashTransfersReceivablePayableChangeInQuotedMarketPricesOnTheLastDayOfTrading"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_019fdcb7-c9c4-7d55-b747-1b413968c626" xlink:to="loc_hsy_DerivativeLiabilityCashTransfersReceivablePayableChangeInQuotedMarketPricesOnTheLastDayOfTrading_019fdcb7-c9c4-70dd-b07b-26b99519b1fa" xlink:type="arc" order="3"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/DERIVATIVEINSTRUMENTSSCHEDULEOFTHEEFFECTOFDERIVATIVEINSTRUMENTSONTHECONSOLIDATEDSTATEMENTSOFINCOMEDetails" xlink:type="simple" xlink:href="hsy-20260927.xsd#DERIVATIVEINSTRUMENTSSCHEDULEOFTHEEFFECTOFDERIVATIVEINSTRUMENTSONTHECONSOLIDATEDSTATEMENTSOFINCOMEDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/DERIVATIVEINSTRUMENTSSCHEDULEOFTHEEFFECTOFDERIVATIVEINSTRUMENTSONTHECONSOLIDATEDSTATEMENTSOFINCOMEDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeLineItems_019fdcb7-c9c4-7629-a574-b2566933b633" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DerivativeLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeTable_019fdcb7-c9c4-7725-b716-9f3612cb7616" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DerivativeTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_DerivativeLineItems_019fdcb7-c9c4-7629-a574-b2566933b633" xlink:to="loc_us-gaap_DerivativeTable_019fdcb7-c9c4-7725-b716-9f3612cb7616" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationAxis_019fdcb7-c9c4-70a8-8931-1f9a5d32273d" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_HedgingDesignationAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DerivativeTable_019fdcb7-c9c4-7725-b716-9f3612cb7616" xlink:to="loc_us-gaap_HedgingDesignationAxis_019fdcb7-c9c4-70a8-8931-1f9a5d32273d" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationDomain_019fdcb7-c9c4-70a8-8931-1f9a5d32273d_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_HedgingDesignationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_HedgingDesignationAxis_019fdcb7-c9c4-70a8-8931-1f9a5d32273d" xlink:to="loc_us-gaap_HedgingDesignationDomain_019fdcb7-c9c4-70a8-8931-1f9a5d32273d_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationDomain_019fdcb7-c9c4-7b61-af64-a454def5da1c" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_HedgingDesignationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_HedgingDesignationAxis_019fdcb7-c9c4-70a8-8931-1f9a5d32273d" xlink:to="loc_us-gaap_HedgingDesignationDomain_019fdcb7-c9c4-7b61-af64-a454def5da1c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DesignatedAsHedgingInstrumentMember_019fdcb7-c9c4-798a-879a-e5cbe70ff24b" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DesignatedAsHedgingInstrumentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_HedgingDesignationDomain_019fdcb7-c9c4-7b61-af64-a454def5da1c" xlink:to="loc_us-gaap_DesignatedAsHedgingInstrumentMember_019fdcb7-c9c4-798a-879a-e5cbe70ff24b" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_019fdcb7-c9c4-74de-b874-8620200fec67" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DerivativeTable_019fdcb7-c9c4-7725-b716-9f3612cb7616" xlink:to="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_019fdcb7-c9c4-74de-b874-8620200fec67" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingRelationshipDomain_019fdcb7-c9c4-74de-b874-8620200fec67_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_HedgingRelationshipDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_019fdcb7-c9c4-74de-b874-8620200fec67" xlink:to="loc_us-gaap_HedgingRelationshipDomain_019fdcb7-c9c4-74de-b874-8620200fec67_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingRelationshipDomain_019fdcb7-c9c4-724b-aad8-555ad4ee7820" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_HedgingRelationshipDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_019fdcb7-c9c4-74de-b874-8620200fec67" xlink:to="loc_us-gaap_HedgingRelationshipDomain_019fdcb7-c9c4-724b-aad8-555ad4ee7820" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashFlowHedgingMember_019fdcb7-c9c4-736f-a107-80692455f846" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CashFlowHedgingMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_HedgingRelationshipDomain_019fdcb7-c9c4-724b-aad8-555ad4ee7820" xlink:to="loc_us-gaap_CashFlowHedgingMember_019fdcb7-c9c4-736f-a107-80692455f846" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeInstrumentRiskAxis_019fdcb7-c9c4-7e9c-8bd4-eea71a2682d0" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DerivativeInstrumentRiskAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DerivativeTable_019fdcb7-c9c4-7725-b716-9f3612cb7616" xlink:to="loc_us-gaap_DerivativeInstrumentRiskAxis_019fdcb7-c9c4-7e9c-8bd4-eea71a2682d0" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_019fdcb7-c9c4-7e9c-8bd4-eea71a2682d0_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DerivativeContractTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_019fdcb7-c9c4-7e9c-8bd4-eea71a2682d0" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_019fdcb7-c9c4-7e9c-8bd4-eea71a2682d0_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_019fdcb7-c9c4-7a99-85ef-b884bb6bdc7e" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DerivativeContractTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_019fdcb7-c9c4-7e9c-8bd4-eea71a2682d0" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_019fdcb7-c9c4-7a99-85ef-b884bb6bdc7e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommodityContractMember_019fdcb7-c9c4-7260-bd84-d32285b8559a" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CommodityContractMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_019fdcb7-c9c4-7a99-85ef-b884bb6bdc7e" xlink:to="loc_us-gaap_CommodityContractMember_019fdcb7-c9c4-7260-bd84-d32285b8559a" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ForeignExchangeContractMember_019fdcb7-c9c4-7b71-a3c6-35b7bbf57a7b" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ForeignExchangeContractMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_019fdcb7-c9c4-7a99-85ef-b884bb6bdc7e" xlink:to="loc_us-gaap_ForeignExchangeContractMember_019fdcb7-c9c4-7b71-a3c6-35b7bbf57a7b" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InterestRateContractMember_019fdcb7-c9c4-79a4-8d84-8d416762ccf1" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_InterestRateContractMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_019fdcb7-c9c4-7a99-85ef-b884bb6bdc7e" xlink:to="loc_us-gaap_InterestRateContractMember_019fdcb7-c9c4-79a4-8d84-8d416762ccf1" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquitySwapMember_019fdcb7-c9c4-7718-be52-d68e91e4cefa" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_EquitySwapMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_019fdcb7-c9c4-7a99-85ef-b884bb6bdc7e" xlink:to="loc_us-gaap_EquitySwapMember_019fdcb7-c9c4-7718-be52-d68e91e4cefa" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeInstrumentsNotDesignatedAsHedgingInstrumentsGainLossNet_019fdcb7-c9c4-7f26-a4cf-0a518f57741c" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DerivativeInstrumentsNotDesignatedAsHedgingInstrumentsGainLossNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeLineItems_019fdcb7-c9c4-7629-a574-b2566933b633" xlink:to="loc_us-gaap_DerivativeInstrumentsNotDesignatedAsHedgingInstrumentsGainLossNet_019fdcb7-c9c4-7f26-a4cf-0a518f57741c" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossCashFlowHedgeGainLossBeforeReclassificationAndTax_019fdcb7-c9c4-764b-8dc9-e127dc3a8ce1" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OtherComprehensiveIncomeLossCashFlowHedgeGainLossBeforeReclassificationAndTax"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeLineItems_019fdcb7-c9c4-7629-a574-b2566933b633" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossCashFlowHedgeGainLossBeforeReclassificationAndTax_019fdcb7-c9c4-764b-8dc9-e127dc3a8ce1" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ReclassificationFromAccumulatedOtherComprehensiveIncomeCurrentPeriodBeforeTax_019fdcb7-c9c4-78e8-ad1f-37c57a36654f" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ReclassificationFromAccumulatedOtherComprehensiveIncomeCurrentPeriodBeforeTax"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeLineItems_019fdcb7-c9c4-7629-a574-b2566933b633" xlink:to="loc_us-gaap_ReclassificationFromAccumulatedOtherComprehensiveIncomeCurrentPeriodBeforeTax_019fdcb7-c9c4-78e8-ad1f-37c57a36654f" xlink:type="arc" order="2"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/FAIRVALUEMEASUREMENTSNARRATIVEDetails" xlink:type="simple" xlink:href="hsy-20260927.xsd#FAIRVALUEMEASUREMENTSNARRATIVEDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/FAIRVALUEMEASUREMENTSNARRATIVEDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueBalanceSheetGroupingFinancialStatementCaptionsLineItems_019fdcb7-c9c4-75b4-b0d3-cc28f45b6e70" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FairValueBalanceSheetGroupingFinancialStatementCaptionsLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueByBalanceSheetGroupingTable_019fdcb7-c9c4-7f94-a354-942ba7c38106" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FairValueByBalanceSheetGroupingTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_FairValueBalanceSheetGroupingFinancialStatementCaptionsLineItems_019fdcb7-c9c4-75b4-b0d3-cc28f45b6e70" xlink:to="loc_us-gaap_FairValueByBalanceSheetGroupingTable_019fdcb7-c9c4-7f94-a354-942ba7c38106" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_019fdcb7-c9c4-7a74-9746-32c98c6de5c1" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FairValueByFairValueHierarchyLevelAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueByBalanceSheetGroupingTable_019fdcb7-c9c4-7f94-a354-942ba7c38106" xlink:to="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_019fdcb7-c9c4-7a74-9746-32c98c6de5c1" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_019fdcb7-c9c4-7a74-9746-32c98c6de5c1_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FairValueMeasurementsFairValueHierarchyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_019fdcb7-c9c4-7a74-9746-32c98c6de5c1" xlink:to="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_019fdcb7-c9c4-7a74-9746-32c98c6de5c1_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_019fdcb7-c9c4-73ce-a46d-86f9fc62bb49" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FairValueMeasurementsFairValueHierarchyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_019fdcb7-c9c4-7a74-9746-32c98c6de5c1" xlink:to="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_019fdcb7-c9c4-73ce-a46d-86f9fc62bb49" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueInputsLevel3Member_019fdcb7-c9c4-7447-866d-e59636e890b3" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FairValueInputsLevel3Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_019fdcb7-c9c4-73ce-a46d-86f9fc62bb49" xlink:to="loc_us-gaap_FairValueInputsLevel3Member_019fdcb7-c9c4-7447-866d-e59636e890b3" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueNetAssetLiability_019fdcb7-c9c4-7477-a175-029196ba8f9f" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FairValueNetAssetLiability"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueBalanceSheetGroupingFinancialStatementCaptionsLineItems_019fdcb7-c9c4-75b4-b0d3-cc28f45b6e70" xlink:to="loc_us-gaap_FairValueNetAssetLiability_019fdcb7-c9c4-7477-a175-029196ba8f9f" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/FAIRVALUEMEASUREMENTSSCHEDULEOFASSETSANDLIABILITIESMEASUREDATFAIRVALUEDetails" xlink:type="simple" xlink:href="hsy-20260927.xsd#FAIRVALUEMEASUREMENTSSCHEDULEOFASSETSANDLIABILITIESMEASUREDATFAIRVALUEDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/FAIRVALUEMEASUREMENTSSCHEDULEOFASSETSANDLIABILITIESMEASUREDATFAIRVALUEDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueBalanceSheetGroupingFinancialStatementCaptionsLineItems_019fdcb7-c9c4-7cd2-80ba-ae9920999a22" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FairValueBalanceSheetGroupingFinancialStatementCaptionsLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueByBalanceSheetGroupingTable_019fdcb7-c9c4-7569-bbbf-c8004e98e8ed" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FairValueByBalanceSheetGroupingTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_FairValueBalanceSheetGroupingFinancialStatementCaptionsLineItems_019fdcb7-c9c4-7cd2-80ba-ae9920999a22" xlink:to="loc_us-gaap_FairValueByBalanceSheetGroupingTable_019fdcb7-c9c4-7569-bbbf-c8004e98e8ed" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeInstrumentRiskAxis_019fdcb7-c9c4-7904-8ced-de6db878fe1f" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DerivativeInstrumentRiskAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueByBalanceSheetGroupingTable_019fdcb7-c9c4-7569-bbbf-c8004e98e8ed" xlink:to="loc_us-gaap_DerivativeInstrumentRiskAxis_019fdcb7-c9c4-7904-8ced-de6db878fe1f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_019fdcb7-c9c4-7904-8ced-de6db878fe1f_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DerivativeContractTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_019fdcb7-c9c4-7904-8ced-de6db878fe1f" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_019fdcb7-c9c4-7904-8ced-de6db878fe1f_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_019fdcb7-c9c4-71ff-9416-dcb52158615e" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DerivativeContractTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_019fdcb7-c9c4-7904-8ced-de6db878fe1f" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_019fdcb7-c9c4-71ff-9416-dcb52158615e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ForeignExchangeContractMember_019fdcb7-c9c4-7d36-910c-9c33c77a291e" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ForeignExchangeContractMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_019fdcb7-c9c4-71ff-9416-dcb52158615e" xlink:to="loc_us-gaap_ForeignExchangeContractMember_019fdcb7-c9c4-7d36-910c-9c33c77a291e" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquitySwapMember_019fdcb7-c9c4-7eee-b86f-4ac99c2505df" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_EquitySwapMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_019fdcb7-c9c4-71ff-9416-dcb52158615e" xlink:to="loc_us-gaap_EquitySwapMember_019fdcb7-c9c4-7eee-b86f-4ac99c2505df" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommodityContractMember_019fdcb7-c9c4-7c99-9f4d-b43d9e299a89" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CommodityContractMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_019fdcb7-c9c4-71ff-9416-dcb52158615e" xlink:to="loc_us-gaap_CommodityContractMember_019fdcb7-c9c4-7c99-9f4d-b43d9e299a89" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_019fdcb7-c9c4-745f-a6ac-ab7aa2887607" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FairValueByFairValueHierarchyLevelAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueByBalanceSheetGroupingTable_019fdcb7-c9c4-7569-bbbf-c8004e98e8ed" xlink:to="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_019fdcb7-c9c4-745f-a6ac-ab7aa2887607" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_019fdcb7-c9c4-745f-a6ac-ab7aa2887607_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FairValueMeasurementsFairValueHierarchyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_019fdcb7-c9c4-745f-a6ac-ab7aa2887607" xlink:to="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_019fdcb7-c9c4-745f-a6ac-ab7aa2887607_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_019fdcb7-c9c4-7ad8-a36b-99c745196232" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FairValueMeasurementsFairValueHierarchyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_019fdcb7-c9c4-745f-a6ac-ab7aa2887607" xlink:to="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_019fdcb7-c9c4-7ad8-a36b-99c745196232" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueInputsLevel1Member_019fdcb7-c9c4-7c09-947e-409f86fc9b6a" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FairValueInputsLevel1Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_019fdcb7-c9c4-7ad8-a36b-99c745196232" xlink:to="loc_us-gaap_FairValueInputsLevel1Member_019fdcb7-c9c4-7c09-947e-409f86fc9b6a" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueInputsLevel2Member_019fdcb7-c9c4-7b26-82bc-3b672dbdc967" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FairValueInputsLevel2Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_019fdcb7-c9c4-7ad8-a36b-99c745196232" xlink:to="loc_us-gaap_FairValueInputsLevel2Member_019fdcb7-c9c4-7b26-82bc-3b672dbdc967" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueInputsLevel3Member_019fdcb7-c9c4-7ed8-b7b0-24f8ab8ed115" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FairValueInputsLevel3Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_019fdcb7-c9c4-7ad8-a36b-99c745196232" xlink:to="loc_us-gaap_FairValueInputsLevel3Member_019fdcb7-c9c4-7ed8-b7b0-24f8ab8ed115" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeAssets_019fdcb7-c9c4-7fa8-bb21-373495fc817b" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DerivativeAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueBalanceSheetGroupingFinancialStatementCaptionsLineItems_019fdcb7-c9c4-7cd2-80ba-ae9920999a22" xlink:to="loc_us-gaap_DerivativeAssets_019fdcb7-c9c4-7fa8-bb21-373495fc817b" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeLiabilities_019fdcb7-c9c4-7110-b593-3684e05c82a3" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DerivativeLiabilities"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueBalanceSheetGroupingFinancialStatementCaptionsLineItems_019fdcb7-c9c4-7cd2-80ba-ae9920999a22" xlink:to="loc_us-gaap_DerivativeLiabilities_019fdcb7-c9c4-7110-b593-3684e05c82a3" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/FAIRVALUEMEASUREMENTSSCHEDULEOFFAIRVALUESANDCARRYINGVALUESOFLONGTERMDEBTDetails" xlink:type="simple" xlink:href="hsy-20260927.xsd#FAIRVALUEMEASUREMENTSSCHEDULEOFFAIRVALUESANDCARRYINGVALUESOFLONGTERMDEBTDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/FAIRVALUEMEASUREMENTSSCHEDULEOFFAIRVALUESANDCARRYINGVALUESOFLONGTERMDEBTDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_019fdcb7-c9c4-71c6-a757-7c8623c33fb0" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_019fdcb7-c9c4-70ad-95e3-b42d0b7c313b" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_019fdcb7-c9c4-71c6-a757-7c8623c33fb0" xlink:to="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_019fdcb7-c9c4-70ad-95e3-b42d0b7c313b" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_019fdcb7-c9c4-77b7-82eb-90a089fec37c" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FairValueByFairValueHierarchyLevelAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_019fdcb7-c9c4-70ad-95e3-b42d0b7c313b" xlink:to="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_019fdcb7-c9c4-77b7-82eb-90a089fec37c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_019fdcb7-c9c4-77b7-82eb-90a089fec37c_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FairValueMeasurementsFairValueHierarchyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_019fdcb7-c9c4-77b7-82eb-90a089fec37c" xlink:to="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_019fdcb7-c9c4-77b7-82eb-90a089fec37c_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_019fdcb7-c9c4-7cca-88c3-44db7440ee0c" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FairValueMeasurementsFairValueHierarchyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_019fdcb7-c9c4-77b7-82eb-90a089fec37c" xlink:to="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_019fdcb7-c9c4-7cca-88c3-44db7440ee0c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueInputsLevel2Member_019fdcb7-c9c4-707b-b90d-de0107e20e7e" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FairValueInputsLevel2Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_019fdcb7-c9c4-7cca-88c3-44db7440ee0c" xlink:to="loc_us-gaap_FairValueInputsLevel2Member_019fdcb7-c9c4-707b-b90d-de0107e20e7e" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_LongtermDebtCurrentMaturitiesFairValue_019fdcb7-c9c4-7121-b42d-1fca246d0a99" xlink:href="hsy-20260927.xsd#hsy_LongtermDebtCurrentMaturitiesFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_019fdcb7-c9c4-71c6-a757-7c8623c33fb0" xlink:to="loc_hsy_LongtermDebtCurrentMaturitiesFairValue_019fdcb7-c9c4-7121-b42d-1fca246d0a99" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_LongtermDebtExcludingCurrentMaturitiesFairValue_019fdcb7-c9c4-7ad3-a74c-9ac1ca1696ef" xlink:href="hsy-20260927.xsd#hsy_LongtermDebtExcludingCurrentMaturitiesFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_019fdcb7-c9c4-71c6-a757-7c8623c33fb0" xlink:to="loc_hsy_LongtermDebtExcludingCurrentMaturitiesFairValue_019fdcb7-c9c4-7ad3-a74c-9ac1ca1696ef" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongTermDebtFairValue_019fdcb7-c9c4-7ac1-abec-b956a180ccd8" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_LongTermDebtFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_019fdcb7-c9c4-71c6-a757-7c8623c33fb0" xlink:to="loc_us-gaap_LongTermDebtFairValue_019fdcb7-c9c4-7ac1-abec-b956a180ccd8" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongTermDebtCurrent_019fdcb7-c9c4-7fcd-8b55-ab3de34c9000" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_LongTermDebtCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_019fdcb7-c9c4-71c6-a757-7c8623c33fb0" xlink:to="loc_us-gaap_LongTermDebtCurrent_019fdcb7-c9c4-7fcd-8b55-ab3de34c9000" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongTermDebtNoncurrent_019fdcb7-c9c4-77f2-ab1a-703c3e71869b" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_LongTermDebtNoncurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_019fdcb7-c9c4-71c6-a757-7c8623c33fb0" xlink:to="loc_us-gaap_LongTermDebtNoncurrent_019fdcb7-c9c4-77f2-ab1a-703c3e71869b" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongTermDebt_019fdcb7-c9c4-78ae-882c-da5754ec5757" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_LongTermDebt"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_019fdcb7-c9c4-71c6-a757-7c8623c33fb0" xlink:to="loc_us-gaap_LongTermDebt_019fdcb7-c9c4-78ae-882c-da5754ec5757" xlink:type="arc" order="5"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/FAIRVALUEMEASUREMENTSSCHEDULEOFBUSINESSCOMBINATIONCONTINGENTCONSIDERATIONDetails" xlink:type="simple" xlink:href="hsy-20260927.xsd#FAIRVALUEMEASUREMENTSSCHEDULEOFBUSINESSCOMBINATIONCONTINGENTCONSIDERATIONDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/FAIRVALUEMEASUREMENTSSCHEDULEOFBUSINESSCOMBINATIONCONTINGENTCONSIDERATIONDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueBalanceSheetGroupingFinancialStatementCaptionsLineItems_01a16903-0be6-7083-a338-f23de72e24c9" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FairValueBalanceSheetGroupingFinancialStatementCaptionsLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueByBalanceSheetGroupingTable_01a16903-0be6-72c1-ae4c-51e22a076982" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FairValueByBalanceSheetGroupingTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_FairValueBalanceSheetGroupingFinancialStatementCaptionsLineItems_01a16903-0be6-7083-a338-f23de72e24c9" xlink:to="loc_us-gaap_FairValueByBalanceSheetGroupingTable_01a16903-0be6-72c1-ae4c-51e22a076982" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueByLiabilityClassAxis_01a16903-0be6-7fbc-a148-ebe07c21a72f" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FairValueByLiabilityClassAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueByBalanceSheetGroupingTable_01a16903-0be6-72c1-ae4c-51e22a076982" xlink:to="loc_us-gaap_FairValueByLiabilityClassAxis_01a16903-0be6-7fbc-a148-ebe07c21a72f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationByLiabilityClassDomain_01a16903-0be6-7fbc-a148-ebe07c21a72f_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationByLiabilityClassDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FairValueByLiabilityClassAxis_01a16903-0be6-7fbc-a148-ebe07c21a72f" xlink:to="loc_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationByLiabilityClassDomain_01a16903-0be6-7fbc-a148-ebe07c21a72f_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationByLiabilityClassDomain_01a16903-0be6-7e73-9490-9a0bdac5affe" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationByLiabilityClassDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FairValueByLiabilityClassAxis_01a16903-0be6-7fbc-a148-ebe07c21a72f" xlink:to="loc_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationByLiabilityClassDomain_01a16903-0be6-7e73-9490-9a0bdac5affe" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_ContingentConsiderationMember_01a16903-0be6-7eb2-8881-8eadce885cc3" xlink:href="hsy-20260927.xsd#hsy_ContingentConsiderationMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationByLiabilityClassDomain_01a16903-0be6-7e73-9490-9a0bdac5affe" xlink:to="loc_hsy_ContingentConsiderationMember_01a16903-0be6-7eb2-8881-8eadce885cc3" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementWithUnobservableInputsReconciliationsRecurringBasisLiabilityValue_01a16903-0be6-7310-9793-f27149370a9a" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FairValueMeasurementWithUnobservableInputsReconciliationsRecurringBasisLiabilityValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueBalanceSheetGroupingFinancialStatementCaptionsLineItems_01a16903-0be6-7083-a338-f23de72e24c9" xlink:to="loc_us-gaap_FairValueMeasurementWithUnobservableInputsReconciliationsRecurringBasisLiabilityValue_01a16903-0be6-7310-9793-f27149370a9a" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementWithUnobservableInputsReconciliationRecurringBasisLiabilityGainLossIncludedInEarnings_01a16903-0be6-7e50-b6aa-3710334ede8f" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FairValueMeasurementWithUnobservableInputsReconciliationRecurringBasisLiabilityGainLossIncludedInEarnings"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueBalanceSheetGroupingFinancialStatementCaptionsLineItems_01a16903-0be6-7083-a338-f23de72e24c9" xlink:to="loc_us-gaap_FairValueMeasurementWithUnobservableInputsReconciliationRecurringBasisLiabilityGainLossIncludedInEarnings_01a16903-0be6-7e50-b6aa-3710334ede8f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementWithUnobservableInputsReconciliationRecurringBasisLiabilityPeriodIncreaseDecrease_01a16903-0be6-742d-87c0-29d57237d810" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FairValueMeasurementWithUnobservableInputsReconciliationRecurringBasisLiabilityPeriodIncreaseDecrease"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueBalanceSheetGroupingFinancialStatementCaptionsLineItems_01a16903-0be6-7083-a338-f23de72e24c9" xlink:to="loc_us-gaap_FairValueMeasurementWithUnobservableInputsReconciliationRecurringBasisLiabilityPeriodIncreaseDecrease_01a16903-0be6-742d-87c0-29d57237d810" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementWithUnobservableInputsReconciliationsRecurringBasisLiabilityValue_01a16903-82bc-77a2-bd01-8915b14346cb" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FairValueMeasurementWithUnobservableInputsReconciliationsRecurringBasisLiabilityValue"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/LEASESSUPPLEMENTALBALANCESHEETINFORMATIONRELATEDTOLEASESDetails" xlink:type="simple" xlink:href="hsy-20260927.xsd#LEASESSUPPLEMENTALBALANCESHEETINFORMATIONRELATEDTOLEASESDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/LEASESSUPPLEMENTALBALANCESHEETINFORMATIONRELATEDTOLEASESDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeLeaseDescriptionLineItems_019fdcb7-c9c4-7e37-88a9-8a1d12c10515" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_LesseeLeaseDescriptionLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeLeaseDescriptionTable_019fdcb7-c9c4-7ccb-9182-8623f4797670" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_LesseeLeaseDescriptionTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_019fdcb7-c9c4-7e37-88a9-8a1d12c10515" xlink:to="loc_us-gaap_LesseeLeaseDescriptionTable_019fdcb7-c9c4-7ccb-9182-8623f4797670" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementOfFinancialPositionLocationBalanceAxis_019fdcb7-c9c4-75b1-82a5-556856660a61" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_StatementOfFinancialPositionLocationBalanceAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_LesseeLeaseDescriptionTable_019fdcb7-c9c4-7ccb-9182-8623f4797670" xlink:to="loc_us-gaap_StatementOfFinancialPositionLocationBalanceAxis_019fdcb7-c9c4-75b1-82a5-556856660a61" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLeaseRightOfUseAsset_019fdcb7-c9c4-7967-b4be-e2a20e31f1b4" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OperatingLeaseRightOfUseAsset"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_019fdcb7-c9c4-7e37-88a9-8a1d12c10515" xlink:to="loc_us-gaap_OperatingLeaseRightOfUseAsset_019fdcb7-c9c4-7967-b4be-e2a20e31f1b4" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinanceLeaseRightOfUseAssetBeforeAccumulatedAmortization_01a15af9-e44c-7fd0-b729-d04de142ed2e" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FinanceLeaseRightOfUseAssetBeforeAccumulatedAmortization"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_019fdcb7-c9c4-7e37-88a9-8a1d12c10515" xlink:to="loc_us-gaap_FinanceLeaseRightOfUseAssetBeforeAccumulatedAmortization_01a15af9-e44c-7fd0-b729-d04de142ed2e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinanceLeaseRightOfUseAssetAccumulatedAmortization_019fdcb7-c9c4-71e4-a27d-42688a90e935" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FinanceLeaseRightOfUseAssetAccumulatedAmortization"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_019fdcb7-c9c4-7e37-88a9-8a1d12c10515" xlink:to="loc_us-gaap_FinanceLeaseRightOfUseAssetAccumulatedAmortization_019fdcb7-c9c4-71e4-a27d-42688a90e935" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinanceLeaseRightOfUseAsset_019fdcb7-c9c4-72aa-ae5f-c82487c409ff" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FinanceLeaseRightOfUseAsset"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_019fdcb7-c9c4-7e37-88a9-8a1d12c10515" xlink:to="loc_us-gaap_FinanceLeaseRightOfUseAsset_019fdcb7-c9c4-72aa-ae5f-c82487c409ff" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinanceLeaseRightOfUseAssetStatementOfFinancialPositionExtensibleList_01a15af6-da8d-7b5d-aafb-9d0375a659e1" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FinanceLeaseRightOfUseAssetStatementOfFinancialPositionExtensibleList"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinanceLeaseRightOfUseAsset_019fdcb7-c9c4-72aa-ae5f-c82487c409ff" xlink:to="loc_us-gaap_FinanceLeaseRightOfUseAssetStatementOfFinancialPositionExtensibleList_01a15af6-da8d-7b5d-aafb-9d0375a659e1" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_LeaseRightofUseAsset_019fdcb7-c9c4-76d3-8869-172871103f3a" xlink:href="hsy-20260927.xsd#hsy_LeaseRightofUseAsset"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_019fdcb7-c9c4-7e37-88a9-8a1d12c10515" xlink:to="loc_hsy_LeaseRightofUseAsset_019fdcb7-c9c4-76d3-8869-172871103f3a" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLeaseLiabilityCurrent_019fdcb7-c9c4-76ca-8ce9-2c3093cb47c6" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OperatingLeaseLiabilityCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_019fdcb7-c9c4-7e37-88a9-8a1d12c10515" xlink:to="loc_us-gaap_OperatingLeaseLiabilityCurrent_019fdcb7-c9c4-76ca-8ce9-2c3093cb47c6" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinanceLeaseLiabilityCurrent_019fdcb7-c9c4-7d49-888f-976623a3dbb4" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FinanceLeaseLiabilityCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_019fdcb7-c9c4-7e37-88a9-8a1d12c10515" xlink:to="loc_us-gaap_FinanceLeaseLiabilityCurrent_019fdcb7-c9c4-7d49-888f-976623a3dbb4" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLeaseLiabilityNoncurrent_019fdcb7-c9c4-7c5c-a809-b1ba5575359f" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OperatingLeaseLiabilityNoncurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_019fdcb7-c9c4-7e37-88a9-8a1d12c10515" xlink:to="loc_us-gaap_OperatingLeaseLiabilityNoncurrent_019fdcb7-c9c4-7c5c-a809-b1ba5575359f" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinanceLeaseLiabilityNoncurrent_019fdcb7-c9c4-7792-806f-8045d44d4531" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FinanceLeaseLiabilityNoncurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_019fdcb7-c9c4-7e37-88a9-8a1d12c10515" xlink:to="loc_us-gaap_FinanceLeaseLiabilityNoncurrent_019fdcb7-c9c4-7792-806f-8045d44d4531" xlink:type="arc" order="8"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_LeaseLiability_019fdcb7-c9c4-7fee-9be0-6bf12552429d" xlink:href="hsy-20260927.xsd#hsy_LeaseLiability"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_019fdcb7-c9c4-7e37-88a9-8a1d12c10515" xlink:to="loc_hsy_LeaseLiability_019fdcb7-c9c4-7fee-9be0-6bf12552429d" xlink:type="arc" order="9"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/LEASESSUPPLEMENTALBALANCESHEETINFORMATIONRELATEDTOLEASESDetails_1" xlink:type="simple" xlink:href="hsy-20260927.xsd#LEASESSUPPLEMENTALBALANCESHEETINFORMATIONRELATEDTOLEASESDetails_1"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/LEASESSUPPLEMENTALBALANCESHEETINFORMATIONRELATEDTOLEASESDetails_1" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeLeaseDescriptionLineItems_019fdcb7-c9c4-7e37-88a9-8a1d12c10515" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_LesseeLeaseDescriptionLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeLeaseDescriptionTable_019fdcb7-c9c4-7ccb-9182-8623f4797670" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_LesseeLeaseDescriptionTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_019fdcb7-c9c4-7e37-88a9-8a1d12c10515" xlink:to="loc_us-gaap_LesseeLeaseDescriptionTable_019fdcb7-c9c4-7ccb-9182-8623f4797670" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLeaseRightOfUseAsset_019fdcb7-c9c4-7967-b4be-e2a20e31f1b4" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OperatingLeaseRightOfUseAsset"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_019fdcb7-c9c4-7e37-88a9-8a1d12c10515" xlink:to="loc_us-gaap_OperatingLeaseRightOfUseAsset_019fdcb7-c9c4-7967-b4be-e2a20e31f1b4" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinanceLeaseRightOfUseAssetBeforeAccumulatedAmortization_01a15af9-e44c-7fd0-b729-d04de142ed2e" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FinanceLeaseRightOfUseAssetBeforeAccumulatedAmortization"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_019fdcb7-c9c4-7e37-88a9-8a1d12c10515" xlink:to="loc_us-gaap_FinanceLeaseRightOfUseAssetBeforeAccumulatedAmortization_01a15af9-e44c-7fd0-b729-d04de142ed2e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinanceLeaseRightOfUseAssetAccumulatedAmortization_019fdcb7-c9c4-71e4-a27d-42688a90e935" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FinanceLeaseRightOfUseAssetAccumulatedAmortization"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_019fdcb7-c9c4-7e37-88a9-8a1d12c10515" xlink:to="loc_us-gaap_FinanceLeaseRightOfUseAssetAccumulatedAmortization_019fdcb7-c9c4-71e4-a27d-42688a90e935" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinanceLeaseRightOfUseAsset_019fdcb7-c9c4-72aa-ae5f-c82487c409ff" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FinanceLeaseRightOfUseAsset"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_019fdcb7-c9c4-7e37-88a9-8a1d12c10515" xlink:to="loc_us-gaap_FinanceLeaseRightOfUseAsset_019fdcb7-c9c4-72aa-ae5f-c82487c409ff" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinanceLeaseRightOfUseAssetStatementOfFinancialPositionExtensibleList_01a15af6-da8d-7b5d-aafb-9d0375a659e1" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FinanceLeaseRightOfUseAssetStatementOfFinancialPositionExtensibleList"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinanceLeaseRightOfUseAsset_019fdcb7-c9c4-72aa-ae5f-c82487c409ff" xlink:to="loc_us-gaap_FinanceLeaseRightOfUseAssetStatementOfFinancialPositionExtensibleList_01a15af6-da8d-7b5d-aafb-9d0375a659e1" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_LeaseRightofUseAsset_019fdcb7-c9c4-76d3-8869-172871103f3a" xlink:href="hsy-20260927.xsd#hsy_LeaseRightofUseAsset"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_019fdcb7-c9c4-7e37-88a9-8a1d12c10515" xlink:to="loc_hsy_LeaseRightofUseAsset_019fdcb7-c9c4-76d3-8869-172871103f3a" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLeaseLiabilityCurrent_019fdcb7-c9c4-76ca-8ce9-2c3093cb47c6" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OperatingLeaseLiabilityCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_019fdcb7-c9c4-7e37-88a9-8a1d12c10515" xlink:to="loc_us-gaap_OperatingLeaseLiabilityCurrent_019fdcb7-c9c4-76ca-8ce9-2c3093cb47c6" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinanceLeaseLiabilityCurrent_019fdcb7-c9c4-7d49-888f-976623a3dbb4" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FinanceLeaseLiabilityCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_019fdcb7-c9c4-7e37-88a9-8a1d12c10515" xlink:to="loc_us-gaap_FinanceLeaseLiabilityCurrent_019fdcb7-c9c4-7d49-888f-976623a3dbb4" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLeaseLiabilityNoncurrent_019fdcb7-c9c4-7c5c-a809-b1ba5575359f" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OperatingLeaseLiabilityNoncurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_019fdcb7-c9c4-7e37-88a9-8a1d12c10515" xlink:to="loc_us-gaap_OperatingLeaseLiabilityNoncurrent_019fdcb7-c9c4-7c5c-a809-b1ba5575359f" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinanceLeaseLiabilityNoncurrent_019fdcb7-c9c4-7792-806f-8045d44d4531" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FinanceLeaseLiabilityNoncurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_019fdcb7-c9c4-7e37-88a9-8a1d12c10515" xlink:to="loc_us-gaap_FinanceLeaseLiabilityNoncurrent_019fdcb7-c9c4-7792-806f-8045d44d4531" xlink:type="arc" order="8"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_LeaseLiability_019fdcb7-c9c4-7fee-9be0-6bf12552429d" xlink:href="hsy-20260927.xsd#hsy_LeaseLiability"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_019fdcb7-c9c4-7e37-88a9-8a1d12c10515" xlink:to="loc_hsy_LeaseLiability_019fdcb7-c9c4-7fee-9be0-6bf12552429d" xlink:type="arc" order="9"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/INVESTMENTSINUNCONSOLIDATEDAFFILIATESDetails" xlink:type="simple" xlink:href="hsy-20260927.xsd#INVESTMENTSINUNCONSOLIDATEDAFFILIATESDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/INVESTMENTSINUNCONSOLIDATEDAFFILIATESDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionLineItems_019fdcb7-c9c4-73c1-841e-107bbdaf4801" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_BusinessAcquisitionLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_019fdcb7-c9c4-70ac-813e-ee2c530a1b86" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_019fdcb7-c9c4-73c1-841e-107bbdaf4801" xlink:to="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_019fdcb7-c9c4-70ac-813e-ee2c530a1b86" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementOfFinancialPositionLocationBalanceAxis_019fdcb7-c9c4-716e-b8b7-ee9b3219c682" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_StatementOfFinancialPositionLocationBalanceAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_019fdcb7-c9c4-70ac-813e-ee2c530a1b86" xlink:to="loc_us-gaap_StatementOfFinancialPositionLocationBalanceAxis_019fdcb7-c9c4-716e-b8b7-ee9b3219c682" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InvestmentsInAffiliatesSubsidiariesAssociatesAndJointVenturesFairValueDisclosure_019fdcb7-c9c4-7a8b-9db1-d53d07670102" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_InvestmentsInAffiliatesSubsidiariesAssociatesAndJointVenturesFairValueDisclosure"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_019fdcb7-c9c4-73c1-841e-107bbdaf4801" xlink:to="loc_us-gaap_InvestmentsInAffiliatesSubsidiariesAssociatesAndJointVenturesFairValueDisclosure_019fdcb7-c9c4-7a8b-9db1-d53d07670102" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/INVESTMENTSINUNCONSOLIDATEDAFFILIATESDetails_1" xlink:type="simple" xlink:href="hsy-20260927.xsd#INVESTMENTSINUNCONSOLIDATEDAFFILIATESDetails_1"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/INVESTMENTSINUNCONSOLIDATEDAFFILIATESDetails_1" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionLineItems_019fdcb7-c9c4-73c1-841e-107bbdaf4801" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_BusinessAcquisitionLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_019fdcb7-c9c4-70ac-813e-ee2c530a1b86" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_019fdcb7-c9c4-73c1-841e-107bbdaf4801" xlink:to="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_019fdcb7-c9c4-70ac-813e-ee2c530a1b86" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InvestmentsInAffiliatesSubsidiariesAssociatesAndJointVenturesFairValueDisclosure_019fdcb7-c9c4-7a8b-9db1-d53d07670102" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_InvestmentsInAffiliatesSubsidiariesAssociatesAndJointVenturesFairValueDisclosure"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_019fdcb7-c9c4-73c1-841e-107bbdaf4801" xlink:to="loc_us-gaap_InvestmentsInAffiliatesSubsidiariesAssociatesAndJointVenturesFairValueDisclosure_019fdcb7-c9c4-7a8b-9db1-d53d07670102" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/BUSINESSREALIGNMENTACTIVITIESNARRATIVEDetails" xlink:type="simple" xlink:href="hsy-20260927.xsd#BUSINESSREALIGNMENTACTIVITIESNARRATIVEDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/BUSINESSREALIGNMENTACTIVITIESNARRATIVEDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringCostAndReserveLineItems_019fdcb7-c9c4-738e-a221-92edf3d1a1eb" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RestructuringCostAndReserveLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_019fdcb7-c9c4-7b48-999b-c43e48e1113f" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ScheduleOfRestructuringAndRelatedCostsTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_RestructuringCostAndReserveLineItems_019fdcb7-c9c4-738e-a221-92edf3d1a1eb" xlink:to="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_019fdcb7-c9c4-7b48-999b-c43e48e1113f" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringPlanAxis_019fdcb7-c9c4-7e5d-a6fb-5c442a8d28f5" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RestructuringPlanAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_019fdcb7-c9c4-7b48-999b-c43e48e1113f" xlink:to="loc_us-gaap_RestructuringPlanAxis_019fdcb7-c9c4-7e5d-a6fb-5c442a8d28f5" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringPlanDomain_019fdcb7-c9c4-7e5d-a6fb-5c442a8d28f5_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RestructuringPlanDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_RestructuringPlanAxis_019fdcb7-c9c4-7e5d-a6fb-5c442a8d28f5" xlink:to="loc_us-gaap_RestructuringPlanDomain_019fdcb7-c9c4-7e5d-a6fb-5c442a8d28f5_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringPlanDomain_019fdcb7-c9c4-72fa-b680-1a1883b3628f" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RestructuringPlanDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_RestructuringPlanAxis_019fdcb7-c9c4-7e5d-a6fb-5c442a8d28f5" xlink:to="loc_us-gaap_RestructuringPlanDomain_019fdcb7-c9c4-72fa-b680-1a1883b3628f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_AdvancingAgilityAutomationInitiativeMember_019fdcb7-c9c4-76b8-bbb2-fe676ab3f36e" xlink:href="hsy-20260927.xsd#hsy_AdvancingAgilityAutomationInitiativeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RestructuringPlanDomain_019fdcb7-c9c4-72fa-b680-1a1883b3628f" xlink:to="loc_hsy_AdvancingAgilityAutomationInitiativeMember_019fdcb7-c9c4-76b8-bbb2-fe676ab3f36e" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeAxis_019fdcb7-c9c4-7154-8d91-a081d74fe9d7" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_RangeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_019fdcb7-c9c4-7b48-999b-c43e48e1113f" xlink:to="loc_srt_RangeAxis_019fdcb7-c9c4-7154-8d91-a081d74fe9d7" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_019fdcb7-c9c4-7154-8d91-a081d74fe9d7_default" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_RangeAxis_019fdcb7-c9c4-7154-8d91-a081d74fe9d7" xlink:to="loc_srt_RangeMember_019fdcb7-c9c4-7154-8d91-a081d74fe9d7_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_019fdcb7-c9c4-7047-bf53-f476009c7236" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_RangeAxis_019fdcb7-c9c4-7154-8d91-a081d74fe9d7" xlink:to="loc_srt_RangeMember_019fdcb7-c9c4-7047-bf53-f476009c7236" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MinimumMember_019fdcb7-c9c4-7abc-9c64-e0a8d277d0e2" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_MinimumMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_019fdcb7-c9c4-7047-bf53-f476009c7236" xlink:to="loc_srt_MinimumMember_019fdcb7-c9c4-7abc-9c64-e0a8d277d0e2" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MaximumMember_019fdcb7-c9c4-71f1-9b2b-b4718a924d22" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_MaximumMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_019fdcb7-c9c4-7047-bf53-f476009c7236" xlink:to="loc_srt_MaximumMember_019fdcb7-c9c4-71f1-9b2b-b4718a924d22" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringCostAndReserveAxis_019fdcb7-c9c4-71f2-9f3d-ea6bdb363416" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RestructuringCostAndReserveAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_019fdcb7-c9c4-7b48-999b-c43e48e1113f" xlink:to="loc_us-gaap_RestructuringCostAndReserveAxis_019fdcb7-c9c4-71f2-9f3d-ea6bdb363416" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TypeOfRestructuringDomain_019fdcb7-c9c4-71f2-9f3d-ea6bdb363416_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_TypeOfRestructuringDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_RestructuringCostAndReserveAxis_019fdcb7-c9c4-71f2-9f3d-ea6bdb363416" xlink:to="loc_us-gaap_TypeOfRestructuringDomain_019fdcb7-c9c4-71f2-9f3d-ea6bdb363416_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TypeOfRestructuringDomain_019fdcb7-c9c4-76ee-a487-d41bbb67f303" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_TypeOfRestructuringDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_RestructuringCostAndReserveAxis_019fdcb7-c9c4-71f2-9f3d-ea6bdb363416" xlink:to="loc_us-gaap_TypeOfRestructuringDomain_019fdcb7-c9c4-76ee-a487-d41bbb67f303" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_ProgramOfficeExecutionAndThirdPartyCostsMember_019fdcb7-c9c4-7fde-aa01-f895c1f82cff" xlink:href="hsy-20260927.xsd#hsy_ProgramOfficeExecutionAndThirdPartyCostsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TypeOfRestructuringDomain_019fdcb7-c9c4-76ee-a487-d41bbb67f303" xlink:to="loc_hsy_ProgramOfficeExecutionAndThirdPartyCostsMember_019fdcb7-c9c4-7fde-aa01-f895c1f82cff" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_TechnologyCapabilityCostsMember_019fdcb7-c9c4-75d6-8d5a-fc0e78b96815" xlink:href="hsy-20260927.xsd#hsy_TechnologyCapabilityCostsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TypeOfRestructuringDomain_019fdcb7-c9c4-76ee-a487-d41bbb67f303" xlink:to="loc_hsy_TechnologyCapabilityCostsMember_019fdcb7-c9c4-75d6-8d5a-fc0e78b96815" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeSeveranceMember_019fdcb7-c9c4-7521-94fc-598583e3d3ba" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_EmployeeSeveranceMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TypeOfRestructuringDomain_019fdcb7-c9c4-76ee-a487-d41bbb67f303" xlink:to="loc_us-gaap_EmployeeSeveranceMember_019fdcb7-c9c4-7521-94fc-598583e3d3ba" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringAndRelatedCostExpectedCost1_019fdcb7-c9c4-78ac-ab93-b2fec52e4baa" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RestructuringAndRelatedCostExpectedCost1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RestructuringCostAndReserveLineItems_019fdcb7-c9c4-738e-a221-92edf3d1a1eb" xlink:to="loc_us-gaap_RestructuringAndRelatedCostExpectedCost1_019fdcb7-c9c4-78ac-ab93-b2fec52e4baa" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_RestructuringandRelatedCostExpectedCostCashPortion_019fdcb7-c9c4-74c1-a476-36d120ca0ea7" xlink:href="hsy-20260927.xsd#hsy_RestructuringandRelatedCostExpectedCostCashPortion"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RestructuringCostAndReserveLineItems_019fdcb7-c9c4-738e-a221-92edf3d1a1eb" xlink:to="loc_hsy_RestructuringandRelatedCostExpectedCostCashPortion_019fdcb7-c9c4-74c1-a476-36d120ca0ea7" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_RestructuringAndRelatedCostExpectedSavings_019fdcb7-c9c4-7aa0-af21-2613ab0964ed" xlink:href="hsy-20260927.xsd#hsy_RestructuringAndRelatedCostExpectedSavings"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RestructuringCostAndReserveLineItems_019fdcb7-c9c4-738e-a221-92edf3d1a1eb" xlink:to="loc_hsy_RestructuringAndRelatedCostExpectedSavings_019fdcb7-c9c4-7aa0-af21-2613ab0964ed" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringAndRelatedCostCostIncurredToDate1_019fdcb7-c9c4-77b0-b7bd-7715ed827a67" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RestructuringAndRelatedCostCostIncurredToDate1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RestructuringCostAndReserveLineItems_019fdcb7-c9c4-738e-a221-92edf3d1a1eb" xlink:to="loc_us-gaap_RestructuringAndRelatedCostCostIncurredToDate1_019fdcb7-c9c4-77b0-b7bd-7715ed827a67" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringCharges_019fdcb7-c9c4-71c8-897a-919b5e9cf2f8" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RestructuringCharges"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RestructuringCostAndReserveLineItems_019fdcb7-c9c4-738e-a221-92edf3d1a1eb" xlink:to="loc_us-gaap_RestructuringCharges_019fdcb7-c9c4-71c8-897a-919b5e9cf2f8" xlink:type="arc" order="4"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/BUSINESSREALIGNMENTACTIVITIESSCHEDULEOFBUSINESSREALIGNMENTACTIVITYDetails" xlink:type="simple" xlink:href="hsy-20260927.xsd#BUSINESSREALIGNMENTACTIVITIESSCHEDULEOFBUSINESSREALIGNMENTACTIVITYDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/BUSINESSREALIGNMENTACTIVITIESSCHEDULEOFBUSINESSREALIGNMENTACTIVITYDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringCostAndReserveLineItems_019fdcb7-c9c4-7ef2-9149-0b019cde9459" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RestructuringCostAndReserveLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_019fdcb7-c9c4-7a07-96d6-2d3d6898f551" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ScheduleOfRestructuringAndRelatedCostsTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_RestructuringCostAndReserveLineItems_019fdcb7-c9c4-7ef2-9149-0b019cde9459" xlink:to="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_019fdcb7-c9c4-7a07-96d6-2d3d6898f551" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementOfIncomeLocationBalanceAxis_019fdcb7-c9c4-7d0b-95f6-4fd999f9d59a" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_StatementOfIncomeLocationBalanceAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_019fdcb7-c9c4-7a07-96d6-2d3d6898f551" xlink:to="loc_us-gaap_StatementOfIncomeLocationBalanceAxis_019fdcb7-c9c4-7d0b-95f6-4fd999f9d59a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringCostAndReserveAxis_019fdcb7-c9c4-7ce2-b298-f492e14babbb" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RestructuringCostAndReserveAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_019fdcb7-c9c4-7a07-96d6-2d3d6898f551" xlink:to="loc_us-gaap_RestructuringCostAndReserveAxis_019fdcb7-c9c4-7ce2-b298-f492e14babbb" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TypeOfRestructuringDomain_019fdcb7-c9c4-7ce2-b298-f492e14babbb_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_TypeOfRestructuringDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_RestructuringCostAndReserveAxis_019fdcb7-c9c4-7ce2-b298-f492e14babbb" xlink:to="loc_us-gaap_TypeOfRestructuringDomain_019fdcb7-c9c4-7ce2-b298-f492e14babbb_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TypeOfRestructuringDomain_019fdcb7-c9c4-79c5-9a66-c9a4b346f6db" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_TypeOfRestructuringDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_RestructuringCostAndReserveAxis_019fdcb7-c9c4-7ce2-b298-f492e14babbb" xlink:to="loc_us-gaap_TypeOfRestructuringDomain_019fdcb7-c9c4-79c5-9a66-c9a4b346f6db" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeSeveranceMember_019fdcb7-c9c4-7333-9ea8-4277f010cf97" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_EmployeeSeveranceMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TypeOfRestructuringDomain_019fdcb7-c9c4-79c5-9a66-c9a4b346f6db" xlink:to="loc_us-gaap_EmployeeSeveranceMember_019fdcb7-c9c4-7333-9ea8-4277f010cf97" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherRestructuringMember_019fdcb7-c9c4-7b13-befd-d85ce0d1406c" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OtherRestructuringMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TypeOfRestructuringDomain_019fdcb7-c9c4-79c5-9a66-c9a4b346f6db" xlink:to="loc_us-gaap_OtherRestructuringMember_019fdcb7-c9c4-7b13-befd-d85ce0d1406c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringPlanAxis_019fdcb7-c9c4-7ed5-b564-5759cd39a87c" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RestructuringPlanAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_019fdcb7-c9c4-7a07-96d6-2d3d6898f551" xlink:to="loc_us-gaap_RestructuringPlanAxis_019fdcb7-c9c4-7ed5-b564-5759cd39a87c" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringPlanDomain_019fdcb7-c9c4-7ed5-b564-5759cd39a87c_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RestructuringPlanDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_RestructuringPlanAxis_019fdcb7-c9c4-7ed5-b564-5759cd39a87c" xlink:to="loc_us-gaap_RestructuringPlanDomain_019fdcb7-c9c4-7ed5-b564-5759cd39a87c_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringPlanDomain_019fdcb7-c9c4-7e2a-a58a-e7e418030d6c" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RestructuringPlanDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_RestructuringPlanAxis_019fdcb7-c9c4-7ed5-b564-5759cd39a87c" xlink:to="loc_us-gaap_RestructuringPlanDomain_019fdcb7-c9c4-7e2a-a58a-e7e418030d6c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_AdvancingAgilityAutomationInitiativeMember_019fdcb7-c9c4-7013-9b8f-95e846d850dd" xlink:href="hsy-20260927.xsd#hsy_AdvancingAgilityAutomationInitiativeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RestructuringPlanDomain_019fdcb7-c9c4-7e2a-a58a-e7e418030d6c" xlink:to="loc_hsy_AdvancingAgilityAutomationInitiativeMember_019fdcb7-c9c4-7013-9b8f-95e846d850dd" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringCharges_019fdcb7-c9c4-7e01-b4aa-327101b9d6de" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RestructuringCharges"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RestructuringCostAndReserveLineItems_019fdcb7-c9c4-7ef2-9149-0b019cde9459" xlink:to="loc_us-gaap_RestructuringCharges_019fdcb7-c9c4-7e01-b4aa-327101b9d6de" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/BUSINESSREALIGNMENTACTIVITIESSCHEDULEOFBUSINESSREALIGNMENTACTIVITYDetails_1" xlink:type="simple" xlink:href="hsy-20260927.xsd#BUSINESSREALIGNMENTACTIVITIESSCHEDULEOFBUSINESSREALIGNMENTACTIVITYDetails_1"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/BUSINESSREALIGNMENTACTIVITIESSCHEDULEOFBUSINESSREALIGNMENTACTIVITYDetails_1" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringCostAndReserveLineItems_019fdcb7-c9c4-7ef2-9149-0b019cde9459" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RestructuringCostAndReserveLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_019fdcb7-c9c4-7a07-96d6-2d3d6898f551" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ScheduleOfRestructuringAndRelatedCostsTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_RestructuringCostAndReserveLineItems_019fdcb7-c9c4-7ef2-9149-0b019cde9459" xlink:to="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_019fdcb7-c9c4-7a07-96d6-2d3d6898f551" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringCostAndReserveAxis_019fdcb7-c9c4-7ce2-b298-f492e14babbb" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RestructuringCostAndReserveAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_019fdcb7-c9c4-7a07-96d6-2d3d6898f551" xlink:to="loc_us-gaap_RestructuringCostAndReserveAxis_019fdcb7-c9c4-7ce2-b298-f492e14babbb" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TypeOfRestructuringDomain_019fdcb7-c9c4-7ce2-b298-f492e14babbb_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_TypeOfRestructuringDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_RestructuringCostAndReserveAxis_019fdcb7-c9c4-7ce2-b298-f492e14babbb" xlink:to="loc_us-gaap_TypeOfRestructuringDomain_019fdcb7-c9c4-7ce2-b298-f492e14babbb_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TypeOfRestructuringDomain_019fdcb7-c9c4-79c5-9a66-c9a4b346f6db" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_TypeOfRestructuringDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_RestructuringCostAndReserveAxis_019fdcb7-c9c4-7ce2-b298-f492e14babbb" xlink:to="loc_us-gaap_TypeOfRestructuringDomain_019fdcb7-c9c4-79c5-9a66-c9a4b346f6db" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeSeveranceMember_019fdcb7-c9c4-7333-9ea8-4277f010cf97" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_EmployeeSeveranceMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TypeOfRestructuringDomain_019fdcb7-c9c4-79c5-9a66-c9a4b346f6db" xlink:to="loc_us-gaap_EmployeeSeveranceMember_019fdcb7-c9c4-7333-9ea8-4277f010cf97" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherRestructuringMember_019fdcb7-c9c4-7b13-befd-d85ce0d1406c" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OtherRestructuringMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TypeOfRestructuringDomain_019fdcb7-c9c4-79c5-9a66-c9a4b346f6db" xlink:to="loc_us-gaap_OtherRestructuringMember_019fdcb7-c9c4-7b13-befd-d85ce0d1406c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringPlanAxis_019fdcb7-c9c4-7ed5-b564-5759cd39a87c" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RestructuringPlanAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_019fdcb7-c9c4-7a07-96d6-2d3d6898f551" xlink:to="loc_us-gaap_RestructuringPlanAxis_019fdcb7-c9c4-7ed5-b564-5759cd39a87c" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringPlanDomain_019fdcb7-c9c4-7ed5-b564-5759cd39a87c_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RestructuringPlanDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_RestructuringPlanAxis_019fdcb7-c9c4-7ed5-b564-5759cd39a87c" xlink:to="loc_us-gaap_RestructuringPlanDomain_019fdcb7-c9c4-7ed5-b564-5759cd39a87c_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringPlanDomain_019fdcb7-c9c4-7e2a-a58a-e7e418030d6c" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RestructuringPlanDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_RestructuringPlanAxis_019fdcb7-c9c4-7ed5-b564-5759cd39a87c" xlink:to="loc_us-gaap_RestructuringPlanDomain_019fdcb7-c9c4-7e2a-a58a-e7e418030d6c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_AdvancingAgilityAutomationInitiativeMember_019fdcb7-c9c4-7013-9b8f-95e846d850dd" xlink:href="hsy-20260927.xsd#hsy_AdvancingAgilityAutomationInitiativeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RestructuringPlanDomain_019fdcb7-c9c4-7e2a-a58a-e7e418030d6c" xlink:to="loc_hsy_AdvancingAgilityAutomationInitiativeMember_019fdcb7-c9c4-7013-9b8f-95e846d850dd" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringCharges_019fdcb7-c9c4-7e01-b4aa-327101b9d6de" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RestructuringCharges"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RestructuringCostAndReserveLineItems_019fdcb7-c9c4-7ef2-9149-0b019cde9459" xlink:to="loc_us-gaap_RestructuringCharges_019fdcb7-c9c4-7e01-b4aa-327101b9d6de" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/BUSINESSREALIGNMENTACTIVITIESSCHEDULEOFLIABILITYACTIVITIYFORCOSTSQUALIFYINGASEXITANDDISPOSALCOSTSDetails" xlink:type="simple" xlink:href="hsy-20260927.xsd#BUSINESSREALIGNMENTACTIVITIESSCHEDULEOFLIABILITYACTIVITIYFORCOSTSQUALIFYINGASEXITANDDISPOSALCOSTSDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/BUSINESSREALIGNMENTACTIVITIESSCHEDULEOFLIABILITYACTIVITIYFORCOSTSQUALIFYINGASEXITANDDISPOSALCOSTSDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringCostAndReserveLineItems_019fdcb7-c9c4-7c2e-99e9-f7abfa580c37" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RestructuringCostAndReserveLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_019fdcb7-c9c4-752e-9cb4-3360e9cd951a" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ScheduleOfRestructuringAndRelatedCostsTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_RestructuringCostAndReserveLineItems_019fdcb7-c9c4-7c2e-99e9-f7abfa580c37" xlink:to="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_019fdcb7-c9c4-752e-9cb4-3360e9cd951a" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringCostAndReserveAxis_019fdcb7-c9c4-7c65-873b-414fef94708f" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RestructuringCostAndReserveAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_019fdcb7-c9c4-752e-9cb4-3360e9cd951a" xlink:to="loc_us-gaap_RestructuringCostAndReserveAxis_019fdcb7-c9c4-7c65-873b-414fef94708f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TypeOfRestructuringDomain_019fdcb7-c9c4-7c65-873b-414fef94708f_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_TypeOfRestructuringDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_RestructuringCostAndReserveAxis_019fdcb7-c9c4-7c65-873b-414fef94708f" xlink:to="loc_us-gaap_TypeOfRestructuringDomain_019fdcb7-c9c4-7c65-873b-414fef94708f_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TypeOfRestructuringDomain_019fdcb7-c9c4-74ba-ab03-7bf2626ee8f8" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_TypeOfRestructuringDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_RestructuringCostAndReserveAxis_019fdcb7-c9c4-7c65-873b-414fef94708f" xlink:to="loc_us-gaap_TypeOfRestructuringDomain_019fdcb7-c9c4-74ba-ab03-7bf2626ee8f8" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeSeveranceMember_019fdcb7-c9c4-77fb-9da1-a476fd306b32" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_EmployeeSeveranceMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TypeOfRestructuringDomain_019fdcb7-c9c4-74ba-ab03-7bf2626ee8f8" xlink:to="loc_us-gaap_EmployeeSeveranceMember_019fdcb7-c9c4-77fb-9da1-a476fd306b32" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringReserveRollForward_019fdcb7-c9c4-705c-ac8e-fac0b2b66a7e" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RestructuringReserveRollForward"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RestructuringCostAndReserveLineItems_019fdcb7-c9c4-7c2e-99e9-f7abfa580c37" xlink:to="loc_us-gaap_RestructuringReserveRollForward_019fdcb7-c9c4-705c-ac8e-fac0b2b66a7e" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringReserve_019fdcb7-c9c4-7dba-88f6-6d3bd9e293a3" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RestructuringReserve"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RestructuringReserveRollForward_019fdcb7-c9c4-705c-ac8e-fac0b2b66a7e" xlink:to="loc_us-gaap_RestructuringReserve_019fdcb7-c9c4-7dba-88f6-6d3bd9e293a3" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringCharges_019fdcb7-c9c4-7a00-b34f-3b90867dbcdf" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RestructuringCharges"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RestructuringReserveRollForward_019fdcb7-c9c4-705c-ac8e-fac0b2b66a7e" xlink:to="loc_us-gaap_RestructuringCharges_019fdcb7-c9c4-7a00-b34f-3b90867dbcdf" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsForRestructuring_019fdcb7-c9c4-7cf6-9b3f-8bf423bf43a7" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_PaymentsForRestructuring"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RestructuringReserveRollForward_019fdcb7-c9c4-705c-ac8e-fac0b2b66a7e" xlink:to="loc_us-gaap_PaymentsForRestructuring_019fdcb7-c9c4-7cf6-9b3f-8bf423bf43a7" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringReserve_019fdcb7-c9c4-7f37-8f25-7229d13e213e" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RestructuringReserve"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/PENSIONANDOTHERPOSTRETIREMENTBENEFITPLANSSCHEDULEOFCOMPONENTSOFNETPERIODICBENEFITCOSTDetails" xlink:type="simple" xlink:href="hsy-20260927.xsd#PENSIONANDOTHERPOSTRETIREMENTBENEFITPLANSSCHEDULEOFCOMPONENTSOFNETPERIODICBENEFITCOSTDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/PENSIONANDOTHERPOSTRETIREMENTBENEFITPLANSSCHEDULEOFCOMPONENTSOFNETPERIODICBENEFITCOSTDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_019fdcb7-ca76-7018-9a67-54f8c217fba3" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DefinedBenefitPlanDisclosureLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable_019fdcb7-ca76-7dad-9780-e1e70ffe1d4f" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_019fdcb7-ca76-7018-9a67-54f8c217fba3" xlink:to="loc_us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable_019fdcb7-ca76-7dad-9780-e1e70ffe1d4f" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetirementPlanTypeAxis_019fdcb7-ca76-7247-8c87-0721b26fcf30" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RetirementPlanTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable_019fdcb7-ca76-7dad-9780-e1e70ffe1d4f" xlink:to="loc_us-gaap_RetirementPlanTypeAxis_019fdcb7-ca76-7247-8c87-0721b26fcf30" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetirementPlanTypeDomain_019fdcb7-ca76-7247-8c87-0721b26fcf30_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RetirementPlanTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_RetirementPlanTypeAxis_019fdcb7-ca76-7247-8c87-0721b26fcf30" xlink:to="loc_us-gaap_RetirementPlanTypeDomain_019fdcb7-ca76-7247-8c87-0721b26fcf30_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetirementPlanTypeDomain_019fdcb7-ca76-797b-8abd-37bddbacb046" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RetirementPlanTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_RetirementPlanTypeAxis_019fdcb7-ca76-7247-8c87-0721b26fcf30" xlink:to="loc_us-gaap_RetirementPlanTypeDomain_019fdcb7-ca76-797b-8abd-37bddbacb046" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PensionPlansDefinedBenefitMember_019fdcb7-ca76-706c-8153-c223b5fc3f5a" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_PensionPlansDefinedBenefitMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RetirementPlanTypeDomain_019fdcb7-ca76-797b-8abd-37bddbacb046" xlink:to="loc_us-gaap_PensionPlansDefinedBenefitMember_019fdcb7-ca76-706c-8153-c223b5fc3f5a" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherPostretirementBenefitPlansDefinedBenefitMember_019fdcb7-ca76-73f0-b477-b899155b7e53" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OtherPostretirementBenefitPlansDefinedBenefitMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RetirementPlanTypeDomain_019fdcb7-ca76-797b-8abd-37bddbacb046" xlink:to="loc_us-gaap_OtherPostretirementBenefitPlansDefinedBenefitMember_019fdcb7-ca76-73f0-b477-b899155b7e53" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DefinedBenefitPlanServiceCost_019fdcb7-ca76-7ea8-86f7-1b903a428ed6" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DefinedBenefitPlanServiceCost"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_019fdcb7-ca76-7018-9a67-54f8c217fba3" xlink:to="loc_us-gaap_DefinedBenefitPlanServiceCost_019fdcb7-ca76-7ea8-86f7-1b903a428ed6" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DefinedBenefitPlanInterestCost_019fdcb7-ca76-7351-b2e9-31e8513376d8" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DefinedBenefitPlanInterestCost"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_019fdcb7-ca76-7018-9a67-54f8c217fba3" xlink:to="loc_us-gaap_DefinedBenefitPlanInterestCost_019fdcb7-ca76-7351-b2e9-31e8513376d8" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DefinedBenefitPlanExpectedReturnOnPlanAssets_019fdcb7-ca76-74a9-9f5b-5d6db2b87452" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DefinedBenefitPlanExpectedReturnOnPlanAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_019fdcb7-ca76-7018-9a67-54f8c217fba3" xlink:to="loc_us-gaap_DefinedBenefitPlanExpectedReturnOnPlanAssets_019fdcb7-ca76-74a9-9f5b-5d6db2b87452" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DefinedBenefitPlanAmortizationOfPriorServiceCostCredit_019fdcb7-ca76-7ae5-9df2-9d3d95d308b7" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DefinedBenefitPlanAmortizationOfPriorServiceCostCredit"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_019fdcb7-ca76-7018-9a67-54f8c217fba3" xlink:to="loc_us-gaap_DefinedBenefitPlanAmortizationOfPriorServiceCostCredit_019fdcb7-ca76-7ae5-9df2-9d3d95d308b7" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DefinedBenefitPlanAmortizationOfGainsLosses_019fdcb7-ca76-70e8-8a83-4321e9b893e3" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DefinedBenefitPlanAmortizationOfGainsLosses"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_019fdcb7-ca76-7018-9a67-54f8c217fba3" xlink:to="loc_us-gaap_DefinedBenefitPlanAmortizationOfGainsLosses_019fdcb7-ca76-70e8-8a83-4321e9b893e3" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DefinedBenefitPlanRecognizedNetGainLossDueToSettlements1_019fdcb7-ca76-78df-b753-48ce85bfff40" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DefinedBenefitPlanRecognizedNetGainLossDueToSettlements1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_019fdcb7-ca76-7018-9a67-54f8c217fba3" xlink:to="loc_us-gaap_DefinedBenefitPlanRecognizedNetGainLossDueToSettlements1_019fdcb7-ca76-78df-b753-48ce85bfff40" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DefinedBenefitPlanNetPeriodicBenefitCost_019fdcb7-ca76-72f7-bf20-31ea7bbce815" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DefinedBenefitPlanNetPeriodicBenefitCost"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_019fdcb7-ca76-7018-9a67-54f8c217fba3" xlink:to="loc_us-gaap_DefinedBenefitPlanNetPeriodicBenefitCost_019fdcb7-ca76-72f7-bf20-31ea7bbce815" xlink:type="arc" order="6"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/PENSIONANDOTHERPOSTRETIREMENTBENEFITPLANSNARRATIVEDetails" xlink:type="simple" xlink:href="hsy-20260927.xsd#PENSIONANDOTHERPOSTRETIREMENTBENEFITPLANSNARRATIVEDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/PENSIONANDOTHERPOSTRETIREMENTBENEFITPLANSNARRATIVEDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_019fdcb7-ca76-7acc-b9cf-ad1c3a4d9d49" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DefinedBenefitPlanDisclosureLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable_019fdcb7-ca76-7265-857f-e2bfc75711e7" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_019fdcb7-ca76-7acc-b9cf-ad1c3a4d9d49" xlink:to="loc_us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable_019fdcb7-ca76-7265-857f-e2bfc75711e7" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetirementPlanTypeAxis_019fdcb7-ca76-73c8-bfba-c287f75210bf" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RetirementPlanTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable_019fdcb7-ca76-7265-857f-e2bfc75711e7" xlink:to="loc_us-gaap_RetirementPlanTypeAxis_019fdcb7-ca76-73c8-bfba-c287f75210bf" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetirementPlanTypeDomain_019fdcb7-ca76-73c8-bfba-c287f75210bf_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RetirementPlanTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_RetirementPlanTypeAxis_019fdcb7-ca76-73c8-bfba-c287f75210bf" xlink:to="loc_us-gaap_RetirementPlanTypeDomain_019fdcb7-ca76-73c8-bfba-c287f75210bf_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetirementPlanTypeDomain_019fdcb7-ca76-7373-b047-302e6c171ba9" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RetirementPlanTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_RetirementPlanTypeAxis_019fdcb7-ca76-73c8-bfba-c287f75210bf" xlink:to="loc_us-gaap_RetirementPlanTypeDomain_019fdcb7-ca76-7373-b047-302e6c171ba9" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PensionPlansDefinedBenefitMember_019fdcb7-ca76-76a5-a918-8c12149317e1" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_PensionPlansDefinedBenefitMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RetirementPlanTypeDomain_019fdcb7-ca76-7373-b047-302e6c171ba9" xlink:to="loc_us-gaap_PensionPlansDefinedBenefitMember_019fdcb7-ca76-76a5-a918-8c12149317e1" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherPostretirementBenefitPlansDefinedBenefitMember_019fdcb7-ca76-7bdf-a549-260fc8281b13" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OtherPostretirementBenefitPlansDefinedBenefitMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RetirementPlanTypeDomain_019fdcb7-ca76-7373-b047-302e6c171ba9" xlink:to="loc_us-gaap_OtherPostretirementBenefitPlansDefinedBenefitMember_019fdcb7-ca76-7bdf-a549-260fc8281b13" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DefinedBenefitPlanContributionsByEmployer_019fdcb7-ca76-73c6-8e1f-6a496ffb5b67" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DefinedBenefitPlanContributionsByEmployer"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_019fdcb7-ca76-7acc-b9cf-ad1c3a4d9d49" xlink:to="loc_us-gaap_DefinedBenefitPlanContributionsByEmployer_019fdcb7-ca76-73c6-8e1f-6a496ffb5b67" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_DefinedBenefitPlanRemeasurementBasisSpreadOnDiscountRate_019fdcb7-ca76-798a-83d5-6a1828ace316" xlink:href="hsy-20260927.xsd#hsy_DefinedBenefitPlanRemeasurementBasisSpreadOnDiscountRate"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_019fdcb7-ca76-7acc-b9cf-ad1c3a4d9d49" xlink:to="loc_hsy_DefinedBenefitPlanRemeasurementBasisSpreadOnDiscountRate_019fdcb7-ca76-798a-83d5-6a1828ace316" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DefinedBenefitPlanAssumptionsUsedCalculatingNetPeriodicBenefitCostExpectedLongTermReturnOnAssets_019fdcb7-ca76-7a35-8074-cfc3d582975e" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DefinedBenefitPlanAssumptionsUsedCalculatingNetPeriodicBenefitCostExpectedLongTermReturnOnAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_019fdcb7-ca76-7acc-b9cf-ad1c3a4d9d49" xlink:to="loc_us-gaap_DefinedBenefitPlanAssumptionsUsedCalculatingNetPeriodicBenefitCostExpectedLongTermReturnOnAssets_019fdcb7-ca76-7a35-8074-cfc3d582975e" xlink:type="arc" order="2"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/STOCKCOMPENSATIONPLANSNARRATIVEDetails" xlink:type="simple" xlink:href="hsy-20260927.xsd#STOCKCOMPENSATIONPLANSNARRATIVEDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/STOCKCOMPENSATIONPLANSNARRATIVEDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_019fdcb7-ca76-79fc-980f-6cec7c39dbed" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_019fdcb7-ca76-7ecf-a601-4487fff55d9d" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_019fdcb7-ca76-79fc-980f-6cec7c39dbed" xlink:to="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_019fdcb7-ca76-7ecf-a601-4487fff55d9d" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AwardTypeAxis_019fdcb7-ca76-7244-b4ea-910bd02fe8d9" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AwardTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_019fdcb7-ca76-7ecf-a601-4487fff55d9d" xlink:to="loc_us-gaap_AwardTypeAxis_019fdcb7-ca76-7244-b4ea-910bd02fe8d9" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_019fdcb7-ca76-7244-b4ea-910bd02fe8d9_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AwardTypeAxis_019fdcb7-ca76-7244-b4ea-910bd02fe8d9" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_019fdcb7-ca76-7244-b4ea-910bd02fe8d9_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_019fdcb7-ca76-76fc-a3a4-81e9e790fa10" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AwardTypeAxis_019fdcb7-ca76-7244-b4ea-910bd02fe8d9" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_019fdcb7-ca76-76fc-a3a4-81e9e790fa10" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeStockOptionMember_019fdcb7-ca76-7cdc-8ed5-1f58e10d48d7" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_EmployeeStockOptionMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_019fdcb7-ca76-76fc-a3a4-81e9e790fa10" xlink:to="loc_us-gaap_EmployeeStockOptionMember_019fdcb7-ca76-7cdc-8ed5-1f58e10d48d7" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_PerformanceStockUnitsandRestrictedStockUnitsMember_019fdcb7-ca76-7ac8-84e7-8a6a8d7432bd" xlink:href="hsy-20260927.xsd#hsy_PerformanceStockUnitsandRestrictedStockUnitsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_019fdcb7-ca76-76fc-a3a4-81e9e790fa10" xlink:to="loc_hsy_PerformanceStockUnitsandRestrictedStockUnitsMember_019fdcb7-ca76-7ac8-84e7-8a6a8d7432bd" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeAxis_019fdcb7-ca76-7c06-88fe-17eb801c69f8" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_RangeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_019fdcb7-ca76-7ecf-a601-4487fff55d9d" xlink:to="loc_srt_RangeAxis_019fdcb7-ca76-7c06-88fe-17eb801c69f8" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_019fdcb7-ca76-7c06-88fe-17eb801c69f8_default" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_RangeAxis_019fdcb7-ca76-7c06-88fe-17eb801c69f8" xlink:to="loc_srt_RangeMember_019fdcb7-ca76-7c06-88fe-17eb801c69f8_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_019fdcb7-ca76-72a3-8827-47752552c521" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_RangeAxis_019fdcb7-ca76-7c06-88fe-17eb801c69f8" xlink:to="loc_srt_RangeMember_019fdcb7-ca76-72a3-8827-47752552c521" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MinimumMember_019fdcb7-ca76-7830-9493-336c2574df69" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_MinimumMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_019fdcb7-ca76-72a3-8827-47752552c521" xlink:to="loc_srt_MinimumMember_019fdcb7-ca76-7830-9493-336c2574df69" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MaximumMember_019fdcb7-ca76-7407-977b-e2057ea2a7c7" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_MaximumMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_019fdcb7-ca76-72a3-8827-47752552c521" xlink:to="loc_srt_MaximumMember_019fdcb7-ca76-7407-977b-e2057ea2a7c7" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognized_019fdcb7-ca76-7a51-b59c-1f048c58d30d" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognized"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_019fdcb7-ca76-79fc-980f-6cec7c39dbed" xlink:to="loc_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognized_019fdcb7-ca76-7a51-b59c-1f048c58d30d" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedPeriodForRecognition1_019fdcb7-ca76-7df2-8cf4-42c40ee4eeda" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedPeriodForRecognition1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_019fdcb7-ca76-79fc-980f-6cec7c39dbed" xlink:to="loc_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedPeriodForRecognition1_019fdcb7-ca76-7df2-8cf4-42c40ee4eeda" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardExpirationPeriod_019fdcb7-ca76-7457-ac85-dcffd3a5cb0d" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardExpirationPeriod"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_019fdcb7-ca76-79fc-980f-6cec7c39dbed" xlink:to="loc_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardExpirationPeriod_019fdcb7-ca76-7457-ac85-dcffd3a5cb0d" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardVestingPeriod1_019fdcb7-ca76-71c4-95f1-87555adfbfb3" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardVestingPeriod1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_019fdcb7-ca76-79fc-980f-6cec7c39dbed" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardVestingPeriod1_019fdcb7-ca76-71c4-95f1-87555adfbfb3" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsGrantsInPeriodGross_019fdcb7-ca76-74ce-a8b9-83d4a25a1cdb" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsGrantsInPeriodGross"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_019fdcb7-ca76-79fc-980f-6cec7c39dbed" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsGrantsInPeriodGross_019fdcb7-ca76-74ce-a8b9-83d4a25a1cdb" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisesInPeriodTotalIntrinsicValue_019fdcb7-ca76-7fd2-a580-5f86977a2bdf" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisesInPeriodTotalIntrinsicValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_019fdcb7-ca76-79fc-980f-6cec7c39dbed" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisesInPeriodTotalIntrinsicValue_019fdcb7-ca76-7fd2-a580-5f86977a2bdf" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardRequisiteServicePeriod1_019fdcb7-ca76-78b1-acd7-66451ddf073b" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardRequisiteServicePeriod1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_019fdcb7-ca76-79fc-980f-6cec7c39dbed" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardRequisiteServicePeriod1_019fdcb7-ca76-78b1-acd7-66451ddf073b" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_ShareBasedCompensationArrangementByShareBasedPaymentAwardPerformanceScoreTargetAmounts_019fdcb7-ca76-77df-be00-69137edfd341" xlink:href="hsy-20260927.xsd#hsy_ShareBasedCompensationArrangementByShareBasedPaymentAwardPerformanceScoreTargetAmounts"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_019fdcb7-ca76-79fc-980f-6cec7c39dbed" xlink:to="loc_hsy_ShareBasedCompensationArrangementByShareBasedPaymentAwardPerformanceScoreTargetAmounts_019fdcb7-ca76-77df-be00-69137edfd341" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_ShareBasedCompensationArrangementByShareBasedPaymentAwardIntrinsicValueOfShareBasedLiabilitiesPaidCombinedWithFairValueOfSharesVested_019fdcb7-ca76-731d-b214-b7c2194738ab" xlink:href="hsy-20260927.xsd#hsy_ShareBasedCompensationArrangementByShareBasedPaymentAwardIntrinsicValueOfShareBasedLiabilitiesPaidCombinedWithFairValueOfSharesVested"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_019fdcb7-ca76-79fc-980f-6cec7c39dbed" xlink:to="loc_hsy_ShareBasedCompensationArrangementByShareBasedPaymentAwardIntrinsicValueOfShareBasedLiabilitiesPaidCombinedWithFairValueOfSharesVested_019fdcb7-ca76-731d-b214-b7c2194738ab" xlink:type="arc" order="8"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredCompensationArrangementWithIndividualSharesIssued_019fdcb7-ca76-70b9-88ee-7232e9a804c2" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DeferredCompensationArrangementWithIndividualSharesIssued"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_019fdcb7-ca76-79fc-980f-6cec7c39dbed" xlink:to="loc_us-gaap_DeferredCompensationArrangementWithIndividualSharesIssued_019fdcb7-ca76-70b9-88ee-7232e9a804c2" xlink:type="arc" order="9"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_DeferredCompensationArrangementwithIndividualConversionBasis_019fdcb7-ca76-720a-9a9d-4edb7187ef99" xlink:href="hsy-20260927.xsd#hsy_DeferredCompensationArrangementwithIndividualConversionBasis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_019fdcb7-ca76-79fc-980f-6cec7c39dbed" xlink:to="loc_hsy_DeferredCompensationArrangementwithIndividualConversionBasis_019fdcb7-ca76-720a-9a9d-4edb7187ef99" xlink:type="arc" order="10"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsGrantsInPeriodWeightedAverageGrantDateFairValue_019fdcb7-ca76-7742-a3a8-3395dd9f38d9" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsGrantsInPeriodWeightedAverageGrantDateFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_019fdcb7-ca76-79fc-980f-6cec7c39dbed" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsGrantsInPeriodWeightedAverageGrantDateFairValue_019fdcb7-ca76-7742-a3a8-3395dd9f38d9" xlink:type="arc" order="11"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/STOCKCOMPENSATIONPLANSSCHEDULEOFPSUsANDRSUsACTIVITYDetails" xlink:type="simple" xlink:href="hsy-20260927.xsd#STOCKCOMPENSATIONPLANSSCHEDULEOFPSUsANDRSUsACTIVITYDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/STOCKCOMPENSATIONPLANSSCHEDULEOFPSUsANDRSUsACTIVITYDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_019fdcb7-ca76-7118-8221-6d4be8c049f1" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_019fdcb7-ca76-7652-9bd5-ff7ceeef6ce4" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_019fdcb7-ca76-7118-8221-6d4be8c049f1" xlink:to="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_019fdcb7-ca76-7652-9bd5-ff7ceeef6ce4" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AwardTypeAxis_019fdcb7-ca76-784c-97d5-e868f3547bae" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AwardTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_019fdcb7-ca76-7652-9bd5-ff7ceeef6ce4" xlink:to="loc_us-gaap_AwardTypeAxis_019fdcb7-ca76-784c-97d5-e868f3547bae" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_019fdcb7-ca76-784c-97d5-e868f3547bae_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AwardTypeAxis_019fdcb7-ca76-784c-97d5-e868f3547bae" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_019fdcb7-ca76-784c-97d5-e868f3547bae_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_019fdcb7-ca76-7cc4-b4ec-564de251041e" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AwardTypeAxis_019fdcb7-ca76-784c-97d5-e868f3547bae" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_019fdcb7-ca76-7cc4-b4ec-564de251041e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_PerformanceSharesAndRestrictedStockUnitsRSUMember_019fdcb7-ca76-7c15-8306-0c9b93947820" xlink:href="hsy-20260927.xsd#hsy_PerformanceSharesAndRestrictedStockUnitsRSUMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_019fdcb7-ca76-7cc4-b4ec-564de251041e" xlink:to="loc_hsy_PerformanceSharesAndRestrictedStockUnitsRSUMember_019fdcb7-ca76-7c15-8306-0c9b93947820" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsOutstandingRollForward_019fdcb7-ca76-7f3d-b7cc-2ab042511233" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsOutstandingRollForward"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_019fdcb7-ca76-7118-8221-6d4be8c049f1" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsOutstandingRollForward_019fdcb7-ca76-7f3d-b7cc-2ab042511233" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber_019fdcb7-ca76-7647-923f-0c9a5d4af369" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsOutstandingRollForward_019fdcb7-ca76-7f3d-b7cc-2ab042511233" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber_019fdcb7-ca76-7647-923f-0c9a5d4af369" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod_019fdcb7-ca76-7cc7-b0c1-3ae0cbc124f0" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsOutstandingRollForward_019fdcb7-ca76-7f3d-b7cc-2ab042511233" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod_019fdcb7-ca76-7cc7-b0c1-3ae0cbc124f0" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsPerformanceAssumptionChange_019fdcb7-ca76-71fb-bb81-2c5115af2455" xlink:href="hsy-20260927.xsd#hsy_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsPerformanceAssumptionChange"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsOutstandingRollForward_019fdcb7-ca76-7f3d-b7cc-2ab042511233" xlink:to="loc_hsy_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsPerformanceAssumptionChange_019fdcb7-ca76-71fb-bb81-2c5115af2455" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod_019fdcb7-ca76-7f61-b974-94ccce0e99e8" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsOutstandingRollForward_019fdcb7-ca76-7f3d-b7cc-2ab042511233" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod_019fdcb7-ca76-7f61-b974-94ccce0e99e8" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod_019fdcb7-ca76-7bb7-be02-014204fe27f3" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsOutstandingRollForward_019fdcb7-ca76-7f3d-b7cc-2ab042511233" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod_019fdcb7-ca76-7bb7-be02-014204fe27f3" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber_019fdcb7-ca76-7740-80d3-034f049ba254" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_019fdcb7-ca76-7ac8-bfec-b21383ab1d7e" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_019fdcb7-ca76-7118-8221-6d4be8c049f1" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_019fdcb7-ca76-7ac8-bfec-b21383ab1d7e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue_019fdcb7-ca76-7890-874c-79b1e1dda903" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_019fdcb7-ca76-7ac8-bfec-b21383ab1d7e" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue_019fdcb7-ca76-7890-874c-79b1e1dda903" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue_019fdcb7-ca76-7a61-bde1-11d26f79f106" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_019fdcb7-ca76-7ac8-bfec-b21383ab1d7e" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue_019fdcb7-ca76-7a61-bde1-11d26f79f106" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsPerformanceAssumptionChangeWeightedAverageGrantDateFairValue_019fdcb7-ca76-78fb-b175-a8d11b92841e" xlink:href="hsy-20260927.xsd#hsy_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsPerformanceAssumptionChangeWeightedAverageGrantDateFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_019fdcb7-ca76-7ac8-bfec-b21383ab1d7e" xlink:to="loc_hsy_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsPerformanceAssumptionChangeWeightedAverageGrantDateFairValue_019fdcb7-ca76-78fb-b175-a8d11b92841e" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue_019fdcb7-ca76-7d3b-bf4c-729b97e44cbb" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_019fdcb7-ca76-7ac8-bfec-b21383ab1d7e" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue_019fdcb7-ca76-7d3b-bf4c-729b97e44cbb" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue_019fdcb7-ca76-76af-b971-47dc0b1ea320" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_019fdcb7-ca76-7ac8-bfec-b21383ab1d7e" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue_019fdcb7-ca76-76af-b971-47dc0b1ea320" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue_019fdcb7-ca76-750b-9015-653c618300fe" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/STOCKCOMPENSATIONPLANSSCHEDULEOFPSUsANDRSUSFAIRVALUEWEIGHTEDAVERAGEASSUMPTIONSDetails" xlink:type="simple" xlink:href="hsy-20260927.xsd#STOCKCOMPENSATIONPLANSSCHEDULEOFPSUsANDRSUSFAIRVALUEWEIGHTEDAVERAGEASSUMPTIONSDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/STOCKCOMPENSATIONPLANSSCHEDULEOFPSUsANDRSUSFAIRVALUEWEIGHTEDAVERAGEASSUMPTIONSDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_019fdcb7-ca76-7639-b597-0a50bb7f73d7" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_019fdcb7-ca76-7934-880f-2ef5c7e88abe" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_019fdcb7-ca76-7639-b597-0a50bb7f73d7" xlink:to="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_019fdcb7-ca76-7934-880f-2ef5c7e88abe" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AwardTypeAxis_019fdcb7-ca76-7d46-8765-33b859322eb7" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AwardTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_019fdcb7-ca76-7934-880f-2ef5c7e88abe" xlink:to="loc_us-gaap_AwardTypeAxis_019fdcb7-ca76-7d46-8765-33b859322eb7" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_019fdcb7-ca76-7d46-8765-33b859322eb7_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AwardTypeAxis_019fdcb7-ca76-7d46-8765-33b859322eb7" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_019fdcb7-ca76-7d46-8765-33b859322eb7_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_019fdcb7-ca76-72bb-8a40-d97ca5b83736" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AwardTypeAxis_019fdcb7-ca76-7d46-8765-33b859322eb7" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_019fdcb7-ca76-72bb-8a40-d97ca5b83736" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_PerformanceSharesAndRestrictedStockUnitsRSUMember_019fdcb7-ca76-7326-bba9-0de3ad732102" xlink:href="hsy-20260927.xsd#hsy_PerformanceSharesAndRestrictedStockUnitsRSUMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_019fdcb7-ca76-72bb-8a40-d97ca5b83736" xlink:to="loc_hsy_PerformanceSharesAndRestrictedStockUnitsRSUMember_019fdcb7-ca76-7326-bba9-0de3ad732102" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod_019fdcb7-ca76-7a1c-8174-9cbf51e5543e" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_019fdcb7-ca76-7639-b597-0a50bb7f73d7" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod_019fdcb7-ca76-7a1c-8174-9cbf51e5543e" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue_019fdcb7-ca76-702d-a359-c58e6c61f1bc" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_019fdcb7-ca76-7639-b597-0a50bb7f73d7" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue_019fdcb7-ca76-702d-a359-c58e6c61f1bc" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SharePrice_019fdcb7-ca76-7e19-8145-8a3044a1fb12" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_SharePrice"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_019fdcb7-ca76-7639-b597-0a50bb7f73d7" xlink:to="loc_us-gaap_SharePrice_019fdcb7-ca76-7e19-8145-8a3044a1fb12" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedDividendRate_019fdcb7-ca76-7c36-b61f-f537e31ee954" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedDividendRate"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_019fdcb7-ca76-7639-b597-0a50bb7f73d7" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedDividendRate_019fdcb7-ca76-7c36-b61f-f537e31ee954" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedVolatilityRate_019fdcb7-ca76-7b08-b7fd-82e93debda28" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedVolatilityRate"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_019fdcb7-ca76-7639-b597-0a50bb7f73d7" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedVolatilityRate_019fdcb7-ca76-7b08-b7fd-82e93debda28" xlink:type="arc" order="4"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/SEGMENTINFORMATIONNARRATIVEDetails" xlink:type="simple" xlink:href="hsy-20260927.xsd#SEGMENTINFORMATIONNARRATIVEDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/SEGMENTINFORMATIONNARRATIVEDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EntityWideRevenueMajorCustomerLineItems_019fdcb7-ca76-73a2-940e-74462d6c7b58" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_EntityWideRevenueMajorCustomerLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfEntityWideRevenueByMajorCustomersByReportingSegmentsTable_019fdcb7-ca76-7b64-b47d-f4ca25766a8b" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ScheduleOfEntityWideRevenueByMajorCustomersByReportingSegmentsTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_EntityWideRevenueMajorCustomerLineItems_019fdcb7-ca76-73a2-940e-74462d6c7b58" xlink:to="loc_us-gaap_ScheduleOfEntityWideRevenueByMajorCustomersByReportingSegmentsTable_019fdcb7-ca76-7b64-b47d-f4ca25766a8b" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementOfIncomeLocationBalanceAxis_019fdcb7-ca76-72cb-95ea-fd3586f623a2" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_StatementOfIncomeLocationBalanceAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfEntityWideRevenueByMajorCustomersByReportingSegmentsTable_019fdcb7-ca76-7b64-b47d-f4ca25766a8b" xlink:to="loc_us-gaap_StatementOfIncomeLocationBalanceAxis_019fdcb7-ca76-72cb-95ea-fd3586f623a2" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_StatementScenarioAxis_019fdcb7-ca76-7a77-b4d8-d47527a7501c" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_StatementScenarioAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfEntityWideRevenueByMajorCustomersByReportingSegmentsTable_019fdcb7-ca76-7b64-b47d-f4ca25766a8b" xlink:to="loc_srt_StatementScenarioAxis_019fdcb7-ca76-7a77-b4d8-d47527a7501c" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ScenarioUnspecifiedDomain_019fdcb7-ca76-7a77-b4d8-d47527a7501c_default" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_ScenarioUnspecifiedDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_StatementScenarioAxis_019fdcb7-ca76-7a77-b4d8-d47527a7501c" xlink:to="loc_srt_ScenarioUnspecifiedDomain_019fdcb7-ca76-7a77-b4d8-d47527a7501c_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ScenarioUnspecifiedDomain_019fdcb7-ca76-7653-9c31-ab6c346c3f9e" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_ScenarioUnspecifiedDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_StatementScenarioAxis_019fdcb7-ca76-7a77-b4d8-d47527a7501c" xlink:to="loc_srt_ScenarioUnspecifiedDomain_019fdcb7-ca76-7653-9c31-ab6c346c3f9e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ScenarioForecastMember_019fdcb7-ca76-733f-b487-9d635d5975e6" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_ScenarioForecastMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ScenarioUnspecifiedDomain_019fdcb7-ca76-7653-9c31-ab6c346c3f9e" xlink:to="loc_srt_ScenarioForecastMember_019fdcb7-ca76-733f-b487-9d635d5975e6" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsAxis_019fdcb7-ca76-794b-adfb-5c561b99b950" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_ConsolidationItemsAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfEntityWideRevenueByMajorCustomersByReportingSegmentsTable_019fdcb7-ca76-7b64-b47d-f4ca25766a8b" xlink:to="loc_srt_ConsolidationItemsAxis_019fdcb7-ca76-794b-adfb-5c561b99b950" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsDomain_019fdcb7-ca76-794b-adfb-5c561b99b950_default" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_ConsolidationItemsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_ConsolidationItemsAxis_019fdcb7-ca76-794b-adfb-5c561b99b950" xlink:to="loc_srt_ConsolidationItemsDomain_019fdcb7-ca76-794b-adfb-5c561b99b950_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsDomain_019fdcb7-ca76-736e-ae36-2965efcbac56" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_ConsolidationItemsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_ConsolidationItemsAxis_019fdcb7-ca76-794b-adfb-5c561b99b950" xlink:to="loc_srt_ConsolidationItemsDomain_019fdcb7-ca76-736e-ae36-2965efcbac56" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingSegmentsMember_019fdcb7-ca76-7f26-9583-52f50ab0542a" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OperatingSegmentsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ConsolidationItemsDomain_019fdcb7-ca76-736e-ae36-2965efcbac56" xlink:to="loc_us-gaap_OperatingSegmentsMember_019fdcb7-ca76-7f26-9583-52f50ab0542a" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeInstrumentRiskAxis_019fdcb7-ca76-7433-a6c5-fa3c126bf28a" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DerivativeInstrumentRiskAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfEntityWideRevenueByMajorCustomersByReportingSegmentsTable_019fdcb7-ca76-7b64-b47d-f4ca25766a8b" xlink:to="loc_us-gaap_DerivativeInstrumentRiskAxis_019fdcb7-ca76-7433-a6c5-fa3c126bf28a" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_019fdcb7-ca76-7433-a6c5-fa3c126bf28a_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DerivativeContractTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_019fdcb7-ca76-7433-a6c5-fa3c126bf28a" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_019fdcb7-ca76-7433-a6c5-fa3c126bf28a_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_019fdcb7-ca76-7d83-8eac-de14f1704811" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DerivativeContractTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_019fdcb7-ca76-7433-a6c5-fa3c126bf28a" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_019fdcb7-ca76-7d83-8eac-de14f1704811" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommodityContractMember_019fdcb7-ca76-7df6-9665-785d9add676b" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CommodityContractMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_019fdcb7-ca76-7d83-8eac-de14f1704811" xlink:to="loc_us-gaap_CommodityContractMember_019fdcb7-ca76-7df6-9665-785d9add676b" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NumberOfReportableSegments_019fdcb7-ca76-7186-97f2-7bfbbf83741f" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_NumberOfReportableSegments"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EntityWideRevenueMajorCustomerLineItems_019fdcb7-ca76-73a2-940e-74462d6c7b58" xlink:to="loc_us-gaap_NumberOfReportableSegments_019fdcb7-ca76-7186-97f2-7bfbbf83741f" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_CumulativeAmountOfMarkToMarketGainsLossesOnCommodityDerivatives_019fdcb7-ca76-7afb-af84-35c388f0636c" xlink:href="hsy-20260927.xsd#hsy_CumulativeAmountOfMarkToMarketGainsLossesOnCommodityDerivatives"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EntityWideRevenueMajorCustomerLineItems_019fdcb7-ca76-73a2-940e-74462d6c7b58" xlink:to="loc_hsy_CumulativeAmountOfMarkToMarketGainsLossesOnCommodityDerivatives_019fdcb7-ca76-7afb-af84-35c388f0636c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_NetGainLossOnCommodityDerivativePositionsReclassifiedFromUnallocatedDerivativeGainsLossesToSegmentIncome_019fdcb7-ca76-79a4-8a32-47fbf4863e7d" xlink:href="hsy-20260927.xsd#hsy_NetGainLossOnCommodityDerivativePositionsReclassifiedFromUnallocatedDerivativeGainsLossesToSegmentIncome"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EntityWideRevenueMajorCustomerLineItems_019fdcb7-ca76-73a2-940e-74462d6c7b58" xlink:to="loc_hsy_NetGainLossOnCommodityDerivativePositionsReclassifiedFromUnallocatedDerivativeGainsLossesToSegmentIncome_019fdcb7-ca76-79a4-8a32-47fbf4863e7d" xlink:type="arc" order="2"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/SEGMENTINFORMATIONNARRATIVEDetails_1" xlink:type="simple" xlink:href="hsy-20260927.xsd#SEGMENTINFORMATIONNARRATIVEDetails_1"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/SEGMENTINFORMATIONNARRATIVEDetails_1" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EntityWideRevenueMajorCustomerLineItems_019fdcb7-ca76-73a2-940e-74462d6c7b58" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_EntityWideRevenueMajorCustomerLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfEntityWideRevenueByMajorCustomersByReportingSegmentsTable_019fdcb7-ca76-7b64-b47d-f4ca25766a8b" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ScheduleOfEntityWideRevenueByMajorCustomersByReportingSegmentsTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_EntityWideRevenueMajorCustomerLineItems_019fdcb7-ca76-73a2-940e-74462d6c7b58" xlink:to="loc_us-gaap_ScheduleOfEntityWideRevenueByMajorCustomersByReportingSegmentsTable_019fdcb7-ca76-7b64-b47d-f4ca25766a8b" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_StatementScenarioAxis_019fdcb7-ca76-7a77-b4d8-d47527a7501c" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_StatementScenarioAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfEntityWideRevenueByMajorCustomersByReportingSegmentsTable_019fdcb7-ca76-7b64-b47d-f4ca25766a8b" xlink:to="loc_srt_StatementScenarioAxis_019fdcb7-ca76-7a77-b4d8-d47527a7501c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ScenarioUnspecifiedDomain_019fdcb7-ca76-7a77-b4d8-d47527a7501c_default" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_ScenarioUnspecifiedDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_StatementScenarioAxis_019fdcb7-ca76-7a77-b4d8-d47527a7501c" xlink:to="loc_srt_ScenarioUnspecifiedDomain_019fdcb7-ca76-7a77-b4d8-d47527a7501c_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ScenarioUnspecifiedDomain_019fdcb7-ca76-7653-9c31-ab6c346c3f9e" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_ScenarioUnspecifiedDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_StatementScenarioAxis_019fdcb7-ca76-7a77-b4d8-d47527a7501c" xlink:to="loc_srt_ScenarioUnspecifiedDomain_019fdcb7-ca76-7653-9c31-ab6c346c3f9e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ScenarioForecastMember_019fdcb7-ca76-733f-b487-9d635d5975e6" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_ScenarioForecastMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ScenarioUnspecifiedDomain_019fdcb7-ca76-7653-9c31-ab6c346c3f9e" xlink:to="loc_srt_ScenarioForecastMember_019fdcb7-ca76-733f-b487-9d635d5975e6" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsAxis_019fdcb7-ca76-794b-adfb-5c561b99b950" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_ConsolidationItemsAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfEntityWideRevenueByMajorCustomersByReportingSegmentsTable_019fdcb7-ca76-7b64-b47d-f4ca25766a8b" xlink:to="loc_srt_ConsolidationItemsAxis_019fdcb7-ca76-794b-adfb-5c561b99b950" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsDomain_019fdcb7-ca76-794b-adfb-5c561b99b950_default" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_ConsolidationItemsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_ConsolidationItemsAxis_019fdcb7-ca76-794b-adfb-5c561b99b950" xlink:to="loc_srt_ConsolidationItemsDomain_019fdcb7-ca76-794b-adfb-5c561b99b950_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsDomain_019fdcb7-ca76-736e-ae36-2965efcbac56" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_ConsolidationItemsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_ConsolidationItemsAxis_019fdcb7-ca76-794b-adfb-5c561b99b950" xlink:to="loc_srt_ConsolidationItemsDomain_019fdcb7-ca76-736e-ae36-2965efcbac56" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingSegmentsMember_019fdcb7-ca76-7f26-9583-52f50ab0542a" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OperatingSegmentsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ConsolidationItemsDomain_019fdcb7-ca76-736e-ae36-2965efcbac56" xlink:to="loc_us-gaap_OperatingSegmentsMember_019fdcb7-ca76-7f26-9583-52f50ab0542a" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeInstrumentRiskAxis_019fdcb7-ca76-7433-a6c5-fa3c126bf28a" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DerivativeInstrumentRiskAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfEntityWideRevenueByMajorCustomersByReportingSegmentsTable_019fdcb7-ca76-7b64-b47d-f4ca25766a8b" xlink:to="loc_us-gaap_DerivativeInstrumentRiskAxis_019fdcb7-ca76-7433-a6c5-fa3c126bf28a" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_019fdcb7-ca76-7433-a6c5-fa3c126bf28a_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DerivativeContractTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_019fdcb7-ca76-7433-a6c5-fa3c126bf28a" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_019fdcb7-ca76-7433-a6c5-fa3c126bf28a_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_019fdcb7-ca76-7d83-8eac-de14f1704811" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DerivativeContractTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_019fdcb7-ca76-7433-a6c5-fa3c126bf28a" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_019fdcb7-ca76-7d83-8eac-de14f1704811" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommodityContractMember_019fdcb7-ca76-7df6-9665-785d9add676b" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CommodityContractMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_019fdcb7-ca76-7d83-8eac-de14f1704811" xlink:to="loc_us-gaap_CommodityContractMember_019fdcb7-ca76-7df6-9665-785d9add676b" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NumberOfReportableSegments_019fdcb7-ca76-7186-97f2-7bfbbf83741f" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_NumberOfReportableSegments"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EntityWideRevenueMajorCustomerLineItems_019fdcb7-ca76-73a2-940e-74462d6c7b58" xlink:to="loc_us-gaap_NumberOfReportableSegments_019fdcb7-ca76-7186-97f2-7bfbbf83741f" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_CumulativeAmountOfMarkToMarketGainsLossesOnCommodityDerivatives_019fdcb7-ca76-7afb-af84-35c388f0636c" xlink:href="hsy-20260927.xsd#hsy_CumulativeAmountOfMarkToMarketGainsLossesOnCommodityDerivatives"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EntityWideRevenueMajorCustomerLineItems_019fdcb7-ca76-73a2-940e-74462d6c7b58" xlink:to="loc_hsy_CumulativeAmountOfMarkToMarketGainsLossesOnCommodityDerivatives_019fdcb7-ca76-7afb-af84-35c388f0636c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_NetGainLossOnCommodityDerivativePositionsReclassifiedFromUnallocatedDerivativeGainsLossesToSegmentIncome_019fdcb7-ca76-79a4-8a32-47fbf4863e7d" xlink:href="hsy-20260927.xsd#hsy_NetGainLossOnCommodityDerivativePositionsReclassifiedFromUnallocatedDerivativeGainsLossesToSegmentIncome"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EntityWideRevenueMajorCustomerLineItems_019fdcb7-ca76-73a2-940e-74462d6c7b58" xlink:to="loc_hsy_NetGainLossOnCommodityDerivativePositionsReclassifiedFromUnallocatedDerivativeGainsLossesToSegmentIncome_019fdcb7-ca76-79a4-8a32-47fbf4863e7d" xlink:type="arc" order="2"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/SEGMENTINFORMATIONSCHEDULEOFNETSALESANDEARNINGSBYSEGMENTDetails" xlink:type="simple" xlink:href="hsy-20260927.xsd#SEGMENTINFORMATIONSCHEDULEOFNETSALESANDEARNINGSBYSEGMENTDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/SEGMENTINFORMATIONSCHEDULEOFNETSALESANDEARNINGSBYSEGMENTDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SegmentReportingInformationLineItems_019fdcb7-ca76-7e57-8144-aa97279d1846" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_SegmentReportingInformationLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_019fdcb7-ca76-7b20-a442-4ed153a865a4" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_019fdcb7-ca76-7e57-8144-aa97279d1846" xlink:to="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_019fdcb7-ca76-7b20-a442-4ed153a865a4" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsAxis_019fdcb7-ca76-761d-8030-897c6e885cb8" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_ConsolidationItemsAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_019fdcb7-ca76-7b20-a442-4ed153a865a4" xlink:to="loc_srt_ConsolidationItemsAxis_019fdcb7-ca76-761d-8030-897c6e885cb8" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsDomain_019fdcb7-ca76-761d-8030-897c6e885cb8_default" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_ConsolidationItemsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_ConsolidationItemsAxis_019fdcb7-ca76-761d-8030-897c6e885cb8" xlink:to="loc_srt_ConsolidationItemsDomain_019fdcb7-ca76-761d-8030-897c6e885cb8_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsDomain_019fdcb7-ca76-7330-8896-359a6bcccde4" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_ConsolidationItemsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_ConsolidationItemsAxis_019fdcb7-ca76-761d-8030-897c6e885cb8" xlink:to="loc_srt_ConsolidationItemsDomain_019fdcb7-ca76-7330-8896-359a6bcccde4" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingSegmentsMember_019fdcb7-ca76-7330-a456-13122a1f4533" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OperatingSegmentsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ConsolidationItemsDomain_019fdcb7-ca76-7330-8896-359a6bcccde4" xlink:to="loc_us-gaap_OperatingSegmentsMember_019fdcb7-ca76-7330-a456-13122a1f4533" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CorporateNonSegmentMember_019fdcb7-ca76-7370-91ec-f770114ddbd5" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CorporateNonSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ConsolidationItemsDomain_019fdcb7-ca76-7330-8896-359a6bcccde4" xlink:to="loc_us-gaap_CorporateNonSegmentMember_019fdcb7-ca76-7370-91ec-f770114ddbd5" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_MaterialReconcilingItemsMember_019fdcb7-ca76-728b-ad33-c8ad8d3594f7" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_MaterialReconcilingItemsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ConsolidationItemsDomain_019fdcb7-ca76-7330-8896-359a6bcccde4" xlink:to="loc_us-gaap_MaterialReconcilingItemsMember_019fdcb7-ca76-728b-ad33-c8ad8d3594f7" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementBusinessSegmentsAxis_019fdcb7-ca76-76ae-9429-2b0a0ed5007a" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_StatementBusinessSegmentsAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_019fdcb7-ca76-7b20-a442-4ed153a865a4" xlink:to="loc_us-gaap_StatementBusinessSegmentsAxis_019fdcb7-ca76-76ae-9429-2b0a0ed5007a" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SegmentDomain_019fdcb7-ca76-76ae-9429-2b0a0ed5007a_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_SegmentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementBusinessSegmentsAxis_019fdcb7-ca76-76ae-9429-2b0a0ed5007a" xlink:to="loc_us-gaap_SegmentDomain_019fdcb7-ca76-76ae-9429-2b0a0ed5007a_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SegmentDomain_019fdcb7-ca76-7c78-b7b5-3b7794064762" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_SegmentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementBusinessSegmentsAxis_019fdcb7-ca76-76ae-9429-2b0a0ed5007a" xlink:to="loc_us-gaap_SegmentDomain_019fdcb7-ca76-7c78-b7b5-3b7794064762" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_NorthAmericaConfectionerySegmentMember_019fdcb7-ca76-7fc4-8dfd-d7f58746c451" xlink:href="hsy-20260927.xsd#hsy_NorthAmericaConfectionerySegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentDomain_019fdcb7-ca76-7c78-b7b5-3b7794064762" xlink:to="loc_hsy_NorthAmericaConfectionerySegmentMember_019fdcb7-ca76-7fc4-8dfd-d7f58746c451" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_NorthAmericaSaltySnacksSegmentMember_019fdcb7-ca76-75bd-9e8b-5982ea2590a4" xlink:href="hsy-20260927.xsd#hsy_NorthAmericaSaltySnacksSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentDomain_019fdcb7-ca76-7c78-b7b5-3b7794064762" xlink:to="loc_hsy_NorthAmericaSaltySnacksSegmentMember_019fdcb7-ca76-75bd-9e8b-5982ea2590a4" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_InternationalSegmentMember_019fdcb7-ca76-72e0-abdc-01092ac111ce" xlink:href="hsy-20260927.xsd#hsy_InternationalSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentDomain_019fdcb7-ca76-7c78-b7b5-3b7794064762" xlink:to="loc_hsy_InternationalSegmentMember_019fdcb7-ca76-72e0-abdc-01092ac111ce" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax_019fdcb7-ca76-712b-a708-29a85e4d616f" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_019fdcb7-ca76-7e57-8144-aa97279d1846" xlink:to="loc_us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax_019fdcb7-ca76-712b-a708-29a85e4d616f" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CostOfGoodsAndServicesSold_019fdcb7-ca76-7a87-b5c9-605c86096fd8" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CostOfGoodsAndServicesSold"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_019fdcb7-ca76-7e57-8144-aa97279d1846" xlink:to="loc_us-gaap_CostOfGoodsAndServicesSold_019fdcb7-ca76-7a87-b5c9-605c86096fd8" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SellingGeneralAndAdministrativeExpense_019fdcb7-ca76-7737-b340-9421c4f946dc" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_SellingGeneralAndAdministrativeExpense"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_019fdcb7-ca76-7e57-8144-aa97279d1846" xlink:to="loc_us-gaap_SellingGeneralAndAdministrativeExpense_019fdcb7-ca76-7737-b340-9421c4f946dc" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingIncomeLoss_019fdcb7-ca76-77b4-98f1-f8e7bef7a868" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OperatingIncomeLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_019fdcb7-ca76-7e57-8144-aa97279d1846" xlink:to="loc_us-gaap_OperatingIncomeLoss_019fdcb7-ca76-77b4-98f1-f8e7bef7a868" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NonoperatingIncomeExpense_019fdcb7-ca76-7756-84cc-4efd7c7d5a18" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_NonoperatingIncomeExpense"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_019fdcb7-ca76-7e57-8144-aa97279d1846" xlink:to="loc_us-gaap_NonoperatingIncomeExpense_019fdcb7-ca76-7756-84cc-4efd7c7d5a18" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeGainLossOnDerivativeNet_019fdcb7-ca76-7853-be11-4b22d00d544e" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DerivativeGainLossOnDerivativeNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_019fdcb7-ca76-7e57-8144-aa97279d1846" xlink:to="loc_us-gaap_DerivativeGainLossOnDerivativeNet_019fdcb7-ca76-7853-be11-4b22d00d544e" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_DerivativeGainLossStatementOfIncomeOrComprehensiveIncomeExtensibleEnumerationNotDisclosedFlag_019fdcb7-ca76-7222-acdb-71a62a094756" xlink:href="hsy-20260927.xsd#hsy_DerivativeGainLossStatementOfIncomeOrComprehensiveIncomeExtensibleEnumerationNotDisclosedFlag"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeGainLossOnDerivativeNet_019fdcb7-ca76-7853-be11-4b22d00d544e" xlink:to="loc_hsy_DerivativeGainLossStatementOfIncomeOrComprehensiveIncomeExtensibleEnumerationNotDisclosedFlag_019fdcb7-ca76-7222-acdb-71a62a094756" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringCharges_019fdcb7-ca76-7144-9ed8-0a816a927166" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RestructuringCharges"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_019fdcb7-ca76-7e57-8144-aa97279d1846" xlink:to="loc_us-gaap_RestructuringCharges_019fdcb7-ca76-7144-9ed8-0a816a927166" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InterestIncomeExpenseNonoperatingNet_019fdcb7-ca76-77e6-a322-84e4bb712dd1" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_InterestIncomeExpenseNonoperatingNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_019fdcb7-ca76-7e57-8144-aa97279d1846" xlink:to="loc_us-gaap_InterestIncomeExpenseNonoperatingNet_019fdcb7-ca76-77e6-a322-84e4bb712dd1" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherNonoperatingIncomeExpense_019fdcb7-ca76-7308-afcb-119b884a4a85" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OtherNonoperatingIncomeExpense"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_019fdcb7-ca76-7e57-8144-aa97279d1846" xlink:to="loc_us-gaap_OtherNonoperatingIncomeExpense_019fdcb7-ca76-7308-afcb-119b884a4a85" xlink:type="arc" order="8"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_019fdcb7-ca76-7eb9-8ab0-efe1ba86c670" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_019fdcb7-ca76-7e57-8144-aa97279d1846" xlink:to="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_019fdcb7-ca76-7eb9-8ab0-efe1ba86c670" xlink:type="arc" order="9"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/SEGMENTINFORMATIONSCHEDULEOFUNALLOCATEDMARKTOMARKETGAINSLOSSESONCOMMODITYDERIVATIVESDetails" xlink:type="simple" xlink:href="hsy-20260927.xsd#SEGMENTINFORMATIONSCHEDULEOFUNALLOCATEDMARKTOMARKETGAINSLOSSESONCOMMODITYDERIVATIVESDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/SEGMENTINFORMATIONSCHEDULEOFUNALLOCATEDMARKTOMARKETGAINSLOSSESONCOMMODITYDERIVATIVESDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SegmentReportingInformationLineItems_019fdcb7-ca76-7ac9-871b-4429c49af8e2" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_SegmentReportingInformationLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_019fdcb7-ca76-740f-bf0f-e7c823b6da4e" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_019fdcb7-ca76-7ac9-871b-4429c49af8e2" xlink:to="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_019fdcb7-ca76-740f-bf0f-e7c823b6da4e" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationAxis_019fdcb7-ca76-763c-acfc-f141b67a9637" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_HedgingDesignationAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_019fdcb7-ca76-740f-bf0f-e7c823b6da4e" xlink:to="loc_us-gaap_HedgingDesignationAxis_019fdcb7-ca76-763c-acfc-f141b67a9637" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationDomain_019fdcb7-ca76-763c-acfc-f141b67a9637_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_HedgingDesignationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_HedgingDesignationAxis_019fdcb7-ca76-763c-acfc-f141b67a9637" xlink:to="loc_us-gaap_HedgingDesignationDomain_019fdcb7-ca76-763c-acfc-f141b67a9637_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationDomain_019fdcb7-ca76-7515-bdb0-7a4c1652d860" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_HedgingDesignationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_HedgingDesignationAxis_019fdcb7-ca76-763c-acfc-f141b67a9637" xlink:to="loc_us-gaap_HedgingDesignationDomain_019fdcb7-ca76-7515-bdb0-7a4c1652d860" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NondesignatedMember_019fdcb7-ca76-7ca1-9b01-9fccdb05806b" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_NondesignatedMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_HedgingDesignationDomain_019fdcb7-ca76-7515-bdb0-7a4c1652d860" xlink:to="loc_us-gaap_NondesignatedMember_019fdcb7-ca76-7ca1-9b01-9fccdb05806b" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeInstrumentRiskAxis_019fdcb7-ca76-743c-aa8c-3da99b11818b" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DerivativeInstrumentRiskAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_019fdcb7-ca76-740f-bf0f-e7c823b6da4e" xlink:to="loc_us-gaap_DerivativeInstrumentRiskAxis_019fdcb7-ca76-743c-aa8c-3da99b11818b" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_019fdcb7-ca76-743c-aa8c-3da99b11818b_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DerivativeContractTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_019fdcb7-ca76-743c-aa8c-3da99b11818b" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_019fdcb7-ca76-743c-aa8c-3da99b11818b_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_019fdcb7-ca76-7e99-be80-8233702dbc13" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DerivativeContractTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_019fdcb7-ca76-743c-aa8c-3da99b11818b" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_019fdcb7-ca76-7e99-be80-8233702dbc13" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommodityContractMember_019fdcb7-ca76-7f62-a5c3-745138e9c691" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CommodityContractMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_019fdcb7-ca76-7e99-be80-8233702dbc13" xlink:to="loc_us-gaap_CommodityContractMember_019fdcb7-ca76-7f62-a5c3-745138e9c691" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsAxis_019fdcb7-ca76-78ab-875c-c5b4889a4f94" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_ConsolidationItemsAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_019fdcb7-ca76-740f-bf0f-e7c823b6da4e" xlink:to="loc_srt_ConsolidationItemsAxis_019fdcb7-ca76-78ab-875c-c5b4889a4f94" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsDomain_019fdcb7-ca76-78ab-875c-c5b4889a4f94_default" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_ConsolidationItemsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_ConsolidationItemsAxis_019fdcb7-ca76-78ab-875c-c5b4889a4f94" xlink:to="loc_srt_ConsolidationItemsDomain_019fdcb7-ca76-78ab-875c-c5b4889a4f94_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsDomain_019fdcb7-ca76-79a4-baf3-4f57ba106a1b" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_ConsolidationItemsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_ConsolidationItemsAxis_019fdcb7-ca76-78ab-875c-c5b4889a4f94" xlink:to="loc_srt_ConsolidationItemsDomain_019fdcb7-ca76-79a4-baf3-4f57ba106a1b" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingSegmentsMember_019fdcb7-ca76-7f49-ae39-f62e88d8ae3b" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OperatingSegmentsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ConsolidationItemsDomain_019fdcb7-ca76-79a4-baf3-4f57ba106a1b" xlink:to="loc_us-gaap_OperatingSegmentsMember_019fdcb7-ca76-7f49-ae39-f62e88d8ae3b" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeGainLossOnDerivativeNet_019fdcb7-ca76-79d5-8291-1db73731b925" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DerivativeGainLossOnDerivativeNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_019fdcb7-ca76-7ac9-871b-4429c49af8e2" xlink:to="loc_us-gaap_DerivativeGainLossOnDerivativeNet_019fdcb7-ca76-79d5-8291-1db73731b925" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_NetGainLossOnCommodityDerivativePositionsReclassifiedFromUnallocatedDerivativeGainsLossesToSegmentIncome_019fdcb7-ca76-7fad-a007-6e51f1c35023" xlink:href="hsy-20260927.xsd#hsy_NetGainLossOnCommodityDerivativePositionsReclassifiedFromUnallocatedDerivativeGainsLossesToSegmentIncome"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_019fdcb7-ca76-7ac9-871b-4429c49af8e2" xlink:to="loc_hsy_NetGainLossOnCommodityDerivativePositionsReclassifiedFromUnallocatedDerivativeGainsLossesToSegmentIncome_019fdcb7-ca76-7fad-a007-6e51f1c35023" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_NetMarktoMarketValuationofCertainDerivativePositionsRecognizedinUnallocatedDerivativeGainsLosses_019fdcb7-ca76-762e-88ef-303af94a015f" xlink:href="hsy-20260927.xsd#hsy_NetMarktoMarketValuationofCertainDerivativePositionsRecognizedinUnallocatedDerivativeGainsLosses"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_019fdcb7-ca76-7ac9-871b-4429c49af8e2" xlink:to="loc_hsy_NetMarktoMarketValuationofCertainDerivativePositionsRecognizedinUnallocatedDerivativeGainsLosses_019fdcb7-ca76-762e-88ef-303af94a015f" xlink:type="arc" order="2"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/SEGMENTINFORMATIONSCHEDULEOFDEPRECIATIONANDAMORTIZATIONEXPENSEINCLUDEDWITHINSEGMENTINCOMEDetails" xlink:type="simple" xlink:href="hsy-20260927.xsd#SEGMENTINFORMATIONSCHEDULEOFDEPRECIATIONANDAMORTIZATIONEXPENSEINCLUDEDWITHINSEGMENTINCOMEDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/SEGMENTINFORMATIONSCHEDULEOFDEPRECIATIONANDAMORTIZATIONEXPENSEINCLUDEDWITHINSEGMENTINCOMEDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SegmentReportingInformationLineItems_019fdcb7-ca76-7915-a4f6-9d0736504ae9" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_SegmentReportingInformationLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_019fdcb7-ca76-7c8c-81c2-d3df2b51adac" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_019fdcb7-ca76-7915-a4f6-9d0736504ae9" xlink:to="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_019fdcb7-ca76-7c8c-81c2-d3df2b51adac" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsAxis_019fdcb7-ca76-7471-b097-24fbd73649e9" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_ConsolidationItemsAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_019fdcb7-ca76-7c8c-81c2-d3df2b51adac" xlink:to="loc_srt_ConsolidationItemsAxis_019fdcb7-ca76-7471-b097-24fbd73649e9" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsDomain_019fdcb7-ca76-7471-b097-24fbd73649e9_default" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_ConsolidationItemsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_ConsolidationItemsAxis_019fdcb7-ca76-7471-b097-24fbd73649e9" xlink:to="loc_srt_ConsolidationItemsDomain_019fdcb7-ca76-7471-b097-24fbd73649e9_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsDomain_019fdcb7-ca76-7c19-8920-172fac07eb8a" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_ConsolidationItemsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_ConsolidationItemsAxis_019fdcb7-ca76-7471-b097-24fbd73649e9" xlink:to="loc_srt_ConsolidationItemsDomain_019fdcb7-ca76-7c19-8920-172fac07eb8a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingSegmentsMember_019fdcb7-ca76-73f9-b09f-0ac73ab8b7ac" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OperatingSegmentsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ConsolidationItemsDomain_019fdcb7-ca76-7c19-8920-172fac07eb8a" xlink:to="loc_us-gaap_OperatingSegmentsMember_019fdcb7-ca76-73f9-b09f-0ac73ab8b7ac" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CorporateNonSegmentMember_019fdcb7-ca76-7868-ab8e-a875a5b90c18" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CorporateNonSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ConsolidationItemsDomain_019fdcb7-ca76-7c19-8920-172fac07eb8a" xlink:to="loc_us-gaap_CorporateNonSegmentMember_019fdcb7-ca76-7868-ab8e-a875a5b90c18" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementBusinessSegmentsAxis_019fdcb7-ca76-7c5d-91a9-9d7bf67d7b4a" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_StatementBusinessSegmentsAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_019fdcb7-ca76-7c8c-81c2-d3df2b51adac" xlink:to="loc_us-gaap_StatementBusinessSegmentsAxis_019fdcb7-ca76-7c5d-91a9-9d7bf67d7b4a" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SegmentDomain_019fdcb7-ca76-7c5d-91a9-9d7bf67d7b4a_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_SegmentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementBusinessSegmentsAxis_019fdcb7-ca76-7c5d-91a9-9d7bf67d7b4a" xlink:to="loc_us-gaap_SegmentDomain_019fdcb7-ca76-7c5d-91a9-9d7bf67d7b4a_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SegmentDomain_019fdcb7-ca76-78cc-8599-b8963e2d5876" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_SegmentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementBusinessSegmentsAxis_019fdcb7-ca76-7c5d-91a9-9d7bf67d7b4a" xlink:to="loc_us-gaap_SegmentDomain_019fdcb7-ca76-78cc-8599-b8963e2d5876" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_NorthAmericaConfectionerySegmentMember_019fdcb7-ca76-73b9-a6e8-b69978996813" xlink:href="hsy-20260927.xsd#hsy_NorthAmericaConfectionerySegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentDomain_019fdcb7-ca76-78cc-8599-b8963e2d5876" xlink:to="loc_hsy_NorthAmericaConfectionerySegmentMember_019fdcb7-ca76-73b9-a6e8-b69978996813" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_NorthAmericaSaltySnacksSegmentMember_019fdcb7-ca76-738f-85af-54f838834761" xlink:href="hsy-20260927.xsd#hsy_NorthAmericaSaltySnacksSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentDomain_019fdcb7-ca76-78cc-8599-b8963e2d5876" xlink:to="loc_hsy_NorthAmericaSaltySnacksSegmentMember_019fdcb7-ca76-738f-85af-54f838834761" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_InternationalSegmentMember_019fdcb7-ca76-7685-b4e5-d26ffc588828" xlink:href="hsy-20260927.xsd#hsy_InternationalSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentDomain_019fdcb7-ca76-78cc-8599-b8963e2d5876" xlink:to="loc_hsy_InternationalSegmentMember_019fdcb7-ca76-7685-b4e5-d26ffc588828" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CorporateMember_019fdcb7-ca76-7325-a8b7-ef1063c63271" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CorporateMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentDomain_019fdcb7-ca76-78cc-8599-b8963e2d5876" xlink:to="loc_us-gaap_CorporateMember_019fdcb7-ca76-7325-a8b7-ef1063c63271" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DepreciationDepletionAndAmortization_019fdcb7-ca76-70b8-aa45-63e9f90fd364" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DepreciationDepletionAndAmortization"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_019fdcb7-ca76-7915-a4f6-9d0736504ae9" xlink:to="loc_us-gaap_DepreciationDepletionAndAmortization_019fdcb7-ca76-70b8-aa45-63e9f90fd364" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/SEGMENTINFORMATIONSCHEDULEOFSEGMENTINFORMATIONBYGEOGRAPHYDetails" xlink:type="simple" xlink:href="hsy-20260927.xsd#SEGMENTINFORMATIONSCHEDULEOFSEGMENTINFORMATIONBYGEOGRAPHYDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/SEGMENTINFORMATIONSCHEDULEOFSEGMENTINFORMATIONBYGEOGRAPHYDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EntityWideRevenueMajorCustomerLineItems_019fdcb7-ca76-79dc-a1f3-f1577bf356e3" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_EntityWideRevenueMajorCustomerLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfEntityWideRevenueByMajorCustomersByReportingSegmentsTable_019fdcb7-ca76-780e-97fd-6dce1d46aa7a" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ScheduleOfEntityWideRevenueByMajorCustomersByReportingSegmentsTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_EntityWideRevenueMajorCustomerLineItems_019fdcb7-ca76-79dc-a1f3-f1577bf356e3" xlink:to="loc_us-gaap_ScheduleOfEntityWideRevenueByMajorCustomersByReportingSegmentsTable_019fdcb7-ca76-780e-97fd-6dce1d46aa7a" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_StatementGeographicalAxis_019fdcb7-ca76-75a0-a1f7-5716d53e945a" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_StatementGeographicalAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfEntityWideRevenueByMajorCustomersByReportingSegmentsTable_019fdcb7-ca76-780e-97fd-6dce1d46aa7a" xlink:to="loc_srt_StatementGeographicalAxis_019fdcb7-ca76-75a0-a1f7-5716d53e945a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_SegmentGeographicalDomain_019fdcb7-ca76-75a0-a1f7-5716d53e945a_default" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_SegmentGeographicalDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_StatementGeographicalAxis_019fdcb7-ca76-75a0-a1f7-5716d53e945a" xlink:to="loc_srt_SegmentGeographicalDomain_019fdcb7-ca76-75a0-a1f7-5716d53e945a_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_SegmentGeographicalDomain_019fdcb7-ca76-74f9-b5be-8529686cd875" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_SegmentGeographicalDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_StatementGeographicalAxis_019fdcb7-ca76-75a0-a1f7-5716d53e945a" xlink:to="loc_srt_SegmentGeographicalDomain_019fdcb7-ca76-74f9-b5be-8529686cd875" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_country_US_019fdcb7-ca76-7669-9917-df7f44a3275c" xlink:href="https://xbrl.sec.gov/country/2026/country-2026.xsd#country_US"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_SegmentGeographicalDomain_019fdcb7-ca76-74f9-b5be-8529686cd875" xlink:to="loc_country_US_019fdcb7-ca76-7669-9917-df7f44a3275c" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NonUsMember_019fdcb7-ca76-7162-b565-c7431888b6ae" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_NonUsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_SegmentGeographicalDomain_019fdcb7-ca76-74f9-b5be-8529686cd875" xlink:to="loc_us-gaap_NonUsMember_019fdcb7-ca76-7162-b565-c7431888b6ae" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax_019fdcb7-ca76-7a7f-82a6-91b81a8ce2a0" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EntityWideRevenueMajorCustomerLineItems_019fdcb7-ca76-79dc-a1f3-f1577bf356e3" xlink:to="loc_us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax_019fdcb7-ca76-7a7f-82a6-91b81a8ce2a0" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/TREASURYSTOCKACTIVITYSCHEDULEOFTREASURYSTOCKACTIVITYDetails" xlink:type="simple" xlink:href="hsy-20260927.xsd#TREASURYSTOCKACTIVITYSCHEDULEOFTREASURYSTOCKACTIVITYDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/TREASURYSTOCKACTIVITYSCHEDULEOFTREASURYSTOCKACTIVITYDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockLineItems_019fdcb7-ca76-7d71-857c-84c756485c0a" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ClassOfStockLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfStockByClassTable_019fdcb7-ca76-78e2-983a-a8cb8c8968f9" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ScheduleOfStockByClassTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ClassOfStockLineItems_019fdcb7-ca76-7d71-857c-84c756485c0a" xlink:to="loc_us-gaap_ScheduleOfStockByClassTable_019fdcb7-ca76-78e2-983a-a8cb8c8968f9" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AwardTypeAxis_019fdcb7-ca76-777c-8478-c84b7f33cef6" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AwardTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfStockByClassTable_019fdcb7-ca76-78e2-983a-a8cb8c8968f9" xlink:to="loc_us-gaap_AwardTypeAxis_019fdcb7-ca76-777c-8478-c84b7f33cef6" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_019fdcb7-ca76-777c-8478-c84b7f33cef6_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AwardTypeAxis_019fdcb7-ca76-777c-8478-c84b7f33cef6" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_019fdcb7-ca76-777c-8478-c84b7f33cef6_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_019fdcb7-ca76-772f-939c-8c46eb7f0066" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AwardTypeAxis_019fdcb7-ca76-777c-8478-c84b7f33cef6" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_019fdcb7-ca76-772f-939c-8c46eb7f0066" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeStockOptionMember_019fdcb7-ca76-79d6-b7e0-11dff94749a3" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_EmployeeStockOptionMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_019fdcb7-ca76-772f-939c-8c46eb7f0066" xlink:to="loc_us-gaap_EmployeeStockOptionMember_019fdcb7-ca76-79d6-b7e0-11dff94749a3" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementClassOfStockAxis_019fdcb7-ca76-739c-aeda-fcfcc510518e" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_StatementClassOfStockAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfStockByClassTable_019fdcb7-ca76-78e2-983a-a8cb8c8968f9" xlink:to="loc_us-gaap_StatementClassOfStockAxis_019fdcb7-ca76-739c-aeda-fcfcc510518e" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_019fdcb7-ca76-739c-aeda-fcfcc510518e_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementClassOfStockAxis_019fdcb7-ca76-739c-aeda-fcfcc510518e" xlink:to="loc_us-gaap_ClassOfStockDomain_019fdcb7-ca76-739c-aeda-fcfcc510518e_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_019fdcb7-ca76-7eb0-9140-488e92b08683" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementClassOfStockAxis_019fdcb7-ca76-739c-aeda-fcfcc510518e" xlink:to="loc_us-gaap_ClassOfStockDomain_019fdcb7-ca76-7eb0-9140-488e92b08683" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_HersheyCommonStockMember_019fdcb7-ca76-7867-9498-e5e2ad3511bc" xlink:href="hsy-20260927.xsd#hsy_HersheyCommonStockMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_019fdcb7-ca76-7eb0-9140-488e92b08683" xlink:to="loc_hsy_HersheyCommonStockMember_019fdcb7-ca76-7867-9498-e5e2ad3511bc" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockIssuedDuringPeriodSharebasedCompensationAbstract_019fdcb7-ca76-7054-9ee8-1d1d98a71a9e" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_StockIssuedDuringPeriodSharebasedCompensationAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockLineItems_019fdcb7-ca76-7d71-857c-84c756485c0a" xlink:to="loc_us-gaap_StockIssuedDuringPeriodSharebasedCompensationAbstract_019fdcb7-ca76-7054-9ee8-1d1d98a71a9e" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TreasuryStockSharesAcquired_019fdcb7-ca76-7013-8726-23709ccb36dd" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_TreasuryStockSharesAcquired"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StockIssuedDuringPeriodSharebasedCompensationAbstract_019fdcb7-ca76-7054-9ee8-1d1d98a71a9e" xlink:to="loc_us-gaap_TreasuryStockSharesAcquired_019fdcb7-ca76-7013-8726-23709ccb36dd" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockIssuedDuringPeriodSharesShareBasedCompensationGross_019fdcb7-ca76-74cb-b412-32617b557fb0" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_StockIssuedDuringPeriodSharesShareBasedCompensationGross"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StockIssuedDuringPeriodSharebasedCompensationAbstract_019fdcb7-ca76-7054-9ee8-1d1d98a71a9e" xlink:to="loc_us-gaap_StockIssuedDuringPeriodSharesShareBasedCompensationGross_019fdcb7-ca76-74cb-b412-32617b557fb0" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_TreasuryStockSharesExcludingExciseTax_019fdcb7-ca76-7d11-97b7-c80f3b77b2b1" xlink:href="hsy-20260927.xsd#hsy_TreasuryStockSharesExcludingExciseTax"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StockIssuedDuringPeriodSharebasedCompensationAbstract_019fdcb7-ca76-7054-9ee8-1d1d98a71a9e" xlink:to="loc_hsy_TreasuryStockSharesExcludingExciseTax_019fdcb7-ca76-7d11-97b7-c80f3b77b2b1" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_TreasuryStockSharesExciseTax_019fdcb7-ca76-7068-9a79-f37067895922" xlink:href="hsy-20260927.xsd#hsy_TreasuryStockSharesExciseTax"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StockIssuedDuringPeriodSharebasedCompensationAbstract_019fdcb7-ca76-7054-9ee8-1d1d98a71a9e" xlink:to="loc_hsy_TreasuryStockSharesExciseTax_019fdcb7-ca76-7068-9a79-f37067895922" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_TreasuryStockSharesNetChangeDuringPeriod_019fdcb7-ca76-74ac-af6a-e98c0d274fcd" xlink:href="hsy-20260927.xsd#hsy_TreasuryStockSharesNetChangeDuringPeriod"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StockIssuedDuringPeriodSharebasedCompensationAbstract_019fdcb7-ca76-7054-9ee8-1d1d98a71a9e" xlink:to="loc_hsy_TreasuryStockSharesNetChangeDuringPeriod_019fdcb7-ca76-74ac-af6a-e98c0d274fcd" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ShareRepurchaseProgramAbstract_019fdcb7-ca76-79ea-86fe-97abde49aa5b" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_ShareRepurchaseProgramAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockLineItems_019fdcb7-ca76-7d71-857c-84c756485c0a" xlink:to="loc_srt_ShareRepurchaseProgramAbstract_019fdcb7-ca76-79ea-86fe-97abde49aa5b" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockRepurchasedDuringPeriodValue_019fdcb7-ca76-7944-892e-ab9b224594a0" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_StockRepurchasedDuringPeriodValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ShareRepurchaseProgramAbstract_019fdcb7-ca76-79ea-86fe-97abde49aa5b" xlink:to="loc_us-gaap_StockRepurchasedDuringPeriodValue_019fdcb7-ca76-7944-892e-ab9b224594a0" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockIssuedDuringPeriodValueShareBasedCompensationGross_019fdcb7-ca76-740b-9e81-a2473ed81c81" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_StockIssuedDuringPeriodValueShareBasedCompensationGross"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ShareRepurchaseProgramAbstract_019fdcb7-ca76-79ea-86fe-97abde49aa5b" xlink:to="loc_us-gaap_StockIssuedDuringPeriodValueShareBasedCompensationGross_019fdcb7-ca76-740b-9e81-a2473ed81c81" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_TreasuryStockValueExcludingExciseTax_019fdcb7-ca76-7687-b48e-16db367208ab" xlink:href="hsy-20260927.xsd#hsy_TreasuryStockValueExcludingExciseTax"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ShareRepurchaseProgramAbstract_019fdcb7-ca76-79ea-86fe-97abde49aa5b" xlink:to="loc_hsy_TreasuryStockValueExcludingExciseTax_019fdcb7-ca76-7687-b48e-16db367208ab" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_TreasuryStockValueExciseTax_019fdcb7-ca76-7ee1-ae29-ffbe945880a8" xlink:href="hsy-20260927.xsd#hsy_TreasuryStockValueExciseTax"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ShareRepurchaseProgramAbstract_019fdcb7-ca76-79ea-86fe-97abde49aa5b" xlink:to="loc_hsy_TreasuryStockValueExciseTax_019fdcb7-ca76-7ee1-ae29-ffbe945880a8" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_TreasuryStockAmountNetChangeDuringPeriod_019fdcb7-ca76-7bfd-8f0d-de8df3e84280" xlink:href="hsy-20260927.xsd#hsy_TreasuryStockAmountNetChangeDuringPeriod"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ShareRepurchaseProgramAbstract_019fdcb7-ca76-79ea-86fe-97abde49aa5b" xlink:to="loc_hsy_TreasuryStockAmountNetChangeDuringPeriod_019fdcb7-ca76-7bfd-8f0d-de8df3e84280" xlink:type="arc" order="5"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/TREASURYSTOCKACTIVITYNARRATIVEDetails" xlink:type="simple" xlink:href="hsy-20260927.xsd#TREASURYSTOCKACTIVITYNARRATIVEDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/TREASURYSTOCKACTIVITYNARRATIVEDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquityClassOfTreasuryStockLineItems_019fdcb7-ca76-7b82-ab2b-00ac32f688e9" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_EquityClassOfTreasuryStockLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfTreasuryStockTable_019fdcb7-ca76-77a3-a623-8fc989701c29" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ClassOfTreasuryStockTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_EquityClassOfTreasuryStockLineItems_019fdcb7-ca76-7b82-ab2b-00ac32f688e9" xlink:to="loc_us-gaap_ClassOfTreasuryStockTable_019fdcb7-ca76-77a3-a623-8fc989701c29" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ShareRepurchaseProgramAxis_019fdcb7-ca76-776d-a50e-d9d70bce3fbc" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_ShareRepurchaseProgramAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ClassOfTreasuryStockTable_019fdcb7-ca76-77a3-a623-8fc989701c29" xlink:to="loc_srt_ShareRepurchaseProgramAxis_019fdcb7-ca76-776d-a50e-d9d70bce3fbc" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ShareRepurchaseProgramDomain_019fdcb7-ca76-776d-a50e-d9d70bce3fbc_default" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_ShareRepurchaseProgramDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_ShareRepurchaseProgramAxis_019fdcb7-ca76-776d-a50e-d9d70bce3fbc" xlink:to="loc_srt_ShareRepurchaseProgramDomain_019fdcb7-ca76-776d-a50e-d9d70bce3fbc_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ShareRepurchaseProgramDomain_019fdcb7-ca76-7e20-880e-9038dd7e89ce" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_ShareRepurchaseProgramDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_ShareRepurchaseProgramAxis_019fdcb7-ca76-776d-a50e-d9d70bce3fbc" xlink:to="loc_srt_ShareRepurchaseProgramDomain_019fdcb7-ca76-7e20-880e-9038dd7e89ce" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_A2023ShareRepurchaseProgramMember_019fdcb7-ca76-7b9c-8746-780f43238a37" xlink:href="hsy-20260927.xsd#hsy_A2023ShareRepurchaseProgramMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ShareRepurchaseProgramDomain_019fdcb7-ca76-7e20-880e-9038dd7e89ce" xlink:to="loc_hsy_A2023ShareRepurchaseProgramMember_019fdcb7-ca76-7b9c-8746-780f43238a37" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_A2026ShareRepurchaseProgramMember_019fdcb7-ca76-711d-aa01-248b16e2250d" xlink:href="hsy-20260927.xsd#hsy_A2026ShareRepurchaseProgramMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ShareRepurchaseProgramDomain_019fdcb7-ca76-7e20-880e-9038dd7e89ce" xlink:to="loc_hsy_A2026ShareRepurchaseProgramMember_019fdcb7-ca76-711d-aa01-248b16e2250d" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_StockRepurchaseProgramAuthorizedAmount1_019fdcb7-ca76-7ac4-ad9b-da8e026755e7" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-2026.xsd#srt_StockRepurchaseProgramAuthorizedAmount1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityClassOfTreasuryStockLineItems_019fdcb7-ca76-7b82-ab2b-00ac32f688e9" xlink:to="loc_srt_StockRepurchaseProgramAuthorizedAmount1_019fdcb7-ca76-7ac4-ad9b-da8e026755e7" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockRepurchaseProgramRemainingAuthorizedRepurchaseAmount1_019fdcb7-ca76-72e7-900f-23599ce46097" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_StockRepurchaseProgramRemainingAuthorizedRepurchaseAmount1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityClassOfTreasuryStockLineItems_019fdcb7-ca76-7b82-ab2b-00ac32f688e9" xlink:to="loc_us-gaap_StockRepurchaseProgramRemainingAuthorizedRepurchaseAmount1_019fdcb7-ca76-72e7-900f-23599ce46097" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/EARNINGSPERSHARESCHEDULEOFBASICANDDILUTEDEARNINGSPERSHAREDetails" xlink:type="simple" xlink:href="hsy-20260927.xsd#EARNINGSPERSHARESCHEDULEOFBASICANDDILUTEDEARNINGSPERSHAREDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/EARNINGSPERSHARESCHEDULEOFBASICANDDILUTEDEARNINGSPERSHAREDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EarningsPerShareBasicLineItems_019fdcb7-ca76-7822-99f5-0c8659a812d6" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_EarningsPerShareBasicLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfEarningsPerShareBasicByCommonClassTable_019fdcb7-ca76-72ae-be2e-da3877884db4" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ScheduleOfEarningsPerShareBasicByCommonClassTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_EarningsPerShareBasicLineItems_019fdcb7-ca76-7822-99f5-0c8659a812d6" xlink:to="loc_us-gaap_ScheduleOfEarningsPerShareBasicByCommonClassTable_019fdcb7-ca76-72ae-be2e-da3877884db4" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementClassOfStockAxis_019fdcb7-ca76-7f99-937f-b2854d4b7b30" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_StatementClassOfStockAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfEarningsPerShareBasicByCommonClassTable_019fdcb7-ca76-72ae-be2e-da3877884db4" xlink:to="loc_us-gaap_StatementClassOfStockAxis_019fdcb7-ca76-7f99-937f-b2854d4b7b30" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_019fdcb7-ca76-7f99-937f-b2854d4b7b30_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementClassOfStockAxis_019fdcb7-ca76-7f99-937f-b2854d4b7b30" xlink:to="loc_us-gaap_ClassOfStockDomain_019fdcb7-ca76-7f99-937f-b2854d4b7b30_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_019fdcb7-ca76-7c0b-b38e-37292be5a82b" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementClassOfStockAxis_019fdcb7-ca76-7f99-937f-b2854d4b7b30" xlink:to="loc_us-gaap_ClassOfStockDomain_019fdcb7-ca76-7c0b-b38e-37292be5a82b" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockMember_019fdcb7-ca76-7000-a37b-d56ee9618ea4" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CommonStockMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_019fdcb7-ca76-7c0b-b38e-37292be5a82b" xlink:to="loc_us-gaap_CommonStockMember_019fdcb7-ca76-7000-a37b-d56ee9618ea4" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonClassBMember_019fdcb7-ca76-7fea-9ae2-6b274a5a00f6" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CommonClassBMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_019fdcb7-ca76-7c0b-b38e-37292be5a82b" xlink:to="loc_us-gaap_CommonClassBMember_019fdcb7-ca76-7fea-9ae2-6b274a5a00f6" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AwardTypeAxis_019fdcb7-ca76-7fbe-984c-4b3989cdbecb" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AwardTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfEarningsPerShareBasicByCommonClassTable_019fdcb7-ca76-72ae-be2e-da3877884db4" xlink:to="loc_us-gaap_AwardTypeAxis_019fdcb7-ca76-7fbe-984c-4b3989cdbecb" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_019fdcb7-ca76-7fbe-984c-4b3989cdbecb_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AwardTypeAxis_019fdcb7-ca76-7fbe-984c-4b3989cdbecb" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_019fdcb7-ca76-7fbe-984c-4b3989cdbecb_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_019fdcb7-ca76-737b-833c-ad7445c81d72" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AwardTypeAxis_019fdcb7-ca76-7fbe-984c-4b3989cdbecb" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_019fdcb7-ca76-737b-833c-ad7445c81d72" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeStockOptionMember_019fdcb7-ca76-795f-b379-a6722f24b3dc" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_EmployeeStockOptionMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_019fdcb7-ca76-737b-833c-ad7445c81d72" xlink:to="loc_us-gaap_EmployeeStockOptionMember_019fdcb7-ca76-795f-b379-a6722f24b3dc" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_PerformanceSharesAndRestrictedStockUnitsRSUMember_019fdcb7-ca76-787d-8ddb-21df83a31bff" xlink:href="hsy-20260927.xsd#hsy_PerformanceSharesAndRestrictedStockUnitsRSUMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_019fdcb7-ca76-737b-833c-ad7445c81d72" xlink:to="loc_hsy_PerformanceSharesAndRestrictedStockUnitsRSUMember_019fdcb7-ca76-787d-8ddb-21df83a31bff" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EarningsPerShareBasicTwoClassMethodAbstract_019fdcb7-ca76-71f8-8adc-6aff8a5b2e9c" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_EarningsPerShareBasicTwoClassMethodAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareBasicLineItems_019fdcb7-ca76-7822-99f5-0c8659a812d6" xlink:to="loc_us-gaap_EarningsPerShareBasicTwoClassMethodAbstract_019fdcb7-ca76-71f8-8adc-6aff8a5b2e9c" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Dividends_019fdcb7-ca76-776a-8ee7-192b63ded4a3" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_Dividends"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareBasicTwoClassMethodAbstract_019fdcb7-ca76-71f8-8adc-6aff8a5b2e9c" xlink:to="loc_us-gaap_Dividends_019fdcb7-ca76-776a-8ee7-192b63ded4a3" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_UndistributedEarningsLossAllocatedToParticipatingSecuritiesBasic_019fdcb7-ca76-776c-a1dd-275bcdddd7ef" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_UndistributedEarningsLossAllocatedToParticipatingSecuritiesBasic"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareBasicTwoClassMethodAbstract_019fdcb7-ca76-71f8-8adc-6aff8a5b2e9c" xlink:to="loc_us-gaap_UndistributedEarningsLossAllocatedToParticipatingSecuritiesBasic_019fdcb7-ca76-776c-a1dd-275bcdddd7ef" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ParticipatingSecuritiesDistributedAndUndistributedEarningsLossBasic_019fdcb7-ca76-7150-9417-3b5a86a2680e" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ParticipatingSecuritiesDistributedAndUndistributedEarningsLossBasic"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareBasicTwoClassMethodAbstract_019fdcb7-ca76-71f8-8adc-6aff8a5b2e9c" xlink:to="loc_us-gaap_ParticipatingSecuritiesDistributedAndUndistributedEarningsLossBasic_019fdcb7-ca76-7150-9417-3b5a86a2680e" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_WeightedAverageNumberOfSharesOutstandingBasic_019fdcb7-ca76-7209-8114-6253a783b2c7" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_WeightedAverageNumberOfSharesOutstandingBasic"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareBasicTwoClassMethodAbstract_019fdcb7-ca76-71f8-8adc-6aff8a5b2e9c" xlink:to="loc_us-gaap_WeightedAverageNumberOfSharesOutstandingBasic_019fdcb7-ca76-7209-8114-6253a783b2c7" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EarningsPerShareBasic_019fdcb7-ca76-7352-8576-804cb95f50e9" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_EarningsPerShareBasic"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareBasicTwoClassMethodAbstract_019fdcb7-ca76-71f8-8adc-6aff8a5b2e9c" xlink:to="loc_us-gaap_EarningsPerShareBasic_019fdcb7-ca76-7352-8576-804cb95f50e9" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EarningsPerShareDilutedTwoClassMethodAbstract_019fdcb7-ca76-7715-ab4c-ebdee00b074e" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_EarningsPerShareDilutedTwoClassMethodAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareBasicLineItems_019fdcb7-ca76-7822-99f5-0c8659a812d6" xlink:to="loc_us-gaap_EarningsPerShareDilutedTwoClassMethodAbstract_019fdcb7-ca76-7715-ab4c-ebdee00b074e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ParticipatingSecuritiesDistributedAndUndistributedEarningsLossBasic_019fdcb7-ca76-76bf-a7c0-50c71398e1b8" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ParticipatingSecuritiesDistributedAndUndistributedEarningsLossBasic"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DistributedEarnings_019fdcb7-ca76-7bdf-9b42-dd345f36983a" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DistributedEarnings"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareDilutedTwoClassMethodAbstract_019fdcb7-ca76-7715-ab4c-ebdee00b074e" xlink:to="loc_us-gaap_DistributedEarnings_019fdcb7-ca76-7bdf-9b42-dd345f36983a" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_UndistributedEarningsLossAllocatedToParticipatingSecuritiesDiluted_019fdcb7-ca76-7e6e-89fb-5d0206d0c63c" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_UndistributedEarningsLossAllocatedToParticipatingSecuritiesDiluted"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareDilutedTwoClassMethodAbstract_019fdcb7-ca76-7715-ab4c-ebdee00b074e" xlink:to="loc_us-gaap_UndistributedEarningsLossAllocatedToParticipatingSecuritiesDiluted_019fdcb7-ca76-7e6e-89fb-5d0206d0c63c" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ParticipatingSecuritiesDistributedAndUndistributedEarningsLossDiluted_019fdcb7-ca76-72e9-8350-b5ae13f8a0ae" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ParticipatingSecuritiesDistributedAndUndistributedEarningsLossDiluted"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareDilutedTwoClassMethodAbstract_019fdcb7-ca76-7715-ab4c-ebdee00b074e" xlink:to="loc_us-gaap_ParticipatingSecuritiesDistributedAndUndistributedEarningsLossDiluted_019fdcb7-ca76-72e9-8350-b5ae13f8a0ae" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_IncrementalCommonSharesAttributabletoDilutiveEffectofConversionofCommonStock_019fdcb7-ca76-7293-9a85-cc73616c7c12" xlink:href="hsy-20260927.xsd#hsy_IncrementalCommonSharesAttributabletoDilutiveEffectofConversionofCommonStock"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareDilutedTwoClassMethodAbstract_019fdcb7-ca76-7715-ab4c-ebdee00b074e" xlink:to="loc_hsy_IncrementalCommonSharesAttributabletoDilutiveEffectofConversionofCommonStock_019fdcb7-ca76-7293-9a85-cc73616c7c12" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncrementalCommonSharesAttributableToShareBasedPaymentArrangements_019fdcb7-ca76-7a43-a783-b09bb7d11917" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_IncrementalCommonSharesAttributableToShareBasedPaymentArrangements"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareDilutedTwoClassMethodAbstract_019fdcb7-ca76-7715-ab4c-ebdee00b074e" xlink:to="loc_us-gaap_IncrementalCommonSharesAttributableToShareBasedPaymentArrangements_019fdcb7-ca76-7a43-a783-b09bb7d11917" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding_019fdcb7-ca76-7bd7-bc6f-a9e07ba5d27f" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareDilutedTwoClassMethodAbstract_019fdcb7-ca76-7715-ab4c-ebdee00b074e" xlink:to="loc_us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding_019fdcb7-ca76-7bd7-bc6f-a9e07ba5d27f" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EarningsPerShareDiluted_019fdcb7-ca76-7203-8cad-7dde144d17fa" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_EarningsPerShareDiluted"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareDilutedTwoClassMethodAbstract_019fdcb7-ca76-7715-ab4c-ebdee00b074e" xlink:to="loc_us-gaap_EarningsPerShareDiluted_019fdcb7-ca76-7203-8cad-7dde144d17fa" xlink:type="arc" order="8"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/EARNINGSPERSHARENARRATIVEDetails" xlink:type="simple" xlink:href="hsy-20260927.xsd#EARNINGSPERSHARENARRATIVEDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/EARNINGSPERSHARENARRATIVEDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareLineItems_019fdcb7-ca76-7415-83ab-4b73f484e682" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTable_019fdcb7-ca76-7709-beb8-41781f2b6529" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareLineItems_019fdcb7-ca76-7415-83ab-4b73f484e682" xlink:to="loc_us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTable_019fdcb7-ca76-7709-beb8-41781f2b6529" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis_019fdcb7-ca76-70fa-862f-bd77ec546b9a" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTable_019fdcb7-ca76-7709-beb8-41781f2b6529" xlink:to="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis_019fdcb7-ca76-70fa-862f-bd77ec546b9a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AntidilutiveSecuritiesNameDomain_019fdcb7-ca76-70fa-862f-bd77ec546b9a_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AntidilutiveSecuritiesNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis_019fdcb7-ca76-70fa-862f-bd77ec546b9a" xlink:to="loc_us-gaap_AntidilutiveSecuritiesNameDomain_019fdcb7-ca76-70fa-862f-bd77ec546b9a_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AntidilutiveSecuritiesNameDomain_019fdcb7-ca76-73d4-b0ed-279a7a463fc2" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AntidilutiveSecuritiesNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis_019fdcb7-ca76-70fa-862f-bd77ec546b9a" xlink:to="loc_us-gaap_AntidilutiveSecuritiesNameDomain_019fdcb7-ca76-73d4-b0ed-279a7a463fc2" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeStockOptionMember_019fdcb7-ca76-7f6d-ad5c-a5d0a76b08d4" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_EmployeeStockOptionMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AntidilutiveSecuritiesNameDomain_019fdcb7-ca76-73d4-b0ed-279a7a463fc2" xlink:to="loc_us-gaap_EmployeeStockOptionMember_019fdcb7-ca76-7f6d-ad5c-a5d0a76b08d4" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementClassOfStockAxis_019fdcb7-ca76-7a07-924a-8979c3f8e4ad" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_StatementClassOfStockAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTable_019fdcb7-ca76-7709-beb8-41781f2b6529" xlink:to="loc_us-gaap_StatementClassOfStockAxis_019fdcb7-ca76-7a07-924a-8979c3f8e4ad" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_019fdcb7-ca76-7a07-924a-8979c3f8e4ad_default" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementClassOfStockAxis_019fdcb7-ca76-7a07-924a-8979c3f8e4ad" xlink:to="loc_us-gaap_ClassOfStockDomain_019fdcb7-ca76-7a07-924a-8979c3f8e4ad_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_019fdcb7-ca76-7887-90a4-8bf4c1890534" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementClassOfStockAxis_019fdcb7-ca76-7a07-924a-8979c3f8e4ad" xlink:to="loc_us-gaap_ClassOfStockDomain_019fdcb7-ca76-7887-90a4-8bf4c1890534" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonClassBMember_019fdcb7-ca76-703f-98bb-2fc64b55c7b2" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CommonClassBMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_019fdcb7-ca76-7887-90a4-8bf4c1890534" xlink:to="loc_us-gaap_CommonClassBMember_019fdcb7-ca76-703f-98bb-2fc64b55c7b2" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareAmount_019fdcb7-ca76-78bc-a9fe-0c50466ceb5b" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareAmount"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareLineItems_019fdcb7-ca76-7415-83ab-4b73f484e682" xlink:to="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareAmount_019fdcb7-ca76-78bc-a9fe-0c50466ceb5b" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://fasb.org/srt/role/srt-eedm/ExtensibleEnumerationLists" xlink:type="simple" xlink:href="https://xbrl.fasb.org/srt/2026/elts/srt-roles-2026.xsd#eedm1"/>
  <link:definitionLink xlink:role="http://fasb.org/srt/role/srt-eedm/ExtensibleEnumerationLists" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AssetsAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AssetsAbstract"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentNet" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_PropertyPlantAndEquipmentNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsAbstract" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentNet" xlink:type="arc" order="101"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesCurrentAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_LiabilitiesCurrentAbstract"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccruedLiabilitiesCurrent" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AccruedLiabilitiesCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesCurrentAbstract" xlink:to="loc_us-gaap_AccruedLiabilitiesCurrent" xlink:type="arc" order="41"/>
  </link:definitionLink>
</link:linkbase>
