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

<!--XBRL Document Created with Wdesk from Workiva-->
<!--Copyright 2022 Workiva-->
<!--r:069a08f4-39ed-4a95-9a27-cbc862a0545b,g:f4c452e7-7320-4da1-a969-162c5b061ea9-->
<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-20220703.xsd#DOCUMENTANDENTITYINFORMATION"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/DOCUMENTANDENTITYINFORMATION" xlink:type="extended" id="i008e9e2ae29a4a2ca039e7fb36fbff14_DOCUMENTANDENTITYINFORMATION">
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityInformationLineItems_07c8970e-68fd-418c-bfde-3e660fe5f65a" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_EntityInformationLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_DocumentType_8252a2d7-aac1-4710-8d2c-e20c56dc8783" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_DocumentType"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_07c8970e-68fd-418c-bfde-3e660fe5f65a" xlink:to="loc_dei_DocumentType_8252a2d7-aac1-4710-8d2c-e20c56dc8783" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_DocumentQuarterlyReport_77c4235e-f1fe-4609-ad8a-d9db0dbc1437" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_DocumentQuarterlyReport"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_07c8970e-68fd-418c-bfde-3e660fe5f65a" xlink:to="loc_dei_DocumentQuarterlyReport_77c4235e-f1fe-4609-ad8a-d9db0dbc1437" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_DocumentPeriodEndDate_3e106a24-82f4-47e2-938b-d7082dd6fcbf" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_DocumentPeriodEndDate"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_07c8970e-68fd-418c-bfde-3e660fe5f65a" xlink:to="loc_dei_DocumentPeriodEndDate_3e106a24-82f4-47e2-938b-d7082dd6fcbf" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_DocumentTransitionReport_2cca06fd-5ba4-4dd7-89cc-03ae2ac68c26" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_DocumentTransitionReport"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_07c8970e-68fd-418c-bfde-3e660fe5f65a" xlink:to="loc_dei_DocumentTransitionReport_2cca06fd-5ba4-4dd7-89cc-03ae2ac68c26" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityFileNumber_25fc7068-b0fe-41e6-b924-6c05589843a9" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_EntityFileNumber"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_07c8970e-68fd-418c-bfde-3e660fe5f65a" xlink:to="loc_dei_EntityFileNumber_25fc7068-b0fe-41e6-b924-6c05589843a9" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityRegistrantName_54ff29b5-f832-47fc-a5b6-f08578322243" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_EntityRegistrantName"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_07c8970e-68fd-418c-bfde-3e660fe5f65a" xlink:to="loc_dei_EntityRegistrantName_54ff29b5-f832-47fc-a5b6-f08578322243" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityIncorporationStateCountryCode_82e7ce79-1449-4f78-943d-09b714af740f" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_EntityIncorporationStateCountryCode"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_07c8970e-68fd-418c-bfde-3e660fe5f65a" xlink:to="loc_dei_EntityIncorporationStateCountryCode_82e7ce79-1449-4f78-943d-09b714af740f" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityTaxIdentificationNumber_e258872f-c1ee-450b-88ca-8988321aa21a" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_EntityTaxIdentificationNumber"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_07c8970e-68fd-418c-bfde-3e660fe5f65a" xlink:to="loc_dei_EntityTaxIdentificationNumber_e258872f-c1ee-450b-88ca-8988321aa21a" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityAddressAddressLine1_dca5fdd2-ab88-4f83-951f-9102e75a8ffc" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_EntityAddressAddressLine1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_07c8970e-68fd-418c-bfde-3e660fe5f65a" xlink:to="loc_dei_EntityAddressAddressLine1_dca5fdd2-ab88-4f83-951f-9102e75a8ffc" xlink:type="arc" order="8"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityAddressCityOrTown_8ef7b14b-1fac-4321-856f-46f47974911b" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_EntityAddressCityOrTown"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_07c8970e-68fd-418c-bfde-3e660fe5f65a" xlink:to="loc_dei_EntityAddressCityOrTown_8ef7b14b-1fac-4321-856f-46f47974911b" xlink:type="arc" order="9"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityAddressStateOrProvince_f806e387-bd40-4aba-a415-7141cb865c67" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_EntityAddressStateOrProvince"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_07c8970e-68fd-418c-bfde-3e660fe5f65a" xlink:to="loc_dei_EntityAddressStateOrProvince_f806e387-bd40-4aba-a415-7141cb865c67" xlink:type="arc" order="10"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityAddressPostalZipCode_f787a50b-59ac-4de0-8f61-364bb2559296" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_EntityAddressPostalZipCode"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_07c8970e-68fd-418c-bfde-3e660fe5f65a" xlink:to="loc_dei_EntityAddressPostalZipCode_f787a50b-59ac-4de0-8f61-364bb2559296" xlink:type="arc" order="11"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_CityAreaCode_d8762fa3-6902-4094-9275-6636b1cbb229" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_CityAreaCode"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_07c8970e-68fd-418c-bfde-3e660fe5f65a" xlink:to="loc_dei_CityAreaCode_d8762fa3-6902-4094-9275-6636b1cbb229" xlink:type="arc" order="12"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_LocalPhoneNumber_c8cc21d9-d008-4832-94ad-4cb4cd98aadb" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_LocalPhoneNumber"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_07c8970e-68fd-418c-bfde-3e660fe5f65a" xlink:to="loc_dei_LocalPhoneNumber_c8cc21d9-d008-4832-94ad-4cb4cd98aadb" xlink:type="arc" order="13"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_Security12bTitle_6073e504-ea24-47c3-9c80-5b3370caabee" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_Security12bTitle"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_07c8970e-68fd-418c-bfde-3e660fe5f65a" xlink:to="loc_dei_Security12bTitle_6073e504-ea24-47c3-9c80-5b3370caabee" xlink:type="arc" order="14"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_TradingSymbol_7e455572-6512-4264-a17e-70ea1873dc26" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_TradingSymbol"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_07c8970e-68fd-418c-bfde-3e660fe5f65a" xlink:to="loc_dei_TradingSymbol_7e455572-6512-4264-a17e-70ea1873dc26" xlink:type="arc" order="15"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_SecurityExchangeName_fb2e46c1-672e-43b1-afd3-faec8f13193c" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_SecurityExchangeName"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_07c8970e-68fd-418c-bfde-3e660fe5f65a" xlink:to="loc_dei_SecurityExchangeName_fb2e46c1-672e-43b1-afd3-faec8f13193c" xlink:type="arc" order="16"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityCurrentReportingStatus_5f7a2d0f-a47e-4b17-ab15-78dbb82f4341" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_EntityCurrentReportingStatus"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_07c8970e-68fd-418c-bfde-3e660fe5f65a" xlink:to="loc_dei_EntityCurrentReportingStatus_5f7a2d0f-a47e-4b17-ab15-78dbb82f4341" xlink:type="arc" order="17"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityInteractiveDataCurrent_f42419b4-ec72-4893-9247-8434f0ad40c2" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_EntityInteractiveDataCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_07c8970e-68fd-418c-bfde-3e660fe5f65a" xlink:to="loc_dei_EntityInteractiveDataCurrent_f42419b4-ec72-4893-9247-8434f0ad40c2" xlink:type="arc" order="18"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityFilerCategory_7828dcc4-f302-43cc-aff4-b14b9eb8ab6d" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_EntityFilerCategory"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_07c8970e-68fd-418c-bfde-3e660fe5f65a" xlink:to="loc_dei_EntityFilerCategory_7828dcc4-f302-43cc-aff4-b14b9eb8ab6d" xlink:type="arc" order="19"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntitySmallBusiness_2e477dd5-3687-4d0a-bf8d-15ae4894bd47" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_EntitySmallBusiness"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_07c8970e-68fd-418c-bfde-3e660fe5f65a" xlink:to="loc_dei_EntitySmallBusiness_2e477dd5-3687-4d0a-bf8d-15ae4894bd47" xlink:type="arc" order="20"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityEmergingGrowthCompany_5a13be07-3309-4bc8-938d-409f1bfe03ca" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_EntityEmergingGrowthCompany"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_07c8970e-68fd-418c-bfde-3e660fe5f65a" xlink:to="loc_dei_EntityEmergingGrowthCompany_5a13be07-3309-4bc8-938d-409f1bfe03ca" xlink:type="arc" order="21"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityShellCompany_440d4b31-696b-418a-b435-87a802c8fb04" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_EntityShellCompany"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_07c8970e-68fd-418c-bfde-3e660fe5f65a" xlink:to="loc_dei_EntityShellCompany_440d4b31-696b-418a-b435-87a802c8fb04" xlink:type="arc" order="22"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityCommonStockSharesOutstanding_a4d512d1-d1b2-4f67-a65c-1eb223d448cf" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_EntityCommonStockSharesOutstanding"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_07c8970e-68fd-418c-bfde-3e660fe5f65a" xlink:to="loc_dei_EntityCommonStockSharesOutstanding_a4d512d1-d1b2-4f67-a65c-1eb223d448cf" xlink:type="arc" order="23"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityCentralIndexKey_995a2c1d-a290-4caa-99f2-c4925bc21cbb" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_EntityCentralIndexKey"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_07c8970e-68fd-418c-bfde-3e660fe5f65a" xlink:to="loc_dei_EntityCentralIndexKey_995a2c1d-a290-4caa-99f2-c4925bc21cbb" xlink:type="arc" order="24"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_DocumentFiscalYearFocus_d878138d-dca5-4473-918f-04a01f287061" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_DocumentFiscalYearFocus"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_07c8970e-68fd-418c-bfde-3e660fe5f65a" xlink:to="loc_dei_DocumentFiscalYearFocus_d878138d-dca5-4473-918f-04a01f287061" xlink:type="arc" order="25"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_CurrentFiscalYearEndDate_5b40d5b8-d89e-4f60-9ed8-2b978ebcf2e8" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_CurrentFiscalYearEndDate"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_07c8970e-68fd-418c-bfde-3e660fe5f65a" xlink:to="loc_dei_CurrentFiscalYearEndDate_5b40d5b8-d89e-4f60-9ed8-2b978ebcf2e8" xlink:type="arc" order="26"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_DocumentFiscalPeriodFocus_7e7a8a77-9e12-42bd-b083-fac8d5f8acde" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_DocumentFiscalPeriodFocus"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_07c8970e-68fd-418c-bfde-3e660fe5f65a" xlink:to="loc_dei_DocumentFiscalPeriodFocus_7e7a8a77-9e12-42bd-b083-fac8d5f8acde" xlink:type="arc" order="27"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_AmendmentFlag_cb5683ee-05ff-4edc-b8dc-b2d673f6c3d8" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_AmendmentFlag"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityInformationLineItems_07c8970e-68fd-418c-bfde-3e660fe5f65a" xlink:to="loc_dei_AmendmentFlag_cb5683ee-05ff-4edc-b8dc-b2d673f6c3d8" xlink:type="arc" order="28"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntitiesTable_d69b40fb-2404-4190-b4ee-cdfb27957386" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_EntitiesTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_dei_EntityInformationLineItems_07c8970e-68fd-418c-bfde-3e660fe5f65a" xlink:to="loc_dei_EntitiesTable_d69b40fb-2404-4190-b4ee-cdfb27957386" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementClassOfStockAxis_c55b9c8e-fb46-4fd8-aefa-b5a13e535611" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StatementClassOfStockAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_dei_EntitiesTable_d69b40fb-2404-4190-b4ee-cdfb27957386" xlink:to="loc_us-gaap_StatementClassOfStockAxis_c55b9c8e-fb46-4fd8-aefa-b5a13e535611" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_c55b9c8e-fb46-4fd8-aefa-b5a13e535611_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementClassOfStockAxis_c55b9c8e-fb46-4fd8-aefa-b5a13e535611" xlink:to="loc_us-gaap_ClassOfStockDomain_c55b9c8e-fb46-4fd8-aefa-b5a13e535611_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_5aaa2fc6-cb80-46e9-927d-d3ce32f62930" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementClassOfStockAxis_c55b9c8e-fb46-4fd8-aefa-b5a13e535611" xlink:to="loc_us-gaap_ClassOfStockDomain_5aaa2fc6-cb80-46e9-927d-d3ce32f62930" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockMember_48549168-2474-46a5-93ed-2c3a800f7e9b" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CommonStockMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_5aaa2fc6-cb80-46e9-927d-d3ce32f62930" xlink:to="loc_us-gaap_CommonStockMember_48549168-2474-46a5-93ed-2c3a800f7e9b" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonClassBMember_9d4cc3f6-c2cc-4cc5-83e2-ac77c1f8b76f" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CommonClassBMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_5aaa2fc6-cb80-46e9-927d-d3ce32f62930" xlink:to="loc_us-gaap_CommonClassBMember_9d4cc3f6-c2cc-4cc5-83e2-ac77c1f8b76f" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/CONSOLIDATEDSTATEMENTSOFINCOME" xlink:type="simple" xlink:href="hsy-20220703.xsd#CONSOLIDATEDSTATEMENTSOFINCOME"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/CONSOLIDATEDSTATEMENTSOFINCOME" xlink:type="extended" id="i6dcab0fb6e73488a9d039a3ec33f7808_CONSOLIDATEDSTATEMENTSOFINCOME">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementLineItems_ed936bb5-a81d-4e93-b546-a5c3769e4385" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StatementLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax_f53e7ff6-c468-4682-b1b7-1cd8e1959ca2" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_ed936bb5-a81d-4e93-b546-a5c3769e4385" xlink:to="loc_us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax_f53e7ff6-c468-4682-b1b7-1cd8e1959ca2" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CostOfGoodsAndServicesSold_a386b930-74d4-47d3-b1e6-3fb538b9944c" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CostOfGoodsAndServicesSold"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_ed936bb5-a81d-4e93-b546-a5c3769e4385" xlink:to="loc_us-gaap_CostOfGoodsAndServicesSold_a386b930-74d4-47d3-b1e6-3fb538b9944c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GrossProfit_a397a0cc-f1a3-4f88-82f2-1c936269bd0c" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_GrossProfit"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_ed936bb5-a81d-4e93-b546-a5c3769e4385" xlink:to="loc_us-gaap_GrossProfit_a397a0cc-f1a3-4f88-82f2-1c936269bd0c" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SellingGeneralAndAdministrativeExpense_0274206a-837b-45e5-b712-abc6f20c75a3" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_SellingGeneralAndAdministrativeExpense"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_ed936bb5-a81d-4e93-b546-a5c3769e4385" xlink:to="loc_us-gaap_SellingGeneralAndAdministrativeExpense_0274206a-837b-45e5-b712-abc6f20c75a3" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_RestructuringChargesBusinessRealignment_29a6ef4f-b272-4637-88ee-cf219965a5ff" xlink:href="hsy-20220703.xsd#hsy_RestructuringChargesBusinessRealignment"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_ed936bb5-a81d-4e93-b546-a5c3769e4385" xlink:to="loc_hsy_RestructuringChargesBusinessRealignment_29a6ef4f-b272-4637-88ee-cf219965a5ff" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingIncomeLoss_ad9d5337-2eff-4c30-a36c-0bffd166fd48" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OperatingIncomeLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_ed936bb5-a81d-4e93-b546-a5c3769e4385" xlink:to="loc_us-gaap_OperatingIncomeLoss_ad9d5337-2eff-4c30-a36c-0bffd166fd48" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InterestIncomeExpenseNonoperatingNet_4f9b6ff3-2c18-48be-8f0d-6db64bce01bf" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_InterestIncomeExpenseNonoperatingNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_ed936bb5-a81d-4e93-b546-a5c3769e4385" xlink:to="loc_us-gaap_InterestIncomeExpenseNonoperatingNet_4f9b6ff3-2c18-48be-8f0d-6db64bce01bf" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherNonoperatingIncomeExpense_0cb429e8-6af4-4ecc-99b9-1b333fa2dae4" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherNonoperatingIncomeExpense"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_ed936bb5-a81d-4e93-b546-a5c3769e4385" xlink:to="loc_us-gaap_OtherNonoperatingIncomeExpense_0cb429e8-6af4-4ecc-99b9-1b333fa2dae4" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_bc5fe665-f339-4a69-9fe2-a1b57e6307ad" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_ed936bb5-a81d-4e93-b546-a5c3769e4385" xlink:to="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_bc5fe665-f339-4a69-9fe2-a1b57e6307ad" xlink:type="arc" order="8"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeTaxExpenseBenefit_6f388d89-188e-4744-a48f-cd7fc048d360" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncomeTaxExpenseBenefit"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_ed936bb5-a81d-4e93-b546-a5c3769e4385" xlink:to="loc_us-gaap_IncomeTaxExpenseBenefit_6f388d89-188e-4744-a48f-cd7fc048d360" xlink:type="arc" order="9"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProfitLoss_96bc8b55-0589-4642-a4e1-c377b5e500e5" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ProfitLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_ed936bb5-a81d-4e93-b546-a5c3769e4385" xlink:to="loc_us-gaap_ProfitLoss_96bc8b55-0589-4642-a4e1-c377b5e500e5" xlink:type="arc" order="10"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetIncomeLossAttributableToNoncontrollingInterest_f3a1575e-4f7b-48a4-a7d4-98442b2913a1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NetIncomeLossAttributableToNoncontrollingInterest"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_ed936bb5-a81d-4e93-b546-a5c3769e4385" xlink:to="loc_us-gaap_NetIncomeLossAttributableToNoncontrollingInterest_f3a1575e-4f7b-48a4-a7d4-98442b2913a1" xlink:type="arc" order="11"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetIncomeLoss_c2af3bc0-848f-4efe-ae40-9717d39ed9fa" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NetIncomeLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_ed936bb5-a81d-4e93-b546-a5c3769e4385" xlink:to="loc_us-gaap_NetIncomeLoss_c2af3bc0-848f-4efe-ae40-9717d39ed9fa" xlink:type="arc" order="12"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EarningsPerShareBasicAbstract_075db8bf-41d5-4d1d-8b93-7e37fd8da3e9" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EarningsPerShareBasicAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_ed936bb5-a81d-4e93-b546-a5c3769e4385" xlink:to="loc_us-gaap_EarningsPerShareBasicAbstract_075db8bf-41d5-4d1d-8b93-7e37fd8da3e9" xlink:type="arc" order="13"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EarningsPerShareBasic_b8a29686-c34c-45cb-863b-d9b3a0112dd4" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EarningsPerShareBasic"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareBasicAbstract_075db8bf-41d5-4d1d-8b93-7e37fd8da3e9" xlink:to="loc_us-gaap_EarningsPerShareBasic_b8a29686-c34c-45cb-863b-d9b3a0112dd4" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EarningsPerShareDilutedAbstract_de49667c-e964-471e-800a-c98b252ffd51" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EarningsPerShareDilutedAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_ed936bb5-a81d-4e93-b546-a5c3769e4385" xlink:to="loc_us-gaap_EarningsPerShareDilutedAbstract_de49667c-e964-471e-800a-c98b252ffd51" xlink:type="arc" order="14"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EarningsPerShareDiluted_153a0491-4413-490e-82cb-16f1f1c98212" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EarningsPerShareDiluted"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareDilutedAbstract_de49667c-e964-471e-800a-c98b252ffd51" xlink:to="loc_us-gaap_EarningsPerShareDiluted_153a0491-4413-490e-82cb-16f1f1c98212" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DividendsCommonStockAbstract_d969ac36-bb9d-400d-852c-5b6bae0d888b" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DividendsCommonStockAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_ed936bb5-a81d-4e93-b546-a5c3769e4385" xlink:to="loc_us-gaap_DividendsCommonStockAbstract_d969ac36-bb9d-400d-852c-5b6bae0d888b" xlink:type="arc" order="15"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockDividendsPerShareCashPaid_f9c64fc9-0360-4caf-90f2-e3f141fd4a92" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CommonStockDividendsPerShareCashPaid"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DividendsCommonStockAbstract_d969ac36-bb9d-400d-852c-5b6bae0d888b" xlink:to="loc_us-gaap_CommonStockDividendsPerShareCashPaid_f9c64fc9-0360-4caf-90f2-e3f141fd4a92" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementTable_3feb1dbf-0b33-4354-8747-426169cf1a20" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StatementTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_StatementLineItems_ed936bb5-a81d-4e93-b546-a5c3769e4385" xlink:to="loc_us-gaap_StatementTable_3feb1dbf-0b33-4354-8747-426169cf1a20" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementClassOfStockAxis_66a0afcc-e96c-444b-93cd-2cc471b558ac" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StatementClassOfStockAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_StatementTable_3feb1dbf-0b33-4354-8747-426169cf1a20" xlink:to="loc_us-gaap_StatementClassOfStockAxis_66a0afcc-e96c-444b-93cd-2cc471b558ac" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_66a0afcc-e96c-444b-93cd-2cc471b558ac_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementClassOfStockAxis_66a0afcc-e96c-444b-93cd-2cc471b558ac" xlink:to="loc_us-gaap_ClassOfStockDomain_66a0afcc-e96c-444b-93cd-2cc471b558ac_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_0ed4c725-8ce4-47dc-ba4d-74e72bf7e11a" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementClassOfStockAxis_66a0afcc-e96c-444b-93cd-2cc471b558ac" xlink:to="loc_us-gaap_ClassOfStockDomain_0ed4c725-8ce4-47dc-ba4d-74e72bf7e11a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockMember_f1091801-0446-4b01-b7fc-636cabf1827d" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CommonStockMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_0ed4c725-8ce4-47dc-ba4d-74e72bf7e11a" xlink:to="loc_us-gaap_CommonStockMember_f1091801-0446-4b01-b7fc-636cabf1827d" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonClassBMember_f278ef7f-bee1-4c87-9e73-6a3c62f2c560" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CommonClassBMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_0ed4c725-8ce4-47dc-ba4d-74e72bf7e11a" xlink:to="loc_us-gaap_CommonClassBMember_f278ef7f-bee1-4c87-9e73-6a3c62f2c560" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/CONSOLIDATEDBALANCESHEETS" xlink:type="simple" xlink:href="hsy-20220703.xsd#CONSOLIDATEDBALANCESHEETS"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/CONSOLIDATEDBALANCESHEETS" xlink:type="extended" id="i836c73fec76842d08080a63b7bbc9435_CONSOLIDATEDBALANCESHEETS">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementLineItems_7e80b69a-f9ce-4aa7-b01b-8c4b0ca11f63" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StatementLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AssetsAbstract_b50d737a-744d-4e42-acde-41326fb58966" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AssetsAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_7e80b69a-f9ce-4aa7-b01b-8c4b0ca11f63" xlink:to="loc_us-gaap_AssetsAbstract_b50d737a-744d-4e42-acde-41326fb58966" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AssetsCurrentAbstract_9eb76685-b406-4399-8d79-72f421dfde0e" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AssetsCurrentAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsAbstract_b50d737a-744d-4e42-acde-41326fb58966" xlink:to="loc_us-gaap_AssetsCurrentAbstract_9eb76685-b406-4399-8d79-72f421dfde0e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_a7f3ecf1-0f31-488b-8018-3928532a06c4" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsCurrentAbstract_9eb76685-b406-4399-8d79-72f421dfde0e" xlink:to="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_a7f3ecf1-0f31-488b-8018-3928532a06c4" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccountsReceivableNetCurrent_d05950ae-fe89-4441-a645-0dce304a3174" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccountsReceivableNetCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsCurrentAbstract_9eb76685-b406-4399-8d79-72f421dfde0e" xlink:to="loc_us-gaap_AccountsReceivableNetCurrent_d05950ae-fe89-4441-a645-0dce304a3174" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InventoryNet_cdd8e0f3-b45f-4fa2-840f-817768550d03" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_InventoryNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsCurrentAbstract_9eb76685-b406-4399-8d79-72f421dfde0e" xlink:to="loc_us-gaap_InventoryNet_cdd8e0f3-b45f-4fa2-840f-817768550d03" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PrepaidExpenseAndOtherAssetsCurrent_f159932f-6dce-4cfc-849c-13234c9ff70f" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PrepaidExpenseAndOtherAssetsCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsCurrentAbstract_9eb76685-b406-4399-8d79-72f421dfde0e" xlink:to="loc_us-gaap_PrepaidExpenseAndOtherAssetsCurrent_f159932f-6dce-4cfc-849c-13234c9ff70f" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AssetsCurrent_d010e2f0-cc03-4349-956d-5ab54ad522c5" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AssetsCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsCurrentAbstract_9eb76685-b406-4399-8d79-72f421dfde0e" xlink:to="loc_us-gaap_AssetsCurrent_d010e2f0-cc03-4349-956d-5ab54ad522c5" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentNet_d63caa7f-dfae-4d46-89ec-8bd685ba8d88" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PropertyPlantAndEquipmentNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsAbstract_b50d737a-744d-4e42-acde-41326fb58966" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentNet_d63caa7f-dfae-4d46-89ec-8bd685ba8d88" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Goodwill_f0f6742b-0cf8-4966-8c47-50af6e6fe48e" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_Goodwill"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsAbstract_b50d737a-744d-4e42-acde-41326fb58966" xlink:to="loc_us-gaap_Goodwill_f0f6742b-0cf8-4966-8c47-50af6e6fe48e" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IntangibleAssetsNetExcludingGoodwill_57bd58c2-2e93-4e2c-9755-222c962483b8" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IntangibleAssetsNetExcludingGoodwill"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsAbstract_b50d737a-744d-4e42-acde-41326fb58966" xlink:to="loc_us-gaap_IntangibleAssetsNetExcludingGoodwill_57bd58c2-2e93-4e2c-9755-222c962483b8" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherAssetsNoncurrent_ccae538b-e105-459b-bcbd-e4bd3fcadc06" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherAssetsNoncurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsAbstract_b50d737a-744d-4e42-acde-41326fb58966" xlink:to="loc_us-gaap_OtherAssetsNoncurrent_ccae538b-e105-459b-bcbd-e4bd3fcadc06" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredIncomeTaxAssetsNet_587b7757-accd-4467-acfe-3ce8e169a9fa" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredIncomeTaxAssetsNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsAbstract_b50d737a-744d-4e42-acde-41326fb58966" xlink:to="loc_us-gaap_DeferredIncomeTaxAssetsNet_587b7757-accd-4467-acfe-3ce8e169a9fa" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Assets_15cad7cf-be07-4d64-bce5-39624324fe2e" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_Assets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsAbstract_b50d737a-744d-4e42-acde-41326fb58966" xlink:to="loc_us-gaap_Assets_15cad7cf-be07-4d64-bce5-39624324fe2e" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesAndStockholdersEquityAbstract_30eac447-1e79-4721-bb73-4f48e3335724" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LiabilitiesAndStockholdersEquityAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_7e80b69a-f9ce-4aa7-b01b-8c4b0ca11f63" xlink:to="loc_us-gaap_LiabilitiesAndStockholdersEquityAbstract_30eac447-1e79-4721-bb73-4f48e3335724" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesCurrentAbstract_74a7c944-f2ee-4aba-9440-fa1f9aca5c3a" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LiabilitiesCurrentAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquityAbstract_30eac447-1e79-4721-bb73-4f48e3335724" xlink:to="loc_us-gaap_LiabilitiesCurrentAbstract_74a7c944-f2ee-4aba-9440-fa1f9aca5c3a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccountsPayableCurrent_9ce44a8b-2790-419d-9391-24e9d8a595bf" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccountsPayableCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesCurrentAbstract_74a7c944-f2ee-4aba-9440-fa1f9aca5c3a" xlink:to="loc_us-gaap_AccountsPayableCurrent_9ce44a8b-2790-419d-9391-24e9d8a595bf" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccruedLiabilitiesCurrent_7be90efe-7814-4ad2-95a0-9422e310bf21" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccruedLiabilitiesCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesCurrentAbstract_74a7c944-f2ee-4aba-9440-fa1f9aca5c3a" xlink:to="loc_us-gaap_AccruedLiabilitiesCurrent_7be90efe-7814-4ad2-95a0-9422e310bf21" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccruedIncomeTaxesCurrent_840c46e9-e634-4e4f-8057-b82a690990e4" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccruedIncomeTaxesCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesCurrentAbstract_74a7c944-f2ee-4aba-9440-fa1f9aca5c3a" xlink:to="loc_us-gaap_AccruedIncomeTaxesCurrent_840c46e9-e634-4e4f-8057-b82a690990e4" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShortTermBorrowings_9b56394f-9cab-44f1-a82f-052feaa70835" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShortTermBorrowings"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesCurrentAbstract_74a7c944-f2ee-4aba-9440-fa1f9aca5c3a" xlink:to="loc_us-gaap_ShortTermBorrowings_9b56394f-9cab-44f1-a82f-052feaa70835" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongTermDebtCurrent_f3898e77-5fe0-4f75-b641-f71801996445" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LongTermDebtCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesCurrentAbstract_74a7c944-f2ee-4aba-9440-fa1f9aca5c3a" xlink:to="loc_us-gaap_LongTermDebtCurrent_f3898e77-5fe0-4f75-b641-f71801996445" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesCurrent_6f45838c-8104-43f2-84a8-44a8685c09cd" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LiabilitiesCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesCurrentAbstract_74a7c944-f2ee-4aba-9440-fa1f9aca5c3a" xlink:to="loc_us-gaap_LiabilitiesCurrent_6f45838c-8104-43f2-84a8-44a8685c09cd" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongTermDebtAndCapitalLeaseObligations_8c88cfc2-a2b9-4a59-a98d-c857d7c8a081" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LongTermDebtAndCapitalLeaseObligations"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquityAbstract_30eac447-1e79-4721-bb73-4f48e3335724" xlink:to="loc_us-gaap_LongTermDebtAndCapitalLeaseObligations_8c88cfc2-a2b9-4a59-a98d-c857d7c8a081" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherLiabilitiesNoncurrent_c1a82d0b-04fa-4a04-a555-4920b1fa02f1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherLiabilitiesNoncurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquityAbstract_30eac447-1e79-4721-bb73-4f48e3335724" xlink:to="loc_us-gaap_OtherLiabilitiesNoncurrent_c1a82d0b-04fa-4a04-a555-4920b1fa02f1" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredIncomeTaxLiabilitiesNet_c16584e9-5506-435b-8981-31270f0385b2" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredIncomeTaxLiabilitiesNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquityAbstract_30eac447-1e79-4721-bb73-4f48e3335724" xlink:to="loc_us-gaap_DeferredIncomeTaxLiabilitiesNet_c16584e9-5506-435b-8981-31270f0385b2" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Liabilities_efd40f63-41c5-42ba-b889-28a4bce3e11c" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_Liabilities"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquityAbstract_30eac447-1e79-4721-bb73-4f48e3335724" xlink:to="loc_us-gaap_Liabilities_efd40f63-41c5-42ba-b889-28a4bce3e11c" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterestAbstract_c51be4c6-53cc-44a9-a06e-36ca3823426d" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterestAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquityAbstract_30eac447-1e79-4721-bb73-4f48e3335724" xlink:to="loc_us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterestAbstract_c51be4c6-53cc-44a9-a06e-36ca3823426d" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PreferredStockValue_67908afd-4f76-4402-bcdc-6e4100e929ee" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PreferredStockValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterestAbstract_c51be4c6-53cc-44a9-a06e-36ca3823426d" xlink:to="loc_us-gaap_PreferredStockValue_67908afd-4f76-4402-bcdc-6e4100e929ee" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockValue_6874ded5-70e7-4712-8881-9073fb976985" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CommonStockValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterestAbstract_c51be4c6-53cc-44a9-a06e-36ca3823426d" xlink:to="loc_us-gaap_CommonStockValue_6874ded5-70e7-4712-8881-9073fb976985" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AdditionalPaidInCapital_b7244a40-4bd7-4078-9d67-9c51c6e2f459" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AdditionalPaidInCapital"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterestAbstract_c51be4c6-53cc-44a9-a06e-36ca3823426d" xlink:to="loc_us-gaap_AdditionalPaidInCapital_b7244a40-4bd7-4078-9d67-9c51c6e2f459" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetainedEarningsAccumulatedDeficit_f30ca363-3169-4069-baf5-2041d9df7471" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RetainedEarningsAccumulatedDeficit"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterestAbstract_c51be4c6-53cc-44a9-a06e-36ca3823426d" xlink:to="loc_us-gaap_RetainedEarningsAccumulatedDeficit_f30ca363-3169-4069-baf5-2041d9df7471" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TreasuryStockValue_63e4d89a-04c8-4a82-a8aa-47b1579e4560" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_TreasuryStockValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterestAbstract_c51be4c6-53cc-44a9-a06e-36ca3823426d" xlink:to="loc_us-gaap_TreasuryStockValue_63e4d89a-04c8-4a82-a8aa-47b1579e4560" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax_6081c745-37f2-46c0-867e-281e1b88df4b" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterestAbstract_c51be4c6-53cc-44a9-a06e-36ca3823426d" xlink:to="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax_6081c745-37f2-46c0-867e-281e1b88df4b" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterest_ded27a36-ef55-4bf3-bf2d-fecba09e6089" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterest"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterestAbstract_c51be4c6-53cc-44a9-a06e-36ca3823426d" xlink:to="loc_us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterest_ded27a36-ef55-4bf3-bf2d-fecba09e6089" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesAndStockholdersEquity_c73752a9-8b98-44cd-8abc-7ed785ce65d0" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LiabilitiesAndStockholdersEquity"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquityAbstract_30eac447-1e79-4721-bb73-4f48e3335724" xlink:to="loc_us-gaap_LiabilitiesAndStockholdersEquity_c73752a9-8b98-44cd-8abc-7ed785ce65d0" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementTable_15c24c12-8c9d-429b-b002-c6d0e910222e" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StatementTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_StatementLineItems_7e80b69a-f9ce-4aa7-b01b-8c4b0ca11f63" xlink:to="loc_us-gaap_StatementTable_15c24c12-8c9d-429b-b002-c6d0e910222e" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementClassOfStockAxis_7f4b09ba-bf32-4d1f-9be4-40e6a3d1f7ca" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StatementClassOfStockAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_StatementTable_15c24c12-8c9d-429b-b002-c6d0e910222e" xlink:to="loc_us-gaap_StatementClassOfStockAxis_7f4b09ba-bf32-4d1f-9be4-40e6a3d1f7ca" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_7f4b09ba-bf32-4d1f-9be4-40e6a3d1f7ca_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementClassOfStockAxis_7f4b09ba-bf32-4d1f-9be4-40e6a3d1f7ca" xlink:to="loc_us-gaap_ClassOfStockDomain_7f4b09ba-bf32-4d1f-9be4-40e6a3d1f7ca_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_2d0d8365-f0ea-44e0-a5e9-d8c7a991fec6" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementClassOfStockAxis_7f4b09ba-bf32-4d1f-9be4-40e6a3d1f7ca" xlink:to="loc_us-gaap_ClassOfStockDomain_2d0d8365-f0ea-44e0-a5e9-d8c7a991fec6" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockMember_42e2690b-60cf-4f68-999d-7805f777784a" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CommonStockMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_2d0d8365-f0ea-44e0-a5e9-d8c7a991fec6" xlink:to="loc_us-gaap_CommonStockMember_42e2690b-60cf-4f68-999d-7805f777784a" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonClassBMember_c0a84803-288f-4699-a6d6-858e390c1c1b" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CommonClassBMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_2d0d8365-f0ea-44e0-a5e9-d8c7a991fec6" xlink:to="loc_us-gaap_CommonClassBMember_c0a84803-288f-4699-a6d6-858e390c1c1b" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/CONSOLIDATEDBALANCESHEETSParenthetical" xlink:type="simple" xlink:href="hsy-20220703.xsd#CONSOLIDATEDBALANCESHEETSParenthetical"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/CONSOLIDATEDBALANCESHEETSParenthetical" xlink:type="extended" id="i64b039ba43244af8a0e8a9b1c5ed70ad_CONSOLIDATEDBALANCESHEETSParenthetical">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementLineItems_7a23ae5b-fbe2-4063-9df1-f937a84ef5a8" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StatementLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PreferredStockSharesIssued_4b09cef4-c5c4-4570-afa0-29fb08606bd0" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PreferredStockSharesIssued"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_7a23ae5b-fbe2-4063-9df1-f937a84ef5a8" xlink:to="loc_us-gaap_PreferredStockSharesIssued_4b09cef4-c5c4-4570-afa0-29fb08606bd0" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockSharesIssued_1e4cff72-574d-4ca6-94ba-aa1e9a596f4d" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CommonStockSharesIssued"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_7a23ae5b-fbe2-4063-9df1-f937a84ef5a8" xlink:to="loc_us-gaap_CommonStockSharesIssued_1e4cff72-574d-4ca6-94ba-aa1e9a596f4d" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TreasuryStockShares_22a9fb7b-7c16-4621-891c-3848ffeea30b" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_TreasuryStockShares"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_7a23ae5b-fbe2-4063-9df1-f937a84ef5a8" xlink:to="loc_us-gaap_TreasuryStockShares_22a9fb7b-7c16-4621-891c-3848ffeea30b" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementTable_7dd3667b-d704-41f7-80cf-0b08879feea3" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StatementTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_StatementLineItems_7a23ae5b-fbe2-4063-9df1-f937a84ef5a8" xlink:to="loc_us-gaap_StatementTable_7dd3667b-d704-41f7-80cf-0b08879feea3" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementClassOfStockAxis_6ead25e9-7e64-457d-8d31-53970550eb24" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StatementClassOfStockAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_StatementTable_7dd3667b-d704-41f7-80cf-0b08879feea3" xlink:to="loc_us-gaap_StatementClassOfStockAxis_6ead25e9-7e64-457d-8d31-53970550eb24" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_6ead25e9-7e64-457d-8d31-53970550eb24_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementClassOfStockAxis_6ead25e9-7e64-457d-8d31-53970550eb24" xlink:to="loc_us-gaap_ClassOfStockDomain_6ead25e9-7e64-457d-8d31-53970550eb24_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_b45e2324-0994-4aea-b250-56a562259181" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementClassOfStockAxis_6ead25e9-7e64-457d-8d31-53970550eb24" xlink:to="loc_us-gaap_ClassOfStockDomain_b45e2324-0994-4aea-b250-56a562259181" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockMember_8f5c3fb6-78e7-4d14-a4a7-d1835a436db3" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CommonStockMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_b45e2324-0994-4aea-b250-56a562259181" xlink:to="loc_us-gaap_CommonStockMember_8f5c3fb6-78e7-4d14-a4a7-d1835a436db3" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonClassBMember_12b2779f-1f7d-44d0-afef-5bc548c50dfa" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CommonClassBMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_b45e2324-0994-4aea-b250-56a562259181" xlink:to="loc_us-gaap_CommonClassBMember_12b2779f-1f7d-44d0-afef-5bc548c50dfa" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/CONSOLIDATEDSTATEMENTSOFSTOCKHOLDERSEQUITY" xlink:type="simple" xlink:href="hsy-20220703.xsd#CONSOLIDATEDSTATEMENTSOFSTOCKHOLDERSEQUITY"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/CONSOLIDATEDSTATEMENTSOFSTOCKHOLDERSEQUITY" xlink:type="extended" id="iaf13fc6b577a4d58b26d68eba9890370_CONSOLIDATEDSTATEMENTSOFSTOCKHOLDERSEQUITY">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementLineItems_40d94f45-5a02-4ac2-aa40-c2b6cd78ae10" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StatementLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_7f9dd6ed-4f96-49bb-9869-95e3421bad1f" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncreaseDecreaseInStockholdersEquityRollForward"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_40d94f45-5a02-4ac2-aa40-c2b6cd78ae10" xlink:to="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_7f9dd6ed-4f96-49bb-9869-95e3421bad1f" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterest_c0e9faa2-6fc6-4812-9116-8346925034c5" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterest"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_7f9dd6ed-4f96-49bb-9869-95e3421bad1f" xlink:to="loc_us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterest_c0e9faa2-6fc6-4812-9116-8346925034c5" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProfitLoss_6c728efd-d02c-485b-abcd-7564a5e8a951" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ProfitLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_7f9dd6ed-4f96-49bb-9869-95e3421bad1f" xlink:to="loc_us-gaap_ProfitLoss_6c728efd-d02c-485b-abcd-7564a5e8a951" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossBeforeReclassificationsNetOfTax_e52933c8-f9eb-4921-9e39-2b380b8a6277" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherComprehensiveIncomeLossBeforeReclassificationsNetOfTax"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_7f9dd6ed-4f96-49bb-9869-95e3421bad1f" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossBeforeReclassificationsNetOfTax_e52933c8-f9eb-4921-9e39-2b380b8a6277" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DividendsCommonStockAbstract_32c482d7-1631-4c67-a6e3-3077e5826878" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DividendsCommonStockAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_7f9dd6ed-4f96-49bb-9869-95e3421bad1f" xlink:to="loc_us-gaap_DividendsCommonStockAbstract_32c482d7-1631-4c67-a6e3-3077e5826878" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DividendsCommonStockCash_78c13488-c010-4426-8d13-4c3bd50ba9e4" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DividendsCommonStockCash"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DividendsCommonStockAbstract_32c482d7-1631-4c67-a6e3-3077e5826878" xlink:to="loc_us-gaap_DividendsCommonStockCash_78c13488-c010-4426-8d13-4c3bd50ba9e4" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockIssuedDuringPeriodValueConversionOfConvertibleSecurities_102836e7-6a28-4b7f-84ed-d5ab9a1850d7" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StockIssuedDuringPeriodValueConversionOfConvertibleSecurities"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_7f9dd6ed-4f96-49bb-9869-95e3421bad1f" xlink:to="loc_us-gaap_StockIssuedDuringPeriodValueConversionOfConvertibleSecurities_102836e7-6a28-4b7f-84ed-d5ab9a1850d7" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AdjustmentsToAdditionalPaidInCapitalSharebasedCompensationRequisiteServicePeriodRecognitionValue_6d7fa1d8-5dac-4317-8706-3006fa6f0a76" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AdjustmentsToAdditionalPaidInCapitalSharebasedCompensationRequisiteServicePeriodRecognitionValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_7f9dd6ed-4f96-49bb-9869-95e3421bad1f" xlink:to="loc_us-gaap_AdjustmentsToAdditionalPaidInCapitalSharebasedCompensationRequisiteServicePeriodRecognitionValue_6d7fa1d8-5dac-4317-8706-3006fa6f0a76" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockIssuedDuringPeriodValueStockOptionsExercised_d2c1839c-83f4-44e4-8bf9-5fe512b892de" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StockIssuedDuringPeriodValueStockOptionsExercised"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_7f9dd6ed-4f96-49bb-9869-95e3421bad1f" xlink:to="loc_us-gaap_StockIssuedDuringPeriodValueStockOptionsExercised_d2c1839c-83f4-44e4-8bf9-5fe512b892de" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TreasuryStockValueAcquiredCostMethod_995f2e04-c40f-469f-bd2e-56e1967e5d38" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_TreasuryStockValueAcquiredCostMethod"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_7f9dd6ed-4f96-49bb-9869-95e3421bad1f" xlink:to="loc_us-gaap_TreasuryStockValueAcquiredCostMethod_995f2e04-c40f-469f-bd2e-56e1967e5d38" xlink:type="arc" order="8"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NoncontrollingInterestDecreaseFromDeconsolidation_a330de3d-7037-4970-ba1d-8e94db521f9f" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NoncontrollingInterestDecreaseFromDeconsolidation"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_7f9dd6ed-4f96-49bb-9869-95e3421bad1f" xlink:to="loc_us-gaap_NoncontrollingInterestDecreaseFromDeconsolidation_a330de3d-7037-4970-ba1d-8e94db521f9f" xlink:type="arc" order="9"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterest_3dfb8dc7-a801-4f32-bcb5-d78ea75e9194" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StockholdersEquityIncludingPortionAttributableToNoncontrollingInterest"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementTable_251ade02-cdaf-4678-b004-42bec67635b6" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StatementTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_StatementLineItems_40d94f45-5a02-4ac2-aa40-c2b6cd78ae10" xlink:to="loc_us-gaap_StatementTable_251ade02-cdaf-4678-b004-42bec67635b6" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementEquityComponentsAxis_565e1722-efdd-4867-9fad-09e1a5d6ffc6" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StatementEquityComponentsAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_StatementTable_251ade02-cdaf-4678-b004-42bec67635b6" xlink:to="loc_us-gaap_StatementEquityComponentsAxis_565e1722-efdd-4867-9fad-09e1a5d6ffc6" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquityComponentDomain_565e1722-efdd-4867-9fad-09e1a5d6ffc6_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EquityComponentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementEquityComponentsAxis_565e1722-efdd-4867-9fad-09e1a5d6ffc6" xlink:to="loc_us-gaap_EquityComponentDomain_565e1722-efdd-4867-9fad-09e1a5d6ffc6_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquityComponentDomain_76b953a1-146f-418a-8af8-f715a3a5fa1c" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EquityComponentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementEquityComponentsAxis_565e1722-efdd-4867-9fad-09e1a5d6ffc6" xlink:to="loc_us-gaap_EquityComponentDomain_76b953a1-146f-418a-8af8-f715a3a5fa1c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PreferredStockMember_94280cd7-b3e6-4cee-a2f9-a5ecff12533c" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PreferredStockMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_76b953a1-146f-418a-8af8-f715a3a5fa1c" xlink:to="loc_us-gaap_PreferredStockMember_94280cd7-b3e6-4cee-a2f9-a5ecff12533c" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockMember_249241b6-61e4-4c4b-be1c-e72e47d2d091" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CommonStockMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_76b953a1-146f-418a-8af8-f715a3a5fa1c" xlink:to="loc_us-gaap_CommonStockMember_249241b6-61e4-4c4b-be1c-e72e47d2d091" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AdditionalPaidInCapitalMember_8bf64913-28ff-4634-bed7-b889eb939848" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AdditionalPaidInCapitalMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_76b953a1-146f-418a-8af8-f715a3a5fa1c" xlink:to="loc_us-gaap_AdditionalPaidInCapitalMember_8bf64913-28ff-4634-bed7-b889eb939848" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetainedEarningsMember_a4b72e98-4982-4b7e-9c44-521d32b38874" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RetainedEarningsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_76b953a1-146f-418a-8af8-f715a3a5fa1c" xlink:to="loc_us-gaap_RetainedEarningsMember_a4b72e98-4982-4b7e-9c44-521d32b38874" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TreasuryStockCommonMember_6d6a7fe9-bc22-40ed-84d8-cc973086708e" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_TreasuryStockCommonMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_76b953a1-146f-418a-8af8-f715a3a5fa1c" xlink:to="loc_us-gaap_TreasuryStockCommonMember_6d6a7fe9-bc22-40ed-84d8-cc973086708e" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccumulatedOtherComprehensiveIncomeMember_b20e628d-2c82-4ae7-ac0e-0ea44b170d43" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccumulatedOtherComprehensiveIncomeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_76b953a1-146f-418a-8af8-f715a3a5fa1c" xlink:to="loc_us-gaap_AccumulatedOtherComprehensiveIncomeMember_b20e628d-2c82-4ae7-ac0e-0ea44b170d43" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NoncontrollingInterestMember_3b25cdd2-b429-47cb-b5d4-e7eb0d31209a" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NoncontrollingInterestMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_76b953a1-146f-418a-8af8-f715a3a5fa1c" xlink:to="loc_us-gaap_NoncontrollingInterestMember_3b25cdd2-b429-47cb-b5d4-e7eb0d31209a" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementClassOfStockAxis_8f34e4e0-c25f-49e5-a54b-5a46a32d7d27" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StatementClassOfStockAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_StatementTable_251ade02-cdaf-4678-b004-42bec67635b6" xlink:to="loc_us-gaap_StatementClassOfStockAxis_8f34e4e0-c25f-49e5-a54b-5a46a32d7d27" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_8f34e4e0-c25f-49e5-a54b-5a46a32d7d27_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementClassOfStockAxis_8f34e4e0-c25f-49e5-a54b-5a46a32d7d27" xlink:to="loc_us-gaap_ClassOfStockDomain_8f34e4e0-c25f-49e5-a54b-5a46a32d7d27_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_074d54ea-efd0-4181-9525-0b75b1f192f1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementClassOfStockAxis_8f34e4e0-c25f-49e5-a54b-5a46a32d7d27" xlink:to="loc_us-gaap_ClassOfStockDomain_074d54ea-efd0-4181-9525-0b75b1f192f1" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockMember_72bc4636-827a-4404-a619-15621944bcc4" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CommonStockMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_074d54ea-efd0-4181-9525-0b75b1f192f1" xlink:to="loc_us-gaap_CommonStockMember_72bc4636-827a-4404-a619-15621944bcc4" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonClassBMember_486dba7c-ccc3-4d87-a3de-e6070fe41104" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CommonClassBMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_074d54ea-efd0-4181-9525-0b75b1f192f1" xlink:to="loc_us-gaap_CommonClassBMember_486dba7c-ccc3-4d87-a3de-e6070fe41104" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/CONSOLIDATEDSTATEMENTSOFSTOCKHOLDERSEQUITYParenthetical" xlink:type="simple" xlink:href="hsy-20220703.xsd#CONSOLIDATEDSTATEMENTSOFSTOCKHOLDERSEQUITYParenthetical"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/CONSOLIDATEDSTATEMENTSOFSTOCKHOLDERSEQUITYParenthetical" xlink:type="extended" id="i2faf6d73587e4eed865447d413138e5d_CONSOLIDATEDSTATEMENTSOFSTOCKHOLDERSEQUITYParenthetical">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementLineItems_69debe2f-7895-4470-88d4-fa3805593f87" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StatementLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockDividendsPerShareCashPaid_3d0f1d04-f731-403a-bfac-f7fda096f826" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CommonStockDividendsPerShareCashPaid"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_69debe2f-7895-4470-88d4-fa3805593f87" xlink:to="loc_us-gaap_CommonStockDividendsPerShareCashPaid_3d0f1d04-f731-403a-bfac-f7fda096f826" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementTable_5cc7e7eb-5d14-48f7-86df-86e455d6e76e" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StatementTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_StatementLineItems_69debe2f-7895-4470-88d4-fa3805593f87" xlink:to="loc_us-gaap_StatementTable_5cc7e7eb-5d14-48f7-86df-86e455d6e76e" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementClassOfStockAxis_2fddfc1f-a281-41be-be11-1ed8e8d7e8f1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StatementClassOfStockAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_StatementTable_5cc7e7eb-5d14-48f7-86df-86e455d6e76e" xlink:to="loc_us-gaap_StatementClassOfStockAxis_2fddfc1f-a281-41be-be11-1ed8e8d7e8f1" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_2fddfc1f-a281-41be-be11-1ed8e8d7e8f1_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementClassOfStockAxis_2fddfc1f-a281-41be-be11-1ed8e8d7e8f1" xlink:to="loc_us-gaap_ClassOfStockDomain_2fddfc1f-a281-41be-be11-1ed8e8d7e8f1_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_bc58d61b-9850-426e-8216-1b976c483556" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementClassOfStockAxis_2fddfc1f-a281-41be-be11-1ed8e8d7e8f1" xlink:to="loc_us-gaap_ClassOfStockDomain_bc58d61b-9850-426e-8216-1b976c483556" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockMember_7c6fd02d-6c8b-4fef-bc3a-72dee3da2dd6" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CommonStockMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_bc58d61b-9850-426e-8216-1b976c483556" xlink:to="loc_us-gaap_CommonStockMember_7c6fd02d-6c8b-4fef-bc3a-72dee3da2dd6" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonClassBMember_cee2fb4a-cc25-4b8f-922d-c885afb84a99" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CommonClassBMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_bc58d61b-9850-426e-8216-1b976c483556" xlink:to="loc_us-gaap_CommonClassBMember_cee2fb4a-cc25-4b8f-922d-c885afb84a99" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/BUSINESSACQUISITIONANDDIVESTITURESPRETZELSINCNARRATIVEDetails" xlink:type="simple" xlink:href="hsy-20220703.xsd#BUSINESSACQUISITIONANDDIVESTITURESPRETZELSINCNARRATIVEDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/BUSINESSACQUISITIONANDDIVESTITURESPRETZELSINCNARRATIVEDetails" xlink:type="extended" id="i42131cdd571c467389dbdcb2f6f3b2ca_BUSINESSACQUISITIONANDDIVESTITURESPRETZELSINCNARRATIVEDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionLineItems_6a2e0711-e18a-4e05-980a-84e725e692df" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessAcquisitionLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_BusinessCombinationNumberOfManufacturingLocations_5526fdc9-a2ec-4320-a772-3da146cd61fd" xlink:href="hsy-20220703.xsd#hsy_BusinessCombinationNumberOfManufacturingLocations"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_6a2e0711-e18a-4e05-980a-84e725e692df" xlink:to="loc_hsy_BusinessCombinationNumberOfManufacturingLocations_5526fdc9-a2ec-4320-a772-3da146cd61fd" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationConsiderationTransferred1_af4ebb99-97b7-4dad-aa6b-a5a1814ff2c1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessCombinationConsiderationTransferred1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_6a2e0711-e18a-4e05-980a-84e725e692df" xlink:to="loc_us-gaap_BusinessCombinationConsiderationTransferred1_af4ebb99-97b7-4dad-aa6b-a5a1814ff2c1" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedTrademarksGross_b017eebc-8b28-4f47-9540-bee260403ec0" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedTrademarksGross"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_6a2e0711-e18a-4e05-980a-84e725e692df" xlink:to="loc_us-gaap_FiniteLivedTrademarksGross_b017eebc-8b28-4f47-9540-bee260403ec0" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedCustomerRelationshipsGross_9af10be7-d38c-42cb-a97c-f2f866f277d7" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedCustomerRelationshipsGross"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_6a2e0711-e18a-4e05-980a-84e725e692df" xlink:to="loc_us-gaap_FiniteLivedCustomerRelationshipsGross_9af10be7-d38c-42cb-a97c-f2f866f277d7" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetUsefulLife_f396ade0-b382-464a-8e48-e80ff2856ed3" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetUsefulLife"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_6a2e0711-e18a-4e05-980a-84e725e692df" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetUsefulLife_f396ade0-b382-464a-8e48-e80ff2856ed3" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_1cb8e829-1a09-4b6c-953e-85fcfb211e48" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_6a2e0711-e18a-4e05-980a-84e725e692df" xlink:to="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_1cb8e829-1a09-4b6c-953e-85fcfb211e48" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAxis_533ba69c-1d16-4604-827e-2d131315c41a" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessAcquisitionAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_1cb8e829-1a09-4b6c-953e-85fcfb211e48" xlink:to="loc_us-gaap_BusinessAcquisitionAxis_533ba69c-1d16-4604-827e-2d131315c41a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_533ba69c-1d16-4604-827e-2d131315c41a_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessAcquisitionAcquireeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_533ba69c-1d16-4604-827e-2d131315c41a" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_533ba69c-1d16-4604-827e-2d131315c41a_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_4715ef53-115f-4223-9cab-39c546606b37" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessAcquisitionAcquireeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_533ba69c-1d16-4604-827e-2d131315c41a" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_4715ef53-115f-4223-9cab-39c546606b37" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_PretzelsIncMember_d0a1ecc9-7e01-465c-81ce-7f725992f65b" xlink:href="hsy-20220703.xsd#hsy_PretzelsIncMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionAcquireeDomain_4715ef53-115f-4223-9cab-39c546606b37" xlink:to="loc_hsy_PretzelsIncMember_d0a1ecc9-7e01-465c-81ce-7f725992f65b" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_b67a790a-e640-4d8e-84fe-0931fa53905e" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_1cb8e829-1a09-4b6c-953e-85fcfb211e48" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_b67a790a-e640-4d8e-84fe-0931fa53905e" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_b67a790a-e640-4d8e-84fe-0931fa53905e_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_b67a790a-e640-4d8e-84fe-0931fa53905e" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_b67a790a-e640-4d8e-84fe-0931fa53905e_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_1c67bf41-ffbc-45c5-b4a2-936587415bb9" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_b67a790a-e640-4d8e-84fe-0931fa53905e" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_1c67bf41-ffbc-45c5-b4a2-936587415bb9" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TrademarksMember_59f1a423-66e8-480f-a953-e2097a7186e3" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_TrademarksMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_1c67bf41-ffbc-45c5-b4a2-936587415bb9" xlink:to="loc_us-gaap_TrademarksMember_59f1a423-66e8-480f-a953-e2097a7186e3" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CustomerRelationshipsMember_3b04a962-9df4-4eb0-a048-d82d7753c79c" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CustomerRelationshipsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_1c67bf41-ffbc-45c5-b4a2-936587415bb9" xlink:to="loc_us-gaap_CustomerRelationshipsMember_3b04a962-9df4-4eb0-a048-d82d7753c79c" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/BUSINESSACQUISITIONSANDDIVESTITUREPRETZELSINCASSETSACQUIREDANDLIABILITIESASSUMEDALLOCATIONDetails" xlink:type="simple" xlink:href="hsy-20220703.xsd#BUSINESSACQUISITIONSANDDIVESTITUREPRETZELSINCASSETSACQUIREDANDLIABILITIESASSUMEDALLOCATIONDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/BUSINESSACQUISITIONSANDDIVESTITUREPRETZELSINCASSETSACQUIREDANDLIABILITIESASSUMEDALLOCATIONDetails" xlink:type="extended" id="i03a627023de547f387df40a4160c51b1_BUSINESSACQUISITIONSANDDIVESTITUREPRETZELSINCASSETSACQUIREDANDLIABILITIESASSUMEDALLOCATIONDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionLineItems_2aba6551-f4c3-433a-8f21-4f676167b755" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessAcquisitionLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Goodwill_61b9152a-3887-4fcd-a018-e9243e711397" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_Goodwill"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2aba6551-f4c3-433a-8f21-4f676167b755" xlink:to="loc_us-gaap_Goodwill_61b9152a-3887-4fcd-a018-e9243e711397" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GoodwillPurchaseAccountingAdjustments_cb566eb8-fb3a-4d22-a1c8-3f29289ef8f0" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_GoodwillPurchaseAccountingAdjustments"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2aba6551-f4c3-433a-8f21-4f676167b755" xlink:to="loc_us-gaap_GoodwillPurchaseAccountingAdjustments_cb566eb8-fb3a-4d22-a1c8-3f29289ef8f0" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibles_54d97cfe-bdce-4783-b4a3-ad00967a19dd" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibles"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2aba6551-f4c3-433a-8f21-4f676167b755" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibles_54d97cfe-bdce-4783-b4a3-ad00967a19dd" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentIntangibles_f6f3dab0-0a16-41b6-8493-cc24a2de7c4a" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentIntangibles"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2aba6551-f4c3-433a-8f21-4f676167b755" xlink:to="loc_us-gaap_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentIntangibles_f6f3dab0-0a16-41b6-8493-cc24a2de7c4a" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCurrentAssets_3d6e8f7a-ef70-4ec5-9754-4410763f6bc8" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCurrentAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2aba6551-f4c3-433a-8f21-4f676167b755" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCurrentAssets_3d6e8f7a-ef70-4ec5-9754-4410763f6bc8" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentCurrentAssets_86c66122-4b18-4420-9ccc-bdcec44c2517" xlink:href="hsy-20220703.xsd#hsy_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentCurrentAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2aba6551-f4c3-433a-8f21-4f676167b755" xlink:to="loc_hsy_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentCurrentAssets_86c66122-4b18-4420-9ccc-bdcec44c2517" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedPropertyPlantAndEquipment_6f06c840-a90b-4ce1-a1dd-e9ea8d171cd4" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedPropertyPlantAndEquipment"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2aba6551-f4c3-433a-8f21-4f676167b755" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedPropertyPlantAndEquipment_6f06c840-a90b-4ce1-a1dd-e9ea8d171cd4" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentPropertyPlantAndEquipment_9d634aec-7955-4802-b2a9-60ae28e7bd29" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentPropertyPlantAndEquipment"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2aba6551-f4c3-433a-8f21-4f676167b755" xlink:to="loc_us-gaap_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentPropertyPlantAndEquipment_9d634aec-7955-4802-b2a9-60ae28e7bd29" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedOtherNoncurrentAssets_3c2e6a17-9b11-4c4d-bf90-be77e5fd5c84" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedOtherNoncurrentAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2aba6551-f4c3-433a-8f21-4f676167b755" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedOtherNoncurrentAssets_3c2e6a17-9b11-4c4d-bf90-be77e5fd5c84" xlink:type="arc" order="8"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedDeferredTaxAssets_dd470d7e-4de7-43cb-a5a1-10d33d857ce1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedDeferredTaxAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2aba6551-f4c3-433a-8f21-4f676167b755" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedDeferredTaxAssets_dd470d7e-4de7-43cb-a5a1-10d33d857ce1" xlink:type="arc" order="9"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_BusinessCombinationProvisionalInformationInitialAccountingIncompleteDeferredIncomeTaxes_0d8115b8-a7f1-47f7-a13d-4183ee3ea1ed" xlink:href="hsy-20220703.xsd#hsy_BusinessCombinationProvisionalInformationInitialAccountingIncompleteDeferredIncomeTaxes"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2aba6551-f4c3-433a-8f21-4f676167b755" xlink:to="loc_hsy_BusinessCombinationProvisionalInformationInitialAccountingIncompleteDeferredIncomeTaxes_0d8115b8-a7f1-47f7-a13d-4183ee3ea1ed" xlink:type="arc" order="10"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCurrentLiabilities_4e0327b3-7dc7-411e-bea3-5f768c1af8f3" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCurrentLiabilities"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2aba6551-f4c3-433a-8f21-4f676167b755" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCurrentLiabilities_4e0327b3-7dc7-411e-bea3-5f768c1af8f3" xlink:type="arc" order="11"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedNoncurrentLiabilitiesOther_cbfdc685-b3d1-4061-a6b8-3ca3e6231b31" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedNoncurrentLiabilitiesOther"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2aba6551-f4c3-433a-8f21-4f676167b755" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedNoncurrentLiabilitiesOther_cbfdc685-b3d1-4061-a6b8-3ca3e6231b31" xlink:type="arc" order="12"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedNet_551d70f7-87a4-4180-be56-c1c8e69ea469" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2aba6551-f4c3-433a-8f21-4f676167b755" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedNet_551d70f7-87a4-4180-be56-c1c8e69ea469" xlink:type="arc" order="13"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentConsiderationTransferred_94f71987-732c-44c2-be85-ee691047daab" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentConsiderationTransferred"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2aba6551-f4c3-433a-8f21-4f676167b755" xlink:to="loc_us-gaap_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentConsiderationTransferred_94f71987-732c-44c2-be85-ee691047daab" xlink:type="arc" order="14"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_6b180079-1892-44a0-820a-6e59417c2b55" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2aba6551-f4c3-433a-8f21-4f676167b755" xlink:to="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_6b180079-1892-44a0-820a-6e59417c2b55" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAxis_053c33a1-bc32-4efd-b4e1-3c4415c135e7" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessAcquisitionAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_6b180079-1892-44a0-820a-6e59417c2b55" xlink:to="loc_us-gaap_BusinessAcquisitionAxis_053c33a1-bc32-4efd-b4e1-3c4415c135e7" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_053c33a1-bc32-4efd-b4e1-3c4415c135e7_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessAcquisitionAcquireeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_053c33a1-bc32-4efd-b4e1-3c4415c135e7" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_053c33a1-bc32-4efd-b4e1-3c4415c135e7_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_ecd719db-6992-4945-a85d-3e3bfa143c7d" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessAcquisitionAcquireeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_053c33a1-bc32-4efd-b4e1-3c4415c135e7" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_ecd719db-6992-4945-a85d-3e3bfa143c7d" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_PretzelsIncMember_9ff692b5-824a-4962-9aac-8c2cb421a327" xlink:href="hsy-20220703.xsd#hsy_PretzelsIncMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionAcquireeDomain_ecd719db-6992-4945-a85d-3e3bfa143c7d" xlink:to="loc_hsy_PretzelsIncMember_9ff692b5-824a-4962-9aac-8c2cb421a327" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/BUSINESSACQUISITIONANDDIVESTITURESDOTSPRETZELSNARRATIVEDetails" xlink:type="simple" xlink:href="hsy-20220703.xsd#BUSINESSACQUISITIONANDDIVESTITURESDOTSPRETZELSNARRATIVEDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/BUSINESSACQUISITIONANDDIVESTITURESDOTSPRETZELSNARRATIVEDetails" xlink:type="extended" id="ifbca841506bd4c5b87066b9cfe720057_BUSINESSACQUISITIONANDDIVESTITURESDOTSPRETZELSNARRATIVEDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionLineItems_f64c0ad9-2b00-4aa4-8911-612c9a28c7f7" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessAcquisitionLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationConsiderationTransferred1_7bb68cde-1d70-4521-89d1-d3411f871a4f" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessCombinationConsiderationTransferred1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_f64c0ad9-2b00-4aa4-8911-612c9a28c7f7" xlink:to="loc_us-gaap_BusinessCombinationConsiderationTransferred1_7bb68cde-1d70-4521-89d1-d3411f871a4f" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedTrademarksGross_d330f6bf-aebd-4c82-bd13-27990cba6f8a" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedTrademarksGross"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_f64c0ad9-2b00-4aa4-8911-612c9a28c7f7" xlink:to="loc_us-gaap_FiniteLivedTrademarksGross_d330f6bf-aebd-4c82-bd13-27990cba6f8a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedCustomerRelationshipsGross_a52d5a1c-40ce-4ebc-b08d-9e5cc081fb53" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedCustomerRelationshipsGross"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_f64c0ad9-2b00-4aa4-8911-612c9a28c7f7" xlink:to="loc_us-gaap_FiniteLivedCustomerRelationshipsGross_a52d5a1c-40ce-4ebc-b08d-9e5cc081fb53" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetUsefulLife_9c79dae8-9479-40b9-b330-6d3e3b938ab8" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetUsefulLife"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_f64c0ad9-2b00-4aa4-8911-612c9a28c7f7" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetUsefulLife_9c79dae8-9479-40b9-b330-6d3e3b938ab8" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_8322b8d4-1652-48cf-a6f8-4c56cdb62f81" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_f64c0ad9-2b00-4aa4-8911-612c9a28c7f7" xlink:to="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_8322b8d4-1652-48cf-a6f8-4c56cdb62f81" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAxis_72ef2dec-0a3c-4d17-a13d-bd05224a7041" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessAcquisitionAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_8322b8d4-1652-48cf-a6f8-4c56cdb62f81" xlink:to="loc_us-gaap_BusinessAcquisitionAxis_72ef2dec-0a3c-4d17-a13d-bd05224a7041" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_72ef2dec-0a3c-4d17-a13d-bd05224a7041_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessAcquisitionAcquireeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_72ef2dec-0a3c-4d17-a13d-bd05224a7041" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_72ef2dec-0a3c-4d17-a13d-bd05224a7041_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_46ed564f-6e52-4507-95ce-cbfc85b4d7c7" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessAcquisitionAcquireeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_72ef2dec-0a3c-4d17-a13d-bd05224a7041" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_46ed564f-6e52-4507-95ce-cbfc85b4d7c7" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_DotsPretzelsLLCMember_cc7a79ee-9185-4074-957a-e1573208e025" xlink:href="hsy-20220703.xsd#hsy_DotsPretzelsLLCMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionAcquireeDomain_46ed564f-6e52-4507-95ce-cbfc85b4d7c7" xlink:to="loc_hsy_DotsPretzelsLLCMember_cc7a79ee-9185-4074-957a-e1573208e025" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_de476cd4-2e29-4278-a212-68216e6364fe" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_8322b8d4-1652-48cf-a6f8-4c56cdb62f81" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_de476cd4-2e29-4278-a212-68216e6364fe" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_de476cd4-2e29-4278-a212-68216e6364fe_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_de476cd4-2e29-4278-a212-68216e6364fe" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_de476cd4-2e29-4278-a212-68216e6364fe_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_57f201a7-5b26-4b8b-8beb-a10b570a2b9c" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_de476cd4-2e29-4278-a212-68216e6364fe" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_57f201a7-5b26-4b8b-8beb-a10b570a2b9c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TrademarksMember_f51d88e3-2dc8-40fd-ace5-84348843d2a7" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_TrademarksMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_57f201a7-5b26-4b8b-8beb-a10b570a2b9c" xlink:to="loc_us-gaap_TrademarksMember_f51d88e3-2dc8-40fd-ace5-84348843d2a7" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CustomerRelationshipsMember_a608bb5d-e604-4025-bd19-f57945c5a0bb" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CustomerRelationshipsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_57f201a7-5b26-4b8b-8beb-a10b570a2b9c" xlink:to="loc_us-gaap_CustomerRelationshipsMember_a608bb5d-e604-4025-bd19-f57945c5a0bb" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/BUSINESSACQUISITIONSANDDIVESTITUREDOTSPRETZELSASSETSACQUIREDANDLIABILITIESASSUMEDALLOCATIONDetails" xlink:type="simple" xlink:href="hsy-20220703.xsd#BUSINESSACQUISITIONSANDDIVESTITUREDOTSPRETZELSASSETSACQUIREDANDLIABILITIESASSUMEDALLOCATIONDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/BUSINESSACQUISITIONSANDDIVESTITUREDOTSPRETZELSASSETSACQUIREDANDLIABILITIESASSUMEDALLOCATIONDetails" xlink:type="extended" id="i4d9d15187e02486b99799665e66482cc_BUSINESSACQUISITIONSANDDIVESTITUREDOTSPRETZELSASSETSACQUIREDANDLIABILITIESASSUMEDALLOCATIONDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionLineItems_2f523a23-04b3-4b69-b635-a5ed1d93d337" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessAcquisitionLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Goodwill_cd680eb8-1b44-4f70-8d04-77df94bfc7a1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_Goodwill"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2f523a23-04b3-4b69-b635-a5ed1d93d337" xlink:to="loc_us-gaap_Goodwill_cd680eb8-1b44-4f70-8d04-77df94bfc7a1" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GoodwillPurchaseAccountingAdjustments_3a6af86c-db44-4ed6-b1c0-d53304b0fae3" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_GoodwillPurchaseAccountingAdjustments"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2f523a23-04b3-4b69-b635-a5ed1d93d337" xlink:to="loc_us-gaap_GoodwillPurchaseAccountingAdjustments_3a6af86c-db44-4ed6-b1c0-d53304b0fae3" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibles_ef7d022c-7187-4fa5-ad44-52ba56a65af5" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibles"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2f523a23-04b3-4b69-b635-a5ed1d93d337" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibles_ef7d022c-7187-4fa5-ad44-52ba56a65af5" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentIntangibles_8291e7c8-e263-4352-a7b3-17ed94058851" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentIntangibles"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2f523a23-04b3-4b69-b635-a5ed1d93d337" xlink:to="loc_us-gaap_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentIntangibles_8291e7c8-e263-4352-a7b3-17ed94058851" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCurrentAssets_592a4b2b-a4f9-4d65-bb37-bc47c2b85760" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCurrentAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2f523a23-04b3-4b69-b635-a5ed1d93d337" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCurrentAssets_592a4b2b-a4f9-4d65-bb37-bc47c2b85760" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedPropertyPlantAndEquipment_3eb82533-2967-4a29-ac6b-91e43934ef35" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedPropertyPlantAndEquipment"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2f523a23-04b3-4b69-b635-a5ed1d93d337" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedPropertyPlantAndEquipment_3eb82533-2967-4a29-ac6b-91e43934ef35" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentPropertyPlantAndEquipment_1367c0ba-381b-48df-b29f-7803418d4b33" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentPropertyPlantAndEquipment"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2f523a23-04b3-4b69-b635-a5ed1d93d337" xlink:to="loc_us-gaap_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentPropertyPlantAndEquipment_1367c0ba-381b-48df-b29f-7803418d4b33" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedOtherNoncurrentAssets_ad78cc10-d0a2-4618-a0d6-614a8f8cbd6b" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedOtherNoncurrentAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2f523a23-04b3-4b69-b635-a5ed1d93d337" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedOtherNoncurrentAssets_ad78cc10-d0a2-4618-a0d6-614a8f8cbd6b" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCurrentLiabilitiesOther_b86ad6b3-d646-4121-8e56-102fc6601e3b" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCurrentLiabilitiesOther"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2f523a23-04b3-4b69-b635-a5ed1d93d337" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCurrentLiabilitiesOther_b86ad6b3-d646-4121-8e56-102fc6601e3b" xlink:type="arc" order="8"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentCurrentLiabilitiesOther_44a4a822-5993-4fa0-90ca-0d7273eed122" xlink:href="hsy-20220703.xsd#hsy_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentCurrentLiabilitiesOther"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2f523a23-04b3-4b69-b635-a5ed1d93d337" xlink:to="loc_hsy_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentCurrentLiabilitiesOther_44a4a822-5993-4fa0-90ca-0d7273eed122" xlink:type="arc" order="9"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedNet_14d1b3b2-9c46-49ce-8c39-5b5ac265fd0f" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2f523a23-04b3-4b69-b635-a5ed1d93d337" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedNet_14d1b3b2-9c46-49ce-8c39-5b5ac265fd0f" xlink:type="arc" order="10"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentConsiderationTransferred_f230cad5-5075-40fc-99c8-df8fbbcb25ad" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentConsiderationTransferred"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2f523a23-04b3-4b69-b635-a5ed1d93d337" xlink:to="loc_us-gaap_BusinessCombinationProvisionalInformationInitialAccountingIncompleteAdjustmentConsiderationTransferred_f230cad5-5075-40fc-99c8-df8fbbcb25ad" xlink:type="arc" order="11"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_f5399367-5ff2-4522-a417-ae5b479fa4c5" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_2f523a23-04b3-4b69-b635-a5ed1d93d337" xlink:to="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_f5399367-5ff2-4522-a417-ae5b479fa4c5" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAxis_85eb2354-8fde-4734-9627-1dfe1a634925" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessAcquisitionAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_f5399367-5ff2-4522-a417-ae5b479fa4c5" xlink:to="loc_us-gaap_BusinessAcquisitionAxis_85eb2354-8fde-4734-9627-1dfe1a634925" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_85eb2354-8fde-4734-9627-1dfe1a634925_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessAcquisitionAcquireeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_85eb2354-8fde-4734-9627-1dfe1a634925" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_85eb2354-8fde-4734-9627-1dfe1a634925_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_44188366-2055-4bb4-9bc9-4460280ce0e7" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessAcquisitionAcquireeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_85eb2354-8fde-4734-9627-1dfe1a634925" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_44188366-2055-4bb4-9bc9-4460280ce0e7" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_DotsPretzelsLLCMember_459416f6-af2b-437b-88cb-3f6f3a272f75" xlink:href="hsy-20220703.xsd#hsy_DotsPretzelsLLCMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionAcquireeDomain_44188366-2055-4bb4-9bc9-4460280ce0e7" xlink:to="loc_hsy_DotsPretzelsLLCMember_459416f6-af2b-437b-88cb-3f6f3a272f75" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/BUSINESSACQUISITIONSANDDIVESTITURELILYSSWEETSLLCNARRATIVEDetails" xlink:type="simple" xlink:href="hsy-20220703.xsd#BUSINESSACQUISITIONSANDDIVESTITURELILYSSWEETSLLCNARRATIVEDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/BUSINESSACQUISITIONSANDDIVESTITURELILYSSWEETSLLCNARRATIVEDetails" xlink:type="extended" id="i1e02d77cafbb44a4a01ade594b2faf18_BUSINESSACQUISITIONSANDDIVESTITURELILYSSWEETSLLCNARRATIVEDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionLineItems_a4b14481-e4d1-4533-9e2f-8eefc624950e" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessAcquisitionLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationConsiderationTransferred1_7425aaa8-add8-490f-9a4e-d4bacea38990" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessCombinationConsiderationTransferred1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_a4b14481-e4d1-4533-9e2f-8eefc624950e" xlink:to="loc_us-gaap_BusinessCombinationConsiderationTransferred1_7425aaa8-add8-490f-9a4e-d4bacea38990" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationContingentConsiderationLiability_92d37a1f-f8af-4590-93cc-2bcd8b121951" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessCombinationContingentConsiderationLiability"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_a4b14481-e4d1-4533-9e2f-8eefc624950e" xlink:to="loc_us-gaap_BusinessCombinationContingentConsiderationLiability_92d37a1f-f8af-4590-93cc-2bcd8b121951" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedTrademarksGross_6f8ee665-4dd0-4a79-964c-6a71ff68ea07" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedTrademarksGross"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_a4b14481-e4d1-4533-9e2f-8eefc624950e" xlink:to="loc_us-gaap_FiniteLivedTrademarksGross_6f8ee665-4dd0-4a79-964c-6a71ff68ea07" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedCustomerRelationshipsGross_313b1e2e-7759-4ce5-a3d2-cbfc80f178a3" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedCustomerRelationshipsGross"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_a4b14481-e4d1-4533-9e2f-8eefc624950e" xlink:to="loc_us-gaap_FiniteLivedCustomerRelationshipsGross_313b1e2e-7759-4ce5-a3d2-cbfc80f178a3" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetUsefulLife_390cc677-5aa5-4634-80a5-fce15ca97d17" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetUsefulLife"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_a4b14481-e4d1-4533-9e2f-8eefc624950e" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetUsefulLife_390cc677-5aa5-4634-80a5-fce15ca97d17" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_462185e0-1cd8-47e4-bc46-47dc0daf6a28" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_a4b14481-e4d1-4533-9e2f-8eefc624950e" xlink:to="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_462185e0-1cd8-47e4-bc46-47dc0daf6a28" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAxis_618d8e83-b791-4bee-af44-976e4c9dfca0" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessAcquisitionAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_462185e0-1cd8-47e4-bc46-47dc0daf6a28" xlink:to="loc_us-gaap_BusinessAcquisitionAxis_618d8e83-b791-4bee-af44-976e4c9dfca0" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_618d8e83-b791-4bee-af44-976e4c9dfca0_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessAcquisitionAcquireeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_618d8e83-b791-4bee-af44-976e4c9dfca0" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_618d8e83-b791-4bee-af44-976e4c9dfca0_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_5554ac0e-1c67-4ab1-8f10-b108000ad3fd" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessAcquisitionAcquireeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_618d8e83-b791-4bee-af44-976e4c9dfca0" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_5554ac0e-1c67-4ab1-8f10-b108000ad3fd" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_LilysSweetsLLCMember_aaa50212-ed58-49d2-8c7b-c066ccc9bcb9" xlink:href="hsy-20220703.xsd#hsy_LilysSweetsLLCMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionAcquireeDomain_5554ac0e-1c67-4ab1-8f10-b108000ad3fd" xlink:to="loc_hsy_LilysSweetsLLCMember_aaa50212-ed58-49d2-8c7b-c066ccc9bcb9" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_3fb6ce0c-fe6e-4211-ac4f-4f79abb93c06" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_462185e0-1cd8-47e4-bc46-47dc0daf6a28" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_3fb6ce0c-fe6e-4211-ac4f-4f79abb93c06" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_3fb6ce0c-fe6e-4211-ac4f-4f79abb93c06_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_3fb6ce0c-fe6e-4211-ac4f-4f79abb93c06" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_3fb6ce0c-fe6e-4211-ac4f-4f79abb93c06_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_99a13f76-7a80-42dc-b4f7-9022ce2b2a3d" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_3fb6ce0c-fe6e-4211-ac4f-4f79abb93c06" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_99a13f76-7a80-42dc-b4f7-9022ce2b2a3d" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TrademarksMember_64413933-9d16-4a24-bba1-5fd2370967ed" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_TrademarksMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_99a13f76-7a80-42dc-b4f7-9022ce2b2a3d" xlink:to="loc_us-gaap_TrademarksMember_64413933-9d16-4a24-bba1-5fd2370967ed" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CustomerRelationshipsMember_893942b9-d4ee-4526-b669-71c5691c4d46" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CustomerRelationshipsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_99a13f76-7a80-42dc-b4f7-9022ce2b2a3d" xlink:to="loc_us-gaap_CustomerRelationshipsMember_893942b9-d4ee-4526-b669-71c5691c4d46" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeAxis_8af7fbb3-6118-41d1-b31a-64adb6a941e3" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_RangeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_462185e0-1cd8-47e4-bc46-47dc0daf6a28" xlink:to="loc_srt_RangeAxis_8af7fbb3-6118-41d1-b31a-64adb6a941e3" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_8af7fbb3-6118-41d1-b31a-64adb6a941e3_default" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_RangeAxis_8af7fbb3-6118-41d1-b31a-64adb6a941e3" xlink:to="loc_srt_RangeMember_8af7fbb3-6118-41d1-b31a-64adb6a941e3_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_1fbfa233-31e0-499a-a59f-977815b1cd84" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_RangeAxis_8af7fbb3-6118-41d1-b31a-64adb6a941e3" xlink:to="loc_srt_RangeMember_1fbfa233-31e0-499a-a59f-977815b1cd84" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MinimumMember_fd488d94-6fc0-4b28-b4e7-46803dc06efb" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_MinimumMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_1fbfa233-31e0-499a-a59f-977815b1cd84" xlink:to="loc_srt_MinimumMember_fd488d94-6fc0-4b28-b4e7-46803dc06efb" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MaximumMember_05b77368-84d9-4360-a4a0-12b3a79006fa" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_MaximumMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_1fbfa233-31e0-499a-a59f-977815b1cd84" xlink:to="loc_srt_MaximumMember_05b77368-84d9-4360-a4a0-12b3a79006fa" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/BUSINESSACQUISITIONANDDIVESTITURESLILYSSWEETSLLCASSETSACQUIREDANDLIABILITIESASSUMEDALLOCATIONDetails" xlink:type="simple" xlink:href="hsy-20220703.xsd#BUSINESSACQUISITIONANDDIVESTITURESLILYSSWEETSLLCASSETSACQUIREDANDLIABILITIESASSUMEDALLOCATIONDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/BUSINESSACQUISITIONANDDIVESTITURESLILYSSWEETSLLCASSETSACQUIREDANDLIABILITIESASSUMEDALLOCATIONDetails" xlink:type="extended" id="idfffb603797d4fd3b6326c8fe6d01f89_BUSINESSACQUISITIONANDDIVESTITURESLILYSSWEETSLLCASSETSACQUIREDANDLIABILITIESASSUMEDALLOCATIONDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionLineItems_91393e6a-36d7-44c5-8ff9-ed56a249613c" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessAcquisitionLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Goodwill_7169dd3d-5013-49f5-93d5-cb85cbf67a6c" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_Goodwill"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_91393e6a-36d7-44c5-8ff9-ed56a249613c" xlink:to="loc_us-gaap_Goodwill_7169dd3d-5013-49f5-93d5-cb85cbf67a6c" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibles_b16cb126-f89f-4adc-a036-af90c791998f" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibles"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_91393e6a-36d7-44c5-8ff9-ed56a249613c" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibles_b16cb126-f89f-4adc-a036-af90c791998f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCurrentAssetsOther_99197a30-b248-4558-8af5-565f6014b8e7" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCurrentAssetsOther"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_91393e6a-36d7-44c5-8ff9-ed56a249613c" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCurrentAssetsOther_99197a30-b248-4558-8af5-565f6014b8e7" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCurrentLiabilitiesOther_2f9d0a33-cbca-4fa5-9321-ade82c54c730" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCurrentLiabilitiesOther"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_91393e6a-36d7-44c5-8ff9-ed56a249613c" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCurrentLiabilitiesOther_2f9d0a33-cbca-4fa5-9321-ade82c54c730" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedDeferredTaxLiabilities_04444a73-6eaf-403e-9be5-139be7c5afbe" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedDeferredTaxLiabilities"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_91393e6a-36d7-44c5-8ff9-ed56a249613c" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedDeferredTaxLiabilities_04444a73-6eaf-403e-9be5-139be7c5afbe" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedNet_04ca479d-b23a-47ae-8dee-5e0b98bcb9d5" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_91393e6a-36d7-44c5-8ff9-ed56a249613c" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedNet_04ca479d-b23a-47ae-8dee-5e0b98bcb9d5" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_456b6b8f-ee57-4532-a40b-db00bc0a4082" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_91393e6a-36d7-44c5-8ff9-ed56a249613c" xlink:to="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_456b6b8f-ee57-4532-a40b-db00bc0a4082" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAxis_ccbbad37-6e24-4efc-904b-2c24ee31313f" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessAcquisitionAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_456b6b8f-ee57-4532-a40b-db00bc0a4082" xlink:to="loc_us-gaap_BusinessAcquisitionAxis_ccbbad37-6e24-4efc-904b-2c24ee31313f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_ccbbad37-6e24-4efc-904b-2c24ee31313f_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessAcquisitionAcquireeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_ccbbad37-6e24-4efc-904b-2c24ee31313f" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_ccbbad37-6e24-4efc-904b-2c24ee31313f_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_fd4fef33-0923-495a-be1a-d06364395435" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessAcquisitionAcquireeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_ccbbad37-6e24-4efc-904b-2c24ee31313f" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_fd4fef33-0923-495a-be1a-d06364395435" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_LilysSweetsLLCMember_2cb85f3b-636d-492b-8c44-93b84caaedac" xlink:href="hsy-20220703.xsd#hsy_LilysSweetsLLCMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionAcquireeDomain_fd4fef33-0923-495a-be1a-d06364395435" xlink:to="loc_hsy_LilysSweetsLLCMember_2cb85f3b-636d-492b-8c44-93b84caaedac" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/GOODWILLANDINTANGIBLEASSETSSCHEDULEOFCHANGESINCARRYINGVALUEOFGOODWILLBYREPORTABLESEGMENTDetails" xlink:type="simple" xlink:href="hsy-20220703.xsd#GOODWILLANDINTANGIBLEASSETSSCHEDULEOFCHANGESINCARRYINGVALUEOFGOODWILLBYREPORTABLESEGMENTDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/GOODWILLANDINTANGIBLEASSETSSCHEDULEOFCHANGESINCARRYINGVALUEOFGOODWILLBYREPORTABLESEGMENTDetails" xlink:type="extended" id="idc08e3b8cfcc4c6381510b3510620cdf_GOODWILLANDINTANGIBLEASSETSSCHEDULEOFCHANGESINCARRYINGVALUEOFGOODWILLBYREPORTABLESEGMENTDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GoodwillLineItems_d9978eda-023d-4258-a2f1-e8d7b9df5bb2" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_GoodwillLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GoodwillRollForward_789e4ec4-5f99-4489-a5e2-0b5d80198d70" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_GoodwillRollForward"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_GoodwillLineItems_d9978eda-023d-4258-a2f1-e8d7b9df5bb2" xlink:to="loc_us-gaap_GoodwillRollForward_789e4ec4-5f99-4489-a5e2-0b5d80198d70" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Goodwill_088965a3-94b6-4e27-958f-fb0d61d0668d" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_Goodwill"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_GoodwillRollForward_789e4ec4-5f99-4489-a5e2-0b5d80198d70" xlink:to="loc_us-gaap_Goodwill_088965a3-94b6-4e27-958f-fb0d61d0668d" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GoodwillPurchaseAccountingAdjustments_6356fa0b-3386-43b5-8dc4-2d68bc9d2893" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_GoodwillPurchaseAccountingAdjustments"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_GoodwillRollForward_789e4ec4-5f99-4489-a5e2-0b5d80198d70" xlink:to="loc_us-gaap_GoodwillPurchaseAccountingAdjustments_6356fa0b-3386-43b5-8dc4-2d68bc9d2893" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GoodwillForeignCurrencyTranslationGainLoss_f83f5a9e-88fc-4eae-a9ff-f39c1cec8a2e" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_GoodwillForeignCurrencyTranslationGainLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_GoodwillRollForward_789e4ec4-5f99-4489-a5e2-0b5d80198d70" xlink:to="loc_us-gaap_GoodwillForeignCurrencyTranslationGainLoss_f83f5a9e-88fc-4eae-a9ff-f39c1cec8a2e" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Goodwill_b77e40a3-3476-4da2-9458-5f8af5ae5601" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_Goodwill"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfGoodwillTable_70ac0da5-25ee-424f-80e9-1e69201ace58" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfGoodwillTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_GoodwillLineItems_d9978eda-023d-4258-a2f1-e8d7b9df5bb2" xlink:to="loc_us-gaap_ScheduleOfGoodwillTable_70ac0da5-25ee-424f-80e9-1e69201ace58" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsAxis_96b16801-7c08-4179-9dbd-2ebede7b7660" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_ConsolidationItemsAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfGoodwillTable_70ac0da5-25ee-424f-80e9-1e69201ace58" xlink:to="loc_srt_ConsolidationItemsAxis_96b16801-7c08-4179-9dbd-2ebede7b7660" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsDomain_96b16801-7c08-4179-9dbd-2ebede7b7660_default" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_ConsolidationItemsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_ConsolidationItemsAxis_96b16801-7c08-4179-9dbd-2ebede7b7660" xlink:to="loc_srt_ConsolidationItemsDomain_96b16801-7c08-4179-9dbd-2ebede7b7660_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsDomain_21f09a75-f2ca-4e1f-bf8c-b7a10d4a9a3f" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_ConsolidationItemsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_ConsolidationItemsAxis_96b16801-7c08-4179-9dbd-2ebede7b7660" xlink:to="loc_srt_ConsolidationItemsDomain_21f09a75-f2ca-4e1f-bf8c-b7a10d4a9a3f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingSegmentsMember_c9f0785d-2392-4a56-a836-0d0c4a8162f4" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OperatingSegmentsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ConsolidationItemsDomain_21f09a75-f2ca-4e1f-bf8c-b7a10d4a9a3f" xlink:to="loc_us-gaap_OperatingSegmentsMember_c9f0785d-2392-4a56-a836-0d0c4a8162f4" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementBusinessSegmentsAxis_22ce5939-eecd-4de3-b2d1-a831d005833e" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StatementBusinessSegmentsAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfGoodwillTable_70ac0da5-25ee-424f-80e9-1e69201ace58" xlink:to="loc_us-gaap_StatementBusinessSegmentsAxis_22ce5939-eecd-4de3-b2d1-a831d005833e" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SegmentDomain_22ce5939-eecd-4de3-b2d1-a831d005833e_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_SegmentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementBusinessSegmentsAxis_22ce5939-eecd-4de3-b2d1-a831d005833e" xlink:to="loc_us-gaap_SegmentDomain_22ce5939-eecd-4de3-b2d1-a831d005833e_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SegmentDomain_2da283dc-1a50-4bed-be9a-dff16a67e640" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_SegmentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementBusinessSegmentsAxis_22ce5939-eecd-4de3-b2d1-a831d005833e" xlink:to="loc_us-gaap_SegmentDomain_2da283dc-1a50-4bed-be9a-dff16a67e640" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_NorthAmericaConfectionerySegmentMember_a8f70a26-d245-4244-a261-1610254661c4" xlink:href="hsy-20220703.xsd#hsy_NorthAmericaConfectionerySegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentDomain_2da283dc-1a50-4bed-be9a-dff16a67e640" xlink:to="loc_hsy_NorthAmericaConfectionerySegmentMember_a8f70a26-d245-4244-a261-1610254661c4" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_NorthAmericaSaltySnacksSegmentMember_d0203fc3-0412-47c8-be80-0936b3f6d95c" xlink:href="hsy-20220703.xsd#hsy_NorthAmericaSaltySnacksSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentDomain_2da283dc-1a50-4bed-be9a-dff16a67e640" xlink:to="loc_hsy_NorthAmericaSaltySnacksSegmentMember_d0203fc3-0412-47c8-be80-0936b3f6d95c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_InternationalSegmentMember_58b93d49-9410-4788-9a7c-b552fd096d65" xlink:href="hsy-20220703.xsd#hsy_InternationalSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentDomain_2da283dc-1a50-4bed-be9a-dff16a67e640" xlink:to="loc_hsy_InternationalSegmentMember_58b93d49-9410-4788-9a7c-b552fd096d65" xlink:type="arc" order="2"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/GOODWILLANDINTANGIBLEASSETSSCHEDULEOFGROSSCARRYINGAMOUNTANDACCUMULATEDAMORTIZATIONFOREACHMAJORCLASSOFINTANGIBLEASSETDetails" xlink:type="simple" xlink:href="hsy-20220703.xsd#GOODWILLANDINTANGIBLEASSETSSCHEDULEOFGROSSCARRYINGAMOUNTANDACCUMULATEDAMORTIZATIONFOREACHMAJORCLASSOFINTANGIBLEASSETDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/GOODWILLANDINTANGIBLEASSETSSCHEDULEOFGROSSCARRYINGAMOUNTANDACCUMULATEDAMORTIZATIONFOREACHMAJORCLASSOFINTANGIBLEASSETDetails" xlink:type="extended" id="i96971f862435433d99c37aec58599f76_GOODWILLANDINTANGIBLEASSETSSCHEDULEOFGROSSCARRYINGAMOUNTANDACCUMULATEDAMORTIZATIONFOREACHMAJORCLASSOFINTANGIBLEASSETDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_b2e7fc3a-8722-42df-8451-006e3901e291" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsGross_b7f0c50a-56fb-47d1-8781-ad350001ef65" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsGross"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_b2e7fc3a-8722-42df-8451-006e3901e291" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsGross_b7f0c50a-56fb-47d1-8781-ad350001ef65" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization_5e7f6cd7-e607-40d0-8627-9aae5af41cfc" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_b2e7fc3a-8722-42df-8451-006e3901e291" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization_5e7f6cd7-e607-40d0-8627-9aae5af41cfc" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IndefiniteLivedIntangibleAssetsExcludingGoodwill_df3539b4-405e-4b07-bec8-9a014492e031" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IndefiniteLivedIntangibleAssetsExcludingGoodwill"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_b2e7fc3a-8722-42df-8451-006e3901e291" xlink:to="loc_us-gaap_IndefiniteLivedIntangibleAssetsExcludingGoodwill_df3539b4-405e-4b07-bec8-9a014492e031" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IntangibleAssetsNetExcludingGoodwill_cbe137cb-7f7e-4436-b191-a70cec3ddef0" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IntangibleAssetsNetExcludingGoodwill"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_b2e7fc3a-8722-42df-8451-006e3901e291" xlink:to="loc_us-gaap_IntangibleAssetsNetExcludingGoodwill_cbe137cb-7f7e-4436-b191-a70cec3ddef0" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTable_6056f5d3-8285-4ff1-8e53-0e9db0ec18d2" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_b2e7fc3a-8722-42df-8451-006e3901e291" xlink:to="loc_us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTable_6056f5d3-8285-4ff1-8e53-0e9db0ec18d2" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_a69a14ea-c227-4a91-8331-dbe63f1dcd1e" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTable_6056f5d3-8285-4ff1-8e53-0e9db0ec18d2" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_a69a14ea-c227-4a91-8331-dbe63f1dcd1e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_a69a14ea-c227-4a91-8331-dbe63f1dcd1e_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_a69a14ea-c227-4a91-8331-dbe63f1dcd1e" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_a69a14ea-c227-4a91-8331-dbe63f1dcd1e_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_e8c3cd7a-25bd-44e7-ba99-ef64322fc8da" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_a69a14ea-c227-4a91-8331-dbe63f1dcd1e" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_e8c3cd7a-25bd-44e7-ba99-ef64322fc8da" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TrademarksMember_64d34a0e-8cc9-468d-a175-9957f93f890d" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_TrademarksMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_e8c3cd7a-25bd-44e7-ba99-ef64322fc8da" xlink:to="loc_us-gaap_TrademarksMember_64d34a0e-8cc9-468d-a175-9957f93f890d" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CustomerRelatedIntangibleAssetsMember_d3fdbaf9-be45-4287-ac76-c88a30026e41" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CustomerRelatedIntangibleAssetsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_e8c3cd7a-25bd-44e7-ba99-ef64322fc8da" xlink:to="loc_us-gaap_CustomerRelatedIntangibleAssetsMember_d3fdbaf9-be45-4287-ac76-c88a30026e41" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PatentsMember_79ce6603-4db2-4cc8-a476-fd8aa647813d" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PatentsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_e8c3cd7a-25bd-44e7-ba99-ef64322fc8da" xlink:to="loc_us-gaap_PatentsMember_79ce6603-4db2-4cc8-a476-fd8aa647813d" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis_de81be2c-b7c3-49b8-b4fe-266d9e72c7fc" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTable_6056f5d3-8285-4ff1-8e53-0e9db0ec18d2" xlink:to="loc_us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis_de81be2c-b7c3-49b8-b4fe-266d9e72c7fc" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain_de81be2c-b7c3-49b8-b4fe-266d9e72c7fc_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis_de81be2c-b7c3-49b8-b4fe-266d9e72c7fc" xlink:to="loc_us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain_de81be2c-b7c3-49b8-b4fe-266d9e72c7fc_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain_ead4976d-2694-4ca5-ad2c-46ec4faec6a8" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis_de81be2c-b7c3-49b8-b4fe-266d9e72c7fc" xlink:to="loc_us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain_ead4976d-2694-4ca5-ad2c-46ec4faec6a8" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TrademarksMember_4dd54908-a7f3-410d-bf80-fb7a41f93018" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_TrademarksMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain_ead4976d-2694-4ca5-ad2c-46ec4faec6a8" xlink:to="loc_us-gaap_TrademarksMember_4dd54908-a7f3-410d-bf80-fb7a41f93018" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/SHORTANDLONGTERMDEBTSHORTTERMDEBTNARRATIVEDetails" xlink:type="simple" xlink:href="hsy-20220703.xsd#SHORTANDLONGTERMDEBTSHORTTERMDEBTNARRATIVEDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/SHORTANDLONGTERMDEBTSHORTTERMDEBTNARRATIVEDetails" xlink:type="extended" id="i7ffb13418797456088f345adaa791e05_SHORTANDLONGTERMDEBTSHORTTERMDEBTNARRATIVEDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LineOfCreditFacilityLineItems_1ad776d8-69ff-44d3-8ed8-bbcf4799c76c" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LineOfCreditFacilityLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LineOfCreditFacilityMaximumBorrowingCapacity_b5f05c2c-673f-4e0b-989e-73a50dae65c6" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LineOfCreditFacilityMaximumBorrowingCapacity"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LineOfCreditFacilityLineItems_1ad776d8-69ff-44d3-8ed8-bbcf4799c76c" xlink:to="loc_us-gaap_LineOfCreditFacilityMaximumBorrowingCapacity_b5f05c2c-673f-4e0b-989e-73a50dae65c6" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_LineOfCreditFacilityAccordionFeatureIncreaseLimit_a4ed0ca5-38c3-4e25-a24e-567efe3b2635" xlink:href="hsy-20220703.xsd#hsy_LineOfCreditFacilityAccordionFeatureIncreaseLimit"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LineOfCreditFacilityLineItems_1ad776d8-69ff-44d3-8ed8-bbcf4799c76c" xlink:to="loc_hsy_LineOfCreditFacilityAccordionFeatureIncreaseLimit_a4ed0ca5-38c3-4e25-a24e-567efe3b2635" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_DebtTerminationDateExtensionTerm_dc2ce680-0c90-4705-b04c-674738d61f13" xlink:href="hsy-20220703.xsd#hsy_DebtTerminationDateExtensionTerm"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LineOfCreditFacilityLineItems_1ad776d8-69ff-44d3-8ed8-bbcf4799c76c" xlink:to="loc_hsy_DebtTerminationDateExtensionTerm_dc2ce680-0c90-4705-b04c-674738d61f13" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_DebtTerminationDateNumberOfExtensionOption_55d1c47b-6bb7-4d9a-972c-03a0e9073a94" xlink:href="hsy-20220703.xsd#hsy_DebtTerminationDateNumberOfExtensionOption"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LineOfCreditFacilityLineItems_1ad776d8-69ff-44d3-8ed8-bbcf4799c76c" xlink:to="loc_hsy_DebtTerminationDateNumberOfExtensionOption_55d1c47b-6bb7-4d9a-972c-03a0e9073a94" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LinesOfCreditCurrent_6cf98883-2dc9-488e-8572-deb01da30c3b" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LinesOfCreditCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LineOfCreditFacilityLineItems_1ad776d8-69ff-44d3-8ed8-bbcf4799c76c" xlink:to="loc_us-gaap_LinesOfCreditCurrent_6cf98883-2dc9-488e-8572-deb01da30c3b" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShortTermBorrowings_caab15e3-32bf-4955-9ee2-0922b23f7425" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShortTermBorrowings"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LineOfCreditFacilityLineItems_1ad776d8-69ff-44d3-8ed8-bbcf4799c76c" xlink:to="loc_us-gaap_ShortTermBorrowings_caab15e3-32bf-4955-9ee2-0922b23f7425" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShortTermDebtWeightedAverageInterestRate_12fd0f1e-278e-408b-a449-38f0895e971c" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShortTermDebtWeightedAverageInterestRate"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LineOfCreditFacilityLineItems_1ad776d8-69ff-44d3-8ed8-bbcf4799c76c" xlink:to="loc_us-gaap_ShortTermDebtWeightedAverageInterestRate_12fd0f1e-278e-408b-a449-38f0895e971c" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LineOfCreditFacilityTable_a3c7c56f-4876-4f86-a180-d8e869f38fbd" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LineOfCreditFacilityTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_LineOfCreditFacilityLineItems_1ad776d8-69ff-44d3-8ed8-bbcf4799c76c" xlink:to="loc_us-gaap_LineOfCreditFacilityTable_a3c7c56f-4876-4f86-a180-d8e869f38fbd" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentAxis_8f0490eb-ef80-447f-a1e2-4bbd6685014a" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtInstrumentAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_LineOfCreditFacilityTable_a3c7c56f-4876-4f86-a180-d8e869f38fbd" xlink:to="loc_us-gaap_DebtInstrumentAxis_8f0490eb-ef80-447f-a1e2-4bbd6685014a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentNameDomain_8f0490eb-ef80-447f-a1e2-4bbd6685014a_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtInstrumentNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DebtInstrumentAxis_8f0490eb-ef80-447f-a1e2-4bbd6685014a" xlink:to="loc_us-gaap_DebtInstrumentNameDomain_8f0490eb-ef80-447f-a1e2-4bbd6685014a_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentNameDomain_027dc235-318b-470a-8068-60973872577a" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtInstrumentNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DebtInstrumentAxis_8f0490eb-ef80-447f-a1e2-4bbd6685014a" xlink:to="loc_us-gaap_DebtInstrumentNameDomain_027dc235-318b-470a-8068-60973872577a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LineOfCreditMember_3bdc1a71-c773-4148-a1c4-ad5b63abbea5" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LineOfCreditMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_027dc235-318b-470a-8068-60973872577a" xlink:to="loc_us-gaap_LineOfCreditMember_3bdc1a71-c773-4148-a1c4-ad5b63abbea5" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CreditFacilityAxis_5fb165d2-2afd-445f-9240-a1cf7e186e49" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CreditFacilityAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_LineOfCreditFacilityTable_a3c7c56f-4876-4f86-a180-d8e869f38fbd" xlink:to="loc_us-gaap_CreditFacilityAxis_5fb165d2-2afd-445f-9240-a1cf7e186e49" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CreditFacilityDomain_5fb165d2-2afd-445f-9240-a1cf7e186e49_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CreditFacilityDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_CreditFacilityAxis_5fb165d2-2afd-445f-9240-a1cf7e186e49" xlink:to="loc_us-gaap_CreditFacilityDomain_5fb165d2-2afd-445f-9240-a1cf7e186e49_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CreditFacilityDomain_2646473c-664d-4ad2-b4a2-14ad944c0739" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CreditFacilityDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_CreditFacilityAxis_5fb165d2-2afd-445f-9240-a1cf7e186e49" xlink:to="loc_us-gaap_CreditFacilityDomain_2646473c-664d-4ad2-b4a2-14ad944c0739" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RevolvingCreditFacilityMember_cbef9bee-54e5-4097-98f1-80da816e2bb4" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RevolvingCreditFacilityMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CreditFacilityDomain_2646473c-664d-4ad2-b4a2-14ad944c0739" xlink:to="loc_us-gaap_RevolvingCreditFacilityMember_cbef9bee-54e5-4097-98f1-80da816e2bb4" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongtermDebtTypeAxis_06f1923f-1a7d-4594-b653-63dbf134d5e2" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LongtermDebtTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_LineOfCreditFacilityTable_a3c7c56f-4876-4f86-a180-d8e869f38fbd" xlink:to="loc_us-gaap_LongtermDebtTypeAxis_06f1923f-1a7d-4594-b653-63dbf134d5e2" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongtermDebtTypeDomain_06f1923f-1a7d-4594-b653-63dbf134d5e2_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LongtermDebtTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_LongtermDebtTypeAxis_06f1923f-1a7d-4594-b653-63dbf134d5e2" xlink:to="loc_us-gaap_LongtermDebtTypeDomain_06f1923f-1a7d-4594-b653-63dbf134d5e2_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongtermDebtTypeDomain_aac8b268-b13d-460f-b84a-149b494c12d0" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LongtermDebtTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_LongtermDebtTypeAxis_06f1923f-1a7d-4594-b653-63dbf134d5e2" xlink:to="loc_us-gaap_LongtermDebtTypeDomain_aac8b268-b13d-460f-b84a-149b494c12d0" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LineOfCreditMember_3b7ee604-f6ff-45c4-9caf-b9860e35fc6c" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LineOfCreditMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LongtermDebtTypeDomain_aac8b268-b13d-460f-b84a-149b494c12d0" xlink:to="loc_us-gaap_LineOfCreditMember_3b7ee604-f6ff-45c4-9caf-b9860e35fc6c" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ForeignLineOfCreditMember_019173d7-06dc-46b0-a12c-c2eb2f9fcce0" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ForeignLineOfCreditMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LongtermDebtTypeDomain_aac8b268-b13d-460f-b84a-149b494c12d0" xlink:to="loc_us-gaap_ForeignLineOfCreditMember_019173d7-06dc-46b0-a12c-c2eb2f9fcce0" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShortTermDebtTypeAxis_ddc6403d-b097-4c8a-a38b-bc679d3e8142" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShortTermDebtTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_LineOfCreditFacilityTable_a3c7c56f-4876-4f86-a180-d8e869f38fbd" xlink:to="loc_us-gaap_ShortTermDebtTypeAxis_ddc6403d-b097-4c8a-a38b-bc679d3e8142" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShortTermDebtTypeDomain_ddc6403d-b097-4c8a-a38b-bc679d3e8142_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShortTermDebtTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_ShortTermDebtTypeAxis_ddc6403d-b097-4c8a-a38b-bc679d3e8142" xlink:to="loc_us-gaap_ShortTermDebtTypeDomain_ddc6403d-b097-4c8a-a38b-bc679d3e8142_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShortTermDebtTypeDomain_085c471f-4a41-4771-8312-db402dbfa187" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShortTermDebtTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_ShortTermDebtTypeAxis_ddc6403d-b097-4c8a-a38b-bc679d3e8142" xlink:to="loc_us-gaap_ShortTermDebtTypeDomain_085c471f-4a41-4771-8312-db402dbfa187" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommercialPaperMember_9d76e9d0-4708-41bb-ab2f-1b9aca6bdcd3" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CommercialPaperMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShortTermDebtTypeDomain_085c471f-4a41-4771-8312-db402dbfa187" xlink:to="loc_us-gaap_CommercialPaperMember_9d76e9d0-4708-41bb-ab2f-1b9aca6bdcd3" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/SHORTANDLONGTERMDEBTSCHEDULEOFLONGTERMDEBTINSTRUMENTSDetails" xlink:type="simple" xlink:href="hsy-20220703.xsd#SHORTANDLONGTERMDEBTSCHEDULEOFLONGTERMDEBTINSTRUMENTSDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/SHORTANDLONGTERMDEBTSCHEDULEOFLONGTERMDEBTINSTRUMENTSDetails" xlink:type="extended" id="icbcb9fae957042a09219cfa061b6a732_SHORTANDLONGTERMDEBTSCHEDULEOFLONGTERMDEBTINSTRUMENTSDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentLineItems_c0170c5c-cf04-4559-924b-e48f7d3426b3" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtInstrumentLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinanceLeaseLiability_24939fb6-eb8f-48f9-89cd-dd1aa07dcbfd" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FinanceLeaseLiability"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_c0170c5c-cf04-4559-924b-e48f7d3426b3" xlink:to="loc_us-gaap_FinanceLeaseLiability_24939fb6-eb8f-48f9-89cd-dd1aa07dcbfd" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_DebtInstrumentImpactofDerivativesUnamortizedDiscountPremiumandDebtIssuanceCostsNet_798266d9-85fe-4f7c-94be-56b14e560ffe" xlink:href="hsy-20220703.xsd#hsy_DebtInstrumentImpactofDerivativesUnamortizedDiscountPremiumandDebtIssuanceCostsNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_c0170c5c-cf04-4559-924b-e48f7d3426b3" xlink:to="loc_hsy_DebtInstrumentImpactofDerivativesUnamortizedDiscountPremiumandDebtIssuanceCostsNet_798266d9-85fe-4f7c-94be-56b14e560ffe" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongTermDebt_c34928fa-a3d2-4139-999b-374bc2cc4586" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LongTermDebt"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_c0170c5c-cf04-4559-924b-e48f7d3426b3" xlink:to="loc_us-gaap_LongTermDebt_c34928fa-a3d2-4139-999b-374bc2cc4586" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongTermDebtCurrent_49ae93cb-76ca-464f-b892-6762897ae14d" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LongTermDebtCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_c0170c5c-cf04-4559-924b-e48f7d3426b3" xlink:to="loc_us-gaap_LongTermDebtCurrent_49ae93cb-76ca-464f-b892-6762897ae14d" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongTermDebtNoncurrent_3b594b59-913e-43e1-9a17-d7d746e3fbca" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LongTermDebtNoncurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_c0170c5c-cf04-4559-924b-e48f7d3426b3" xlink:to="loc_us-gaap_LongTermDebtNoncurrent_3b594b59-913e-43e1-9a17-d7d746e3fbca" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentTable_9efd053f-af73-4d7f-9bee-62901763397a" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtInstrumentTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_DebtInstrumentLineItems_c0170c5c-cf04-4559-924b-e48f7d3426b3" xlink:to="loc_us-gaap_DebtInstrumentTable_9efd053f-af73-4d7f-9bee-62901763397a" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongtermDebtTypeAxis_15d7f8e1-d4a8-4e42-9554-c5fd3c034fd4" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LongtermDebtTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DebtInstrumentTable_9efd053f-af73-4d7f-9bee-62901763397a" xlink:to="loc_us-gaap_LongtermDebtTypeAxis_15d7f8e1-d4a8-4e42-9554-c5fd3c034fd4" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongtermDebtTypeDomain_15d7f8e1-d4a8-4e42-9554-c5fd3c034fd4_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LongtermDebtTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_LongtermDebtTypeAxis_15d7f8e1-d4a8-4e42-9554-c5fd3c034fd4" xlink:to="loc_us-gaap_LongtermDebtTypeDomain_15d7f8e1-d4a8-4e42-9554-c5fd3c034fd4_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongtermDebtTypeDomain_8f8c8db7-517f-4eaa-83a1-001bf7d4c41c" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LongtermDebtTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_LongtermDebtTypeAxis_15d7f8e1-d4a8-4e42-9554-c5fd3c034fd4" xlink:to="loc_us-gaap_LongtermDebtTypeDomain_8f8c8db7-517f-4eaa-83a1-001bf7d4c41c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DomesticCorporateDebtSecuritiesMember_e693cec7-8746-4c0b-8a6a-edff10ef9d0f" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DomesticCorporateDebtSecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LongtermDebtTypeDomain_8f8c8db7-517f-4eaa-83a1-001bf7d4c41c" xlink:to="loc_us-gaap_DomesticCorporateDebtSecuritiesMember_e693cec7-8746-4c0b-8a6a-edff10ef9d0f" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentAxis_fdd73b2d-acf1-43db-a512-1421cf2972ff" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtInstrumentAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DebtInstrumentTable_9efd053f-af73-4d7f-9bee-62901763397a" xlink:to="loc_us-gaap_DebtInstrumentAxis_fdd73b2d-acf1-43db-a512-1421cf2972ff" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentNameDomain_fdd73b2d-acf1-43db-a512-1421cf2972ff_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtInstrumentNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DebtInstrumentAxis_fdd73b2d-acf1-43db-a512-1421cf2972ff" xlink:to="loc_us-gaap_DebtInstrumentNameDomain_fdd73b2d-acf1-43db-a512-1421cf2972ff_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentNameDomain_03c86116-01d0-4815-a6c7-fbb44be3a859" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtInstrumentNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DebtInstrumentAxis_fdd73b2d-acf1-43db-a512-1421cf2972ff" xlink:to="loc_us-gaap_DebtInstrumentNameDomain_03c86116-01d0-4815-a6c7-fbb44be3a859" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes2.625Due2023Member_2b980cfe-be48-421d-b57a-dbc52fe528d3" xlink:href="hsy-20220703.xsd#hsy_Notes2.625Due2023Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_03c86116-01d0-4815-a6c7-fbb44be3a859" xlink:to="loc_hsy_Notes2.625Due2023Member_2b980cfe-be48-421d-b57a-dbc52fe528d3" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes3375Due2023Member_a702568c-ded7-4617-9191-c309aaa5a35e" xlink:href="hsy-20220703.xsd#hsy_Notes3375Due2023Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_03c86116-01d0-4815-a6c7-fbb44be3a859" xlink:to="loc_hsy_Notes3375Due2023Member_a702568c-ded7-4617-9191-c309aaa5a35e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes2.050Due2024Member_38595045-2022-4192-be60-ea46e9c7fcac" xlink:href="hsy-20220703.xsd#hsy_Notes2.050Due2024Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_03c86116-01d0-4815-a6c7-fbb44be3a859" xlink:to="loc_hsy_Notes2.050Due2024Member_38595045-2022-4192-be60-ea46e9c7fcac" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes0900NotesDue2025Member_df0ece85-e56b-4939-8bbc-18251329270b" xlink:href="hsy-20220703.xsd#hsy_Notes0900NotesDue2025Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_03c86116-01d0-4815-a6c7-fbb44be3a859" xlink:to="loc_hsy_Notes0900NotesDue2025Member_df0ece85-e56b-4939-8bbc-18251329270b" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes3.20Due2025Member_c0765b89-ae56-41e1-b32a-7f0919dbf078" xlink:href="hsy-20220703.xsd#hsy_Notes3.20Due2025Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_03c86116-01d0-4815-a6c7-fbb44be3a859" xlink:to="loc_hsy_Notes3.20Due2025Member_c0765b89-ae56-41e1-b32a-7f0919dbf078" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes2.30Due2026Member_468aadc8-f5f7-4624-b7b0-0fee029eed7c" xlink:href="hsy-20220703.xsd#hsy_Notes2.30Due2026Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_03c86116-01d0-4815-a6c7-fbb44be3a859" xlink:to="loc_hsy_Notes2.30Due2026Member_468aadc8-f5f7-4624-b7b0-0fee029eed7c" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Debentures7.2Due2027Member_f496224b-6ac5-45da-ac7f-e78a6eb7b37e" xlink:href="hsy-20220703.xsd#hsy_Debentures7.2Due2027Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_03c86116-01d0-4815-a6c7-fbb44be3a859" xlink:to="loc_hsy_Debentures7.2Due2027Member_f496224b-6ac5-45da-ac7f-e78a6eb7b37e" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes2.450Due2029Member_e2a62837-17cc-4cd3-ae6e-f4ca8bca45fc" xlink:href="hsy-20220703.xsd#hsy_Notes2.450Due2029Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_03c86116-01d0-4815-a6c7-fbb44be3a859" xlink:to="loc_hsy_Notes2.450Due2029Member_e2a62837-17cc-4cd3-ae6e-f4ca8bca45fc" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes1700Due2030Member_6a0759f9-0a16-4028-b8df-bea7b0a55f58" xlink:href="hsy-20220703.xsd#hsy_Notes1700Due2030Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_03c86116-01d0-4815-a6c7-fbb44be3a859" xlink:to="loc_hsy_Notes1700Due2030Member_6a0759f9-0a16-4028-b8df-bea7b0a55f58" xlink:type="arc" order="8"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes3.375Due2046Member_f06cf392-4a91-4c73-9d59-07c76014e1b7" xlink:href="hsy-20220703.xsd#hsy_Notes3.375Due2046Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_03c86116-01d0-4815-a6c7-fbb44be3a859" xlink:to="loc_hsy_Notes3.375Due2046Member_f06cf392-4a91-4c73-9d59-07c76014e1b7" xlink:type="arc" order="9"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes3.125Due2049Member_c5f7bf75-b8ba-4587-bb6c-0887f0db54aa" xlink:href="hsy-20220703.xsd#hsy_Notes3.125Due2049Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_03c86116-01d0-4815-a6c7-fbb44be3a859" xlink:to="loc_hsy_Notes3.125Due2049Member_c5f7bf75-b8ba-4587-bb6c-0887f0db54aa" xlink:type="arc" order="10"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes2650NotesDue2050Member_91b0e6e8-0000-46ba-a54b-9d769f4b4f16" xlink:href="hsy-20220703.xsd#hsy_Notes2650NotesDue2050Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_03c86116-01d0-4815-a6c7-fbb44be3a859" xlink:to="loc_hsy_Notes2650NotesDue2050Member_91b0e6e8-0000-46ba-a54b-9d769f4b4f16" xlink:type="arc" order="11"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/SHORTANDLONGTERMDEBTLONGTERMDEBTINTERESTRATESDetails" xlink:type="simple" xlink:href="hsy-20220703.xsd#SHORTANDLONGTERMDEBTLONGTERMDEBTINTERESTRATESDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/SHORTANDLONGTERMDEBTLONGTERMDEBTINTERESTRATESDetails" xlink:type="extended" id="i833824984d9642a6899bf2b4a5e6473f_SHORTANDLONGTERMDEBTLONGTERMDEBTINTERESTRATESDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentLineItems_bc1f1d98-b294-4300-8f95-ba6a11e87089" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtInstrumentLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentInterestRateStatedPercentage_a3e21132-2bc9-4c9f-8bcb-d895c7ab3213" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtInstrumentInterestRateStatedPercentage"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_bc1f1d98-b294-4300-8f95-ba6a11e87089" xlink:to="loc_us-gaap_DebtInstrumentInterestRateStatedPercentage_a3e21132-2bc9-4c9f-8bcb-d895c7ab3213" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentTable_368dd06e-6e11-49bb-9e20-928cff6569e1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtInstrumentTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_DebtInstrumentLineItems_bc1f1d98-b294-4300-8f95-ba6a11e87089" xlink:to="loc_us-gaap_DebtInstrumentTable_368dd06e-6e11-49bb-9e20-928cff6569e1" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongtermDebtTypeAxis_82b9e2ed-aabd-47d7-ba94-8a1ac19f57cc" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LongtermDebtTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DebtInstrumentTable_368dd06e-6e11-49bb-9e20-928cff6569e1" xlink:to="loc_us-gaap_LongtermDebtTypeAxis_82b9e2ed-aabd-47d7-ba94-8a1ac19f57cc" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongtermDebtTypeDomain_82b9e2ed-aabd-47d7-ba94-8a1ac19f57cc_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LongtermDebtTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_LongtermDebtTypeAxis_82b9e2ed-aabd-47d7-ba94-8a1ac19f57cc" xlink:to="loc_us-gaap_LongtermDebtTypeDomain_82b9e2ed-aabd-47d7-ba94-8a1ac19f57cc_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongtermDebtTypeDomain_f1fb8109-fc24-46d9-8a53-368d675caee3" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LongtermDebtTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_LongtermDebtTypeAxis_82b9e2ed-aabd-47d7-ba94-8a1ac19f57cc" xlink:to="loc_us-gaap_LongtermDebtTypeDomain_f1fb8109-fc24-46d9-8a53-368d675caee3" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DomesticCorporateDebtSecuritiesMember_665bf1e9-64ff-4193-b704-46fb0000514d" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DomesticCorporateDebtSecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LongtermDebtTypeDomain_f1fb8109-fc24-46d9-8a53-368d675caee3" xlink:to="loc_us-gaap_DomesticCorporateDebtSecuritiesMember_665bf1e9-64ff-4193-b704-46fb0000514d" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentAxis_3f6fd49b-0a62-4891-9ab2-2caeb4331b81" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtInstrumentAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DebtInstrumentTable_368dd06e-6e11-49bb-9e20-928cff6569e1" xlink:to="loc_us-gaap_DebtInstrumentAxis_3f6fd49b-0a62-4891-9ab2-2caeb4331b81" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentNameDomain_3f6fd49b-0a62-4891-9ab2-2caeb4331b81_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtInstrumentNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DebtInstrumentAxis_3f6fd49b-0a62-4891-9ab2-2caeb4331b81" xlink:to="loc_us-gaap_DebtInstrumentNameDomain_3f6fd49b-0a62-4891-9ab2-2caeb4331b81_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentNameDomain_ae005200-2e07-422e-ae0a-9ddbda5ceb4c" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtInstrumentNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DebtInstrumentAxis_3f6fd49b-0a62-4891-9ab2-2caeb4331b81" xlink:to="loc_us-gaap_DebtInstrumentNameDomain_ae005200-2e07-422e-ae0a-9ddbda5ceb4c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes2.625Due2023Member_bd6c660e-9197-47b8-bcaa-fff9f77abf04" xlink:href="hsy-20220703.xsd#hsy_Notes2.625Due2023Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_ae005200-2e07-422e-ae0a-9ddbda5ceb4c" xlink:to="loc_hsy_Notes2.625Due2023Member_bd6c660e-9197-47b8-bcaa-fff9f77abf04" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes3375Due2023Member_f9bfdd04-a4fa-405f-ac67-4b27fbb08d37" xlink:href="hsy-20220703.xsd#hsy_Notes3375Due2023Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_ae005200-2e07-422e-ae0a-9ddbda5ceb4c" xlink:to="loc_hsy_Notes3375Due2023Member_f9bfdd04-a4fa-405f-ac67-4b27fbb08d37" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes2.050Due2024Member_66414992-8a5c-4128-93c8-ab99b55a61dc" xlink:href="hsy-20220703.xsd#hsy_Notes2.050Due2024Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_ae005200-2e07-422e-ae0a-9ddbda5ceb4c" xlink:to="loc_hsy_Notes2.050Due2024Member_66414992-8a5c-4128-93c8-ab99b55a61dc" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes0900NotesDue2025Member_12dc5968-907f-478b-813b-2a3a907e15c7" xlink:href="hsy-20220703.xsd#hsy_Notes0900NotesDue2025Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_ae005200-2e07-422e-ae0a-9ddbda5ceb4c" xlink:to="loc_hsy_Notes0900NotesDue2025Member_12dc5968-907f-478b-813b-2a3a907e15c7" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes3.20Due2025Member_fe1507d8-ec8b-4a49-8f22-658ae99dc7a7" xlink:href="hsy-20220703.xsd#hsy_Notes3.20Due2025Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_ae005200-2e07-422e-ae0a-9ddbda5ceb4c" xlink:to="loc_hsy_Notes3.20Due2025Member_fe1507d8-ec8b-4a49-8f22-658ae99dc7a7" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes2.30Due2026Member_2a8f6bbd-3abe-4aee-bbda-548c4eed85a9" xlink:href="hsy-20220703.xsd#hsy_Notes2.30Due2026Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_ae005200-2e07-422e-ae0a-9ddbda5ceb4c" xlink:to="loc_hsy_Notes2.30Due2026Member_2a8f6bbd-3abe-4aee-bbda-548c4eed85a9" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Debentures7.2Due2027Member_60c61977-3cb1-458f-96c0-4fa51d0b49b5" xlink:href="hsy-20220703.xsd#hsy_Debentures7.2Due2027Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_ae005200-2e07-422e-ae0a-9ddbda5ceb4c" xlink:to="loc_hsy_Debentures7.2Due2027Member_60c61977-3cb1-458f-96c0-4fa51d0b49b5" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes2.450Due2029Member_3780a48f-fb16-4c4a-bc2c-521cc51f8c1b" xlink:href="hsy-20220703.xsd#hsy_Notes2.450Due2029Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_ae005200-2e07-422e-ae0a-9ddbda5ceb4c" xlink:to="loc_hsy_Notes2.450Due2029Member_3780a48f-fb16-4c4a-bc2c-521cc51f8c1b" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes1700Due2030Member_3f3de609-172d-4806-b9d3-3d803ed1065c" xlink:href="hsy-20220703.xsd#hsy_Notes1700Due2030Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_ae005200-2e07-422e-ae0a-9ddbda5ceb4c" xlink:to="loc_hsy_Notes1700Due2030Member_3f3de609-172d-4806-b9d3-3d803ed1065c" xlink:type="arc" order="8"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes3.375Due2046Member_ce47fa3b-0b06-4999-80a8-e3736c31640f" xlink:href="hsy-20220703.xsd#hsy_Notes3.375Due2046Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_ae005200-2e07-422e-ae0a-9ddbda5ceb4c" xlink:to="loc_hsy_Notes3.375Due2046Member_ce47fa3b-0b06-4999-80a8-e3736c31640f" xlink:type="arc" order="9"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes3.125Due2049Member_b61f4875-41f9-4ec5-8a97-aac9148320a4" xlink:href="hsy-20220703.xsd#hsy_Notes3.125Due2049Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_ae005200-2e07-422e-ae0a-9ddbda5ceb4c" xlink:to="loc_hsy_Notes3.125Due2049Member_b61f4875-41f9-4ec5-8a97-aac9148320a4" xlink:type="arc" order="10"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_Notes2650NotesDue2050Member_bd64dd89-da31-4302-b3f7-c9a89578929a" xlink:href="hsy-20220703.xsd#hsy_Notes2650NotesDue2050Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_ae005200-2e07-422e-ae0a-9ddbda5ceb4c" xlink:to="loc_hsy_Notes2650NotesDue2050Member_bd64dd89-da31-4302-b3f7-c9a89578929a" xlink:type="arc" order="11"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/DERIVATIVEINSTRUMENTSNARRATIVEDetails" xlink:type="simple" xlink:href="hsy-20220703.xsd#DERIVATIVEINSTRUMENTSNARRATIVEDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/DERIVATIVEINSTRUMENTSNARRATIVEDetails" xlink:type="extended" id="i168220caf2fe4353bb26838fc9df1108_DERIVATIVEINSTRUMENTSNARRATIVEDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeLineItems_57f7ad7b-9337-4f6d-b0e1-6112ded096f3" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeTermOfContract_fd112b7e-3229-4526-a3ea-622bfd0ad3ab" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeTermOfContract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeLineItems_57f7ad7b-9337-4f6d-b0e1-6112ded096f3" xlink:to="loc_us-gaap_DerivativeTermOfContract_fd112b7e-3229-4526-a3ea-622bfd0ad3ab" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeNotionalAmount_0dd1ebb0-2f84-4a86-87de-ad9c5f4ae30a" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeNotionalAmount"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeLineItems_57f7ad7b-9337-4f6d-b0e1-6112ded096f3" xlink:to="loc_us-gaap_DerivativeNotionalAmount_0dd1ebb0-2f84-4a86-87de-ad9c5f4ae30a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_MinimumLengthofTimeHedgedinCashFlowHedge_1d55ed09-73fd-44f2-9e7a-487d61b316c6" xlink:href="hsy-20220703.xsd#hsy_MinimumLengthofTimeHedgedinCashFlowHedge"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeLineItems_57f7ad7b-9337-4f6d-b0e1-6112ded096f3" xlink:to="loc_hsy_MinimumLengthofTimeHedgedinCashFlowHedge_1d55ed09-73fd-44f2-9e7a-487d61b316c6" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_MaximumLengthOfTimeHedgedInCashFlowHedge1_6ab92971-26b4-4d92-8ce9-4f14cbac654d" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_MaximumLengthOfTimeHedgedInCashFlowHedge1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeLineItems_57f7ad7b-9337-4f6d-b0e1-6112ded096f3" xlink:to="loc_us-gaap_MaximumLengthOfTimeHedgedInCashFlowHedge1_6ab92971-26b4-4d92-8ce9-4f14cbac654d" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashFlowHedgeGainLossToBeReclassifiedWithinTwelveMonths_2477ef48-154c-421d-bef5-1acc655f61a1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CashFlowHedgeGainLossToBeReclassifiedWithinTwelveMonths"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeLineItems_57f7ad7b-9337-4f6d-b0e1-6112ded096f3" xlink:to="loc_us-gaap_CashFlowHedgeGainLossToBeReclassifiedWithinTwelveMonths_2477ef48-154c-421d-bef5-1acc655f61a1" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeTable_7e92f96a-0756-47b7-b60d-34ca2e0d3166" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_DerivativeLineItems_57f7ad7b-9337-4f6d-b0e1-6112ded096f3" xlink:to="loc_us-gaap_DerivativeTable_7e92f96a-0756-47b7-b60d-34ca2e0d3166" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeInstrumentRiskAxis_febe97d1-2677-4a05-9cc0-4b8f41506112" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeInstrumentRiskAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DerivativeTable_7e92f96a-0756-47b7-b60d-34ca2e0d3166" xlink:to="loc_us-gaap_DerivativeInstrumentRiskAxis_febe97d1-2677-4a05-9cc0-4b8f41506112" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_febe97d1-2677-4a05-9cc0-4b8f41506112_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeContractTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_febe97d1-2677-4a05-9cc0-4b8f41506112" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_febe97d1-2677-4a05-9cc0-4b8f41506112_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_1805eb55-703e-4cc7-b022-84d9bf67f818" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeContractTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_febe97d1-2677-4a05-9cc0-4b8f41506112" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_1805eb55-703e-4cc7-b022-84d9bf67f818" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommodityContractMember_bf637938-94e2-45f3-9278-5816936f5f58" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CommodityContractMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_1805eb55-703e-4cc7-b022-84d9bf67f818" xlink:to="loc_us-gaap_CommodityContractMember_bf637938-94e2-45f3-9278-5816936f5f58" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ForeignExchangeContractMember_888446c2-bf8c-4a25-ad06-e0cf27469558" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ForeignExchangeContractMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_1805eb55-703e-4cc7-b022-84d9bf67f818" xlink:to="loc_us-gaap_ForeignExchangeContractMember_888446c2-bf8c-4a25-ad06-e0cf27469558" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquitySwapMember_9789c8ce-4f8c-4afb-ac50-13d65dd72c83" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EquitySwapMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_1805eb55-703e-4cc7-b022-84d9bf67f818" xlink:to="loc_us-gaap_EquitySwapMember_9789c8ce-4f8c-4afb-ac50-13d65dd72c83" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationAxis_0671f39b-e5c5-449f-8cd3-5fd9c51c0c18" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_HedgingDesignationAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DerivativeTable_7e92f96a-0756-47b7-b60d-34ca2e0d3166" xlink:to="loc_us-gaap_HedgingDesignationAxis_0671f39b-e5c5-449f-8cd3-5fd9c51c0c18" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationDomain_0671f39b-e5c5-449f-8cd3-5fd9c51c0c18_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_HedgingDesignationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_HedgingDesignationAxis_0671f39b-e5c5-449f-8cd3-5fd9c51c0c18" xlink:to="loc_us-gaap_HedgingDesignationDomain_0671f39b-e5c5-449f-8cd3-5fd9c51c0c18_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationDomain_ebd46d30-6e0e-4ee3-ad48-5603efd4a1e1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_HedgingDesignationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_HedgingDesignationAxis_0671f39b-e5c5-449f-8cd3-5fd9c51c0c18" xlink:to="loc_us-gaap_HedgingDesignationDomain_ebd46d30-6e0e-4ee3-ad48-5603efd4a1e1" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DesignatedAsHedgingInstrumentMember_c25dcd66-fa9b-4ef4-828f-740d0d5bdcc4" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DesignatedAsHedgingInstrumentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_HedgingDesignationDomain_ebd46d30-6e0e-4ee3-ad48-5603efd4a1e1" xlink:to="loc_us-gaap_DesignatedAsHedgingInstrumentMember_c25dcd66-fa9b-4ef4-828f-740d0d5bdcc4" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NondesignatedMember_f86bea34-379c-41f8-8c46-e04b917b87a9" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NondesignatedMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_HedgingDesignationDomain_ebd46d30-6e0e-4ee3-ad48-5603efd4a1e1" xlink:to="loc_us-gaap_NondesignatedMember_f86bea34-379c-41f8-8c46-e04b917b87a9" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_9db01fe4-d95a-46e6-9572-9271f6beefd9" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DerivativeTable_7e92f96a-0756-47b7-b60d-34ca2e0d3166" xlink:to="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_9db01fe4-d95a-46e6-9572-9271f6beefd9" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingRelationshipDomain_9db01fe4-d95a-46e6-9572-9271f6beefd9_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_HedgingRelationshipDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_9db01fe4-d95a-46e6-9572-9271f6beefd9" xlink:to="loc_us-gaap_HedgingRelationshipDomain_9db01fe4-d95a-46e6-9572-9271f6beefd9_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingRelationshipDomain_efdeae01-274e-41cc-add6-f85e858e1d66" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_HedgingRelationshipDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_9db01fe4-d95a-46e6-9572-9271f6beefd9" xlink:to="loc_us-gaap_HedgingRelationshipDomain_efdeae01-274e-41cc-add6-f85e858e1d66" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashFlowHedgingMember_42a9c2ea-9262-48c9-bd50-4a9b6de90f5f" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CashFlowHedgingMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_HedgingRelationshipDomain_efdeae01-274e-41cc-add6-f85e858e1d66" xlink:to="loc_us-gaap_CashFlowHedgingMember_42a9c2ea-9262-48c9-bd50-4a9b6de90f5f" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeAxis_4f883ef3-d2b3-43fb-b0cd-d9509d335d6e" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_RangeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DerivativeTable_7e92f96a-0756-47b7-b60d-34ca2e0d3166" xlink:to="loc_srt_RangeAxis_4f883ef3-d2b3-43fb-b0cd-d9509d335d6e" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_4f883ef3-d2b3-43fb-b0cd-d9509d335d6e_default" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_RangeAxis_4f883ef3-d2b3-43fb-b0cd-d9509d335d6e" xlink:to="loc_srt_RangeMember_4f883ef3-d2b3-43fb-b0cd-d9509d335d6e_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_c6940682-8e11-4f88-8729-9ec314ccbf30" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_RangeAxis_4f883ef3-d2b3-43fb-b0cd-d9509d335d6e" xlink:to="loc_srt_RangeMember_c6940682-8e11-4f88-8729-9ec314ccbf30" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MinimumMember_36dcadfa-8fb0-4e0b-a081-e6964ddd5298" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_MinimumMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_c6940682-8e11-4f88-8729-9ec314ccbf30" xlink:to="loc_srt_MinimumMember_36dcadfa-8fb0-4e0b-a081-e6964ddd5298" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MaximumMember_7853782a-43d8-4713-8915-7abe132e65ae" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_MaximumMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_c6940682-8e11-4f88-8729-9ec314ccbf30" xlink:to="loc_srt_MaximumMember_7853782a-43d8-4713-8915-7abe132e65ae" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeStatementLocationAxis_fd454f5b-0443-4c31-9ae7-e8b60372c1ff" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncomeStatementLocationAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DerivativeTable_7e92f96a-0756-47b7-b60d-34ca2e0d3166" xlink:to="loc_us-gaap_IncomeStatementLocationAxis_fd454f5b-0443-4c31-9ae7-e8b60372c1ff" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeStatementLocationDomain_fd454f5b-0443-4c31-9ae7-e8b60372c1ff_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncomeStatementLocationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_IncomeStatementLocationAxis_fd454f5b-0443-4c31-9ae7-e8b60372c1ff" xlink:to="loc_us-gaap_IncomeStatementLocationDomain_fd454f5b-0443-4c31-9ae7-e8b60372c1ff_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeStatementLocationDomain_0d4ebc9c-ac38-47c4-9718-4ff5e5bcde4f" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncomeStatementLocationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_IncomeStatementLocationAxis_fd454f5b-0443-4c31-9ae7-e8b60372c1ff" xlink:to="loc_us-gaap_IncomeStatementLocationDomain_0d4ebc9c-ac38-47c4-9718-4ff5e5bcde4f" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/DERIVATIVEINSTRUMENTSSCHEDULEOFTHECLASSIFICATIONOFDERIVATIVEASSETSANDLIABILITIESWITHINTHECONSOLIDATEDBALANCESHEETSDetails" xlink:type="simple" xlink:href="hsy-20220703.xsd#DERIVATIVEINSTRUMENTSSCHEDULEOFTHECLASSIFICATIONOFDERIVATIVEASSETSANDLIABILITIESWITHINTHECONSOLIDATEDBALANCESHEETSDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/DERIVATIVEINSTRUMENTSSCHEDULEOFTHECLASSIFICATIONOFDERIVATIVEASSETSANDLIABILITIESWITHINTHECONSOLIDATEDBALANCESHEETSDetails" xlink:type="extended" id="i0d22d0073f6448149ac21f6b45244ee1_DERIVATIVEINSTRUMENTSSCHEDULEOFTHECLASSIFICATIONOFDERIVATIVEASSETSANDLIABILITIESWITHINTHECONSOLIDATEDBALANCESHEETSDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativesFairValueLineItems_e3d7c9ee-b76e-4874-b8f3-1e3ac8cc82ea" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativesFairValueLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeAssets_aedca803-63ba-4bee-ae3d-88e360e3a1e7" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_e3d7c9ee-b76e-4874-b8f3-1e3ac8cc82ea" xlink:to="loc_us-gaap_DerivativeAssets_aedca803-63ba-4bee-ae3d-88e360e3a1e7" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeLiabilities_f3e4beac-b2f3-4e05-baeb-d4b1effa0e6a" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeLiabilities"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_e3d7c9ee-b76e-4874-b8f3-1e3ac8cc82ea" xlink:to="loc_us-gaap_DerivativeLiabilities_f3e4beac-b2f3-4e05-baeb-d4b1effa0e6a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_DerivativeAssetCashTransfersReceivablePayableChangeInQuotedMarketPricesOnTheLastDayOfTrading_83cd7839-ad8a-4e06-b9b2-dde90375ba4e" xlink:href="hsy-20220703.xsd#hsy_DerivativeAssetCashTransfersReceivablePayableChangeInQuotedMarketPricesOnTheLastDayOfTrading"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_e3d7c9ee-b76e-4874-b8f3-1e3ac8cc82ea" xlink:to="loc_hsy_DerivativeAssetCashTransfersReceivablePayableChangeInQuotedMarketPricesOnTheLastDayOfTrading_83cd7839-ad8a-4e06-b9b2-dde90375ba4e" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_DerivativeLiabilityCashTransfersReceivablePayableChangeInQuotedMarketPricesOnTheLastDayOfTrading_8e088c75-c076-413f-8752-5b64284ab83c" xlink:href="hsy-20220703.xsd#hsy_DerivativeLiabilityCashTransfersReceivablePayableChangeInQuotedMarketPricesOnTheLastDayOfTrading"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_e3d7c9ee-b76e-4874-b8f3-1e3ac8cc82ea" xlink:to="loc_hsy_DerivativeLiabilityCashTransfersReceivablePayableChangeInQuotedMarketPricesOnTheLastDayOfTrading_8e088c75-c076-413f-8752-5b64284ab83c" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable_e6241b61-a1c5-418f-aea7-032df9fe6203" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_e3d7c9ee-b76e-4874-b8f3-1e3ac8cc82ea" xlink:to="loc_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable_e6241b61-a1c5-418f-aea7-032df9fe6203" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationAxis_7b0ec9ea-3eca-4a25-ae93-38fa3debabbc" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_HedgingDesignationAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable_e6241b61-a1c5-418f-aea7-032df9fe6203" xlink:to="loc_us-gaap_HedgingDesignationAxis_7b0ec9ea-3eca-4a25-ae93-38fa3debabbc" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationDomain_7b0ec9ea-3eca-4a25-ae93-38fa3debabbc_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_HedgingDesignationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_HedgingDesignationAxis_7b0ec9ea-3eca-4a25-ae93-38fa3debabbc" xlink:to="loc_us-gaap_HedgingDesignationDomain_7b0ec9ea-3eca-4a25-ae93-38fa3debabbc_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationDomain_56dad5b5-aaee-4047-b9af-a8a76b284983" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_HedgingDesignationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_HedgingDesignationAxis_7b0ec9ea-3eca-4a25-ae93-38fa3debabbc" xlink:to="loc_us-gaap_HedgingDesignationDomain_56dad5b5-aaee-4047-b9af-a8a76b284983" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DesignatedAsHedgingInstrumentMember_7bdc7db4-abc5-42e9-bc25-1beedcd914a5" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DesignatedAsHedgingInstrumentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_HedgingDesignationDomain_56dad5b5-aaee-4047-b9af-a8a76b284983" xlink:to="loc_us-gaap_DesignatedAsHedgingInstrumentMember_7bdc7db4-abc5-42e9-bc25-1beedcd914a5" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NondesignatedMember_8b44864a-ebff-4bfd-9303-204a8868d4b7" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NondesignatedMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_HedgingDesignationDomain_56dad5b5-aaee-4047-b9af-a8a76b284983" xlink:to="loc_us-gaap_NondesignatedMember_8b44864a-ebff-4bfd-9303-204a8868d4b7" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_5db46a51-70fc-41f0-be5c-0fd4fce62529" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable_e6241b61-a1c5-418f-aea7-032df9fe6203" xlink:to="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_5db46a51-70fc-41f0-be5c-0fd4fce62529" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingRelationshipDomain_5db46a51-70fc-41f0-be5c-0fd4fce62529_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_HedgingRelationshipDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_5db46a51-70fc-41f0-be5c-0fd4fce62529" xlink:to="loc_us-gaap_HedgingRelationshipDomain_5db46a51-70fc-41f0-be5c-0fd4fce62529_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingRelationshipDomain_64e97b83-b7dd-4802-90d1-5cbfdd7e9a94" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_HedgingRelationshipDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_5db46a51-70fc-41f0-be5c-0fd4fce62529" xlink:to="loc_us-gaap_HedgingRelationshipDomain_64e97b83-b7dd-4802-90d1-5cbfdd7e9a94" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashFlowHedgingMember_d6f24694-6035-43e7-aec9-a42cbf667baf" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CashFlowHedgingMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_HedgingRelationshipDomain_64e97b83-b7dd-4802-90d1-5cbfdd7e9a94" xlink:to="loc_us-gaap_CashFlowHedgingMember_d6f24694-6035-43e7-aec9-a42cbf667baf" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeInstrumentRiskAxis_b8b129b9-3ce9-4a3d-a9f2-65e4fa1bc5af" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeInstrumentRiskAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable_e6241b61-a1c5-418f-aea7-032df9fe6203" xlink:to="loc_us-gaap_DerivativeInstrumentRiskAxis_b8b129b9-3ce9-4a3d-a9f2-65e4fa1bc5af" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_b8b129b9-3ce9-4a3d-a9f2-65e4fa1bc5af_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeContractTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_b8b129b9-3ce9-4a3d-a9f2-65e4fa1bc5af" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_b8b129b9-3ce9-4a3d-a9f2-65e4fa1bc5af_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_e7973941-cc5a-45f2-9d87-3cf4f674bc8d" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeContractTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_b8b129b9-3ce9-4a3d-a9f2-65e4fa1bc5af" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_e7973941-cc5a-45f2-9d87-3cf4f674bc8d" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ForeignExchangeContractMember_f9264d91-d30c-4e6a-8813-993b1026b860" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ForeignExchangeContractMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_e7973941-cc5a-45f2-9d87-3cf4f674bc8d" xlink:to="loc_us-gaap_ForeignExchangeContractMember_f9264d91-d30c-4e6a-8813-993b1026b860" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommodityContractMember_26a5080e-7de3-47d6-876a-cdd8e8157704" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CommodityContractMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_e7973941-cc5a-45f2-9d87-3cf4f674bc8d" xlink:to="loc_us-gaap_CommodityContractMember_26a5080e-7de3-47d6-876a-cdd8e8157704" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquitySwapMember_5cfdaddf-3a90-4257-982a-2c6eb5398156" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EquitySwapMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_e7973941-cc5a-45f2-9d87-3cf4f674bc8d" xlink:to="loc_us-gaap_EquitySwapMember_5cfdaddf-3a90-4257-982a-2c6eb5398156" xlink:type="arc" order="2"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/DERIVATIVEINSTRUMENTSSCHEDULEOFTHEEFFECTOFDERIVATIVEINSTRUMENTSONTHECONSOLIDATEDSTATEMENTSOFINCOMEDetails" xlink:type="simple" xlink:href="hsy-20220703.xsd#DERIVATIVEINSTRUMENTSSCHEDULEOFTHEEFFECTOFDERIVATIVEINSTRUMENTSONTHECONSOLIDATEDSTATEMENTSOFINCOMEDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/DERIVATIVEINSTRUMENTSSCHEDULEOFTHEEFFECTOFDERIVATIVEINSTRUMENTSONTHECONSOLIDATEDSTATEMENTSOFINCOMEDetails" xlink:type="extended" id="i1326dbf650f24c1894f51cc7b3383246_DERIVATIVEINSTRUMENTSSCHEDULEOFTHEEFFECTOFDERIVATIVEINSTRUMENTSONTHECONSOLIDATEDSTATEMENTSOFINCOMEDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeLineItems_9cc51a26-0195-463f-bb67-d6956d518943" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeInstrumentsNotDesignatedAsHedgingInstrumentsGainLossNet_ffa5fe1e-0ed7-4f01-8b43-290c9622bc76" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeInstrumentsNotDesignatedAsHedgingInstrumentsGainLossNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeLineItems_9cc51a26-0195-463f-bb67-d6956d518943" xlink:to="loc_us-gaap_DerivativeInstrumentsNotDesignatedAsHedgingInstrumentsGainLossNet_ffa5fe1e-0ed7-4f01-8b43-290c9622bc76" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossCashFlowHedgeGainLossBeforeReclassificationAndTax_6194124e-3c50-40ae-a33c-52970f1e67f1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherComprehensiveIncomeLossCashFlowHedgeGainLossBeforeReclassificationAndTax"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeLineItems_9cc51a26-0195-463f-bb67-d6956d518943" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossCashFlowHedgeGainLossBeforeReclassificationAndTax_6194124e-3c50-40ae-a33c-52970f1e67f1" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ReclassificationFromAccumulatedOtherComprehensiveIncomeCurrentPeriodBeforeTax_f42ce830-3ec3-4bc5-b27b-9810fcac995c" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ReclassificationFromAccumulatedOtherComprehensiveIncomeCurrentPeriodBeforeTax"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeLineItems_9cc51a26-0195-463f-bb67-d6956d518943" xlink:to="loc_us-gaap_ReclassificationFromAccumulatedOtherComprehensiveIncomeCurrentPeriodBeforeTax_f42ce830-3ec3-4bc5-b27b-9810fcac995c" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeTable_69e8d9a7-745e-4ffc-b356-a9c4157c1770" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_DerivativeLineItems_9cc51a26-0195-463f-bb67-d6956d518943" xlink:to="loc_us-gaap_DerivativeTable_69e8d9a7-745e-4ffc-b356-a9c4157c1770" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationAxis_def9ada6-2f93-4f0b-8ccc-e345f27db70a" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_HedgingDesignationAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DerivativeTable_69e8d9a7-745e-4ffc-b356-a9c4157c1770" xlink:to="loc_us-gaap_HedgingDesignationAxis_def9ada6-2f93-4f0b-8ccc-e345f27db70a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationDomain_def9ada6-2f93-4f0b-8ccc-e345f27db70a_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_HedgingDesignationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_HedgingDesignationAxis_def9ada6-2f93-4f0b-8ccc-e345f27db70a" xlink:to="loc_us-gaap_HedgingDesignationDomain_def9ada6-2f93-4f0b-8ccc-e345f27db70a_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationDomain_ea314dce-afc3-4d93-9c2f-b201e073457a" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_HedgingDesignationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_HedgingDesignationAxis_def9ada6-2f93-4f0b-8ccc-e345f27db70a" xlink:to="loc_us-gaap_HedgingDesignationDomain_ea314dce-afc3-4d93-9c2f-b201e073457a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DesignatedAsHedgingInstrumentMember_f71966e2-ef6b-4d07-b1b7-4628cac39dc3" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DesignatedAsHedgingInstrumentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_HedgingDesignationDomain_ea314dce-afc3-4d93-9c2f-b201e073457a" xlink:to="loc_us-gaap_DesignatedAsHedgingInstrumentMember_f71966e2-ef6b-4d07-b1b7-4628cac39dc3" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_33a62138-417f-451c-a487-85da2e647f6d" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DerivativeTable_69e8d9a7-745e-4ffc-b356-a9c4157c1770" xlink:to="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_33a62138-417f-451c-a487-85da2e647f6d" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingRelationshipDomain_33a62138-417f-451c-a487-85da2e647f6d_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_HedgingRelationshipDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_33a62138-417f-451c-a487-85da2e647f6d" xlink:to="loc_us-gaap_HedgingRelationshipDomain_33a62138-417f-451c-a487-85da2e647f6d_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingRelationshipDomain_f822342c-3762-47ba-9734-48b8ec52e244" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_HedgingRelationshipDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_33a62138-417f-451c-a487-85da2e647f6d" xlink:to="loc_us-gaap_HedgingRelationshipDomain_f822342c-3762-47ba-9734-48b8ec52e244" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashFlowHedgingMember_2141891c-d0d4-4353-918a-8d99ddcc1281" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CashFlowHedgingMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_HedgingRelationshipDomain_f822342c-3762-47ba-9734-48b8ec52e244" xlink:to="loc_us-gaap_CashFlowHedgingMember_2141891c-d0d4-4353-918a-8d99ddcc1281" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeInstrumentRiskAxis_401a7d4a-4b8e-456f-b608-6e65dafe0237" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeInstrumentRiskAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DerivativeTable_69e8d9a7-745e-4ffc-b356-a9c4157c1770" xlink:to="loc_us-gaap_DerivativeInstrumentRiskAxis_401a7d4a-4b8e-456f-b608-6e65dafe0237" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_401a7d4a-4b8e-456f-b608-6e65dafe0237_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeContractTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_401a7d4a-4b8e-456f-b608-6e65dafe0237" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_401a7d4a-4b8e-456f-b608-6e65dafe0237_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_88b348f9-9046-4723-b1f6-3b8f210e7eb3" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeContractTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_401a7d4a-4b8e-456f-b608-6e65dafe0237" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_88b348f9-9046-4723-b1f6-3b8f210e7eb3" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommodityContractMember_6a96b068-f37d-417f-b4ad-9c64a5599335" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CommodityContractMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_88b348f9-9046-4723-b1f6-3b8f210e7eb3" xlink:to="loc_us-gaap_CommodityContractMember_6a96b068-f37d-417f-b4ad-9c64a5599335" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ForeignExchangeContractMember_2202e5d2-8347-470d-b5c1-6e2f4bb29f21" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ForeignExchangeContractMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_88b348f9-9046-4723-b1f6-3b8f210e7eb3" xlink:to="loc_us-gaap_ForeignExchangeContractMember_2202e5d2-8347-470d-b5c1-6e2f4bb29f21" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InterestRateContractMember_2ed81a87-6c93-4a5e-ae84-d3ecd18106c8" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_InterestRateContractMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_88b348f9-9046-4723-b1f6-3b8f210e7eb3" xlink:to="loc_us-gaap_InterestRateContractMember_2ed81a87-6c93-4a5e-ae84-d3ecd18106c8" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquitySwapMember_d4111c59-5a1e-4763-a104-d4641fb46517" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EquitySwapMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_88b348f9-9046-4723-b1f6-3b8f210e7eb3" xlink:to="loc_us-gaap_EquitySwapMember_d4111c59-5a1e-4763-a104-d4641fb46517" xlink:type="arc" order="3"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/FAIRVALUEMEASUREMENTSNARRATIVEDetails" xlink:type="simple" xlink:href="hsy-20220703.xsd#FAIRVALUEMEASUREMENTSNARRATIVEDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/FAIRVALUEMEASUREMENTSNARRATIVEDetails" xlink:type="extended" id="i782aed4574a14212a8fc94357906fe83_FAIRVALUEMEASUREMENTSNARRATIVEDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueBalanceSheetGroupingFinancialStatementCaptionsLineItems_f4063202-8a01-4474-98c9-a11a6cc1ad3b" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FairValueBalanceSheetGroupingFinancialStatementCaptionsLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueNetAssetLiability_3b28d2dc-5bfd-4f43-9520-ac87908cb24e" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FairValueNetAssetLiability"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueBalanceSheetGroupingFinancialStatementCaptionsLineItems_f4063202-8a01-4474-98c9-a11a6cc1ad3b" xlink:to="loc_us-gaap_FairValueNetAssetLiability_3b28d2dc-5bfd-4f43-9520-ac87908cb24e" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AssetImpairmentCharges_36ba4765-ab43-4a5e-a292-ed33688719b3" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AssetImpairmentCharges"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueBalanceSheetGroupingFinancialStatementCaptionsLineItems_f4063202-8a01-4474-98c9-a11a6cc1ad3b" xlink:to="loc_us-gaap_AssetImpairmentCharges_36ba4765-ab43-4a5e-a292-ed33688719b3" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueByBalanceSheetGroupingTable_58ee7630-9643-4c5c-b7e9-78bbb78f22a5" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FairValueByBalanceSheetGroupingTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_FairValueBalanceSheetGroupingFinancialStatementCaptionsLineItems_f4063202-8a01-4474-98c9-a11a6cc1ad3b" xlink:to="loc_us-gaap_FairValueByBalanceSheetGroupingTable_58ee7630-9643-4c5c-b7e9-78bbb78f22a5" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_98dee3ec-0c25-40ae-b8f6-287d4b65eedb" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FairValueByFairValueHierarchyLevelAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueByBalanceSheetGroupingTable_58ee7630-9643-4c5c-b7e9-78bbb78f22a5" xlink:to="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_98dee3ec-0c25-40ae-b8f6-287d4b65eedb" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_98dee3ec-0c25-40ae-b8f6-287d4b65eedb_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FairValueMeasurementsFairValueHierarchyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_98dee3ec-0c25-40ae-b8f6-287d4b65eedb" xlink:to="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_98dee3ec-0c25-40ae-b8f6-287d4b65eedb_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_c15965e5-8779-4e97-9e27-6c078dff0cd1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FairValueMeasurementsFairValueHierarchyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_98dee3ec-0c25-40ae-b8f6-287d4b65eedb" xlink:to="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_c15965e5-8779-4e97-9e27-6c078dff0cd1" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueInputsLevel3Member_5ca35fee-fb61-412c-943b-c92d3378a084" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FairValueInputsLevel3Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_c15965e5-8779-4e97-9e27-6c078dff0cd1" xlink:to="loc_us-gaap_FairValueInputsLevel3Member_5ca35fee-fb61-412c-943b-c92d3378a084" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/FAIRVALUEMEASUREMENTSSCHEDULEOFASSETSANDLIABILITIESMEASUREDATFAIRVALUEDetails" xlink:type="simple" xlink:href="hsy-20220703.xsd#FAIRVALUEMEASUREMENTSSCHEDULEOFASSETSANDLIABILITIESMEASUREDATFAIRVALUEDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/FAIRVALUEMEASUREMENTSSCHEDULEOFASSETSANDLIABILITIESMEASUREDATFAIRVALUEDetails" xlink:type="extended" id="i6c366b659451489ca9aea6d42b2eed65_FAIRVALUEMEASUREMENTSSCHEDULEOFASSETSANDLIABILITIESMEASUREDATFAIRVALUEDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueBalanceSheetGroupingFinancialStatementCaptionsLineItems_202825b2-f0e9-43f0-aef2-53cd302d3aa9" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FairValueBalanceSheetGroupingFinancialStatementCaptionsLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeAssets_59cd1c2e-6e9c-46c1-bda0-56f7beecfb6d" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueBalanceSheetGroupingFinancialStatementCaptionsLineItems_202825b2-f0e9-43f0-aef2-53cd302d3aa9" xlink:to="loc_us-gaap_DerivativeAssets_59cd1c2e-6e9c-46c1-bda0-56f7beecfb6d" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeLiabilities_f4988407-8a63-415b-a844-eb5cef7f610e" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeLiabilities"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueBalanceSheetGroupingFinancialStatementCaptionsLineItems_202825b2-f0e9-43f0-aef2-53cd302d3aa9" xlink:to="loc_us-gaap_DerivativeLiabilities_f4988407-8a63-415b-a844-eb5cef7f610e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueByBalanceSheetGroupingTable_7ef143a8-54c8-41a9-9615-58788480df36" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FairValueByBalanceSheetGroupingTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_FairValueBalanceSheetGroupingFinancialStatementCaptionsLineItems_202825b2-f0e9-43f0-aef2-53cd302d3aa9" xlink:to="loc_us-gaap_FairValueByBalanceSheetGroupingTable_7ef143a8-54c8-41a9-9615-58788480df36" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueByMeasurementFrequencyAxis_58a7cc10-5861-4682-a0ae-a9faf707fead" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FairValueByMeasurementFrequencyAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueByBalanceSheetGroupingTable_7ef143a8-54c8-41a9-9615-58788480df36" xlink:to="loc_us-gaap_FairValueByMeasurementFrequencyAxis_58a7cc10-5861-4682-a0ae-a9faf707fead" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementFrequencyDomain_58a7cc10-5861-4682-a0ae-a9faf707fead_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FairValueMeasurementFrequencyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FairValueByMeasurementFrequencyAxis_58a7cc10-5861-4682-a0ae-a9faf707fead" xlink:to="loc_us-gaap_FairValueMeasurementFrequencyDomain_58a7cc10-5861-4682-a0ae-a9faf707fead_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementFrequencyDomain_43d963dd-23cd-462b-8f2f-6adde9cda511" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FairValueMeasurementFrequencyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FairValueByMeasurementFrequencyAxis_58a7cc10-5861-4682-a0ae-a9faf707fead" xlink:to="loc_us-gaap_FairValueMeasurementFrequencyDomain_43d963dd-23cd-462b-8f2f-6adde9cda511" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementsRecurringMember_14175739-6df8-4c4f-ab78-0d74852441be" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FairValueMeasurementsRecurringMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementFrequencyDomain_43d963dd-23cd-462b-8f2f-6adde9cda511" xlink:to="loc_us-gaap_FairValueMeasurementsRecurringMember_14175739-6df8-4c4f-ab78-0d74852441be" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeInstrumentRiskAxis_9f998438-ef50-41c6-b615-5d15a45d443e" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeInstrumentRiskAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueByBalanceSheetGroupingTable_7ef143a8-54c8-41a9-9615-58788480df36" xlink:to="loc_us-gaap_DerivativeInstrumentRiskAxis_9f998438-ef50-41c6-b615-5d15a45d443e" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_9f998438-ef50-41c6-b615-5d15a45d443e_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeContractTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_9f998438-ef50-41c6-b615-5d15a45d443e" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_9f998438-ef50-41c6-b615-5d15a45d443e_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_1cf094e3-7ca6-47cb-be6a-54835c8f42f5" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeContractTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_9f998438-ef50-41c6-b615-5d15a45d443e" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_1cf094e3-7ca6-47cb-be6a-54835c8f42f5" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ForeignExchangeContractMember_d0500876-7937-4b83-ae11-b33e690bc447" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ForeignExchangeContractMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_1cf094e3-7ca6-47cb-be6a-54835c8f42f5" xlink:to="loc_us-gaap_ForeignExchangeContractMember_d0500876-7937-4b83-ae11-b33e690bc447" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquitySwapMember_cd9f227d-1f3e-4e1c-adb4-6cb2942abda6" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EquitySwapMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_1cf094e3-7ca6-47cb-be6a-54835c8f42f5" xlink:to="loc_us-gaap_EquitySwapMember_cd9f227d-1f3e-4e1c-adb4-6cb2942abda6" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommodityContractMember_18645e98-2615-4c56-93b2-f2862c40f1d4" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CommodityContractMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_1cf094e3-7ca6-47cb-be6a-54835c8f42f5" xlink:to="loc_us-gaap_CommodityContractMember_18645e98-2615-4c56-93b2-f2862c40f1d4" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_9ac76fd2-ae9d-49d0-91aa-e3f9690a5bf3" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FairValueByFairValueHierarchyLevelAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueByBalanceSheetGroupingTable_7ef143a8-54c8-41a9-9615-58788480df36" xlink:to="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_9ac76fd2-ae9d-49d0-91aa-e3f9690a5bf3" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_9ac76fd2-ae9d-49d0-91aa-e3f9690a5bf3_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FairValueMeasurementsFairValueHierarchyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_9ac76fd2-ae9d-49d0-91aa-e3f9690a5bf3" xlink:to="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_9ac76fd2-ae9d-49d0-91aa-e3f9690a5bf3_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_28e00e6c-37b8-467e-8bb5-7b6034c9bd38" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FairValueMeasurementsFairValueHierarchyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_9ac76fd2-ae9d-49d0-91aa-e3f9690a5bf3" xlink:to="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_28e00e6c-37b8-467e-8bb5-7b6034c9bd38" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueInputsLevel1Member_11aa4bc4-09ea-44e8-a47e-6a9549553b80" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FairValueInputsLevel1Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_28e00e6c-37b8-467e-8bb5-7b6034c9bd38" xlink:to="loc_us-gaap_FairValueInputsLevel1Member_11aa4bc4-09ea-44e8-a47e-6a9549553b80" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueInputsLevel2Member_bfe969e1-b0e2-451d-8e7f-59dbb351ba1e" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FairValueInputsLevel2Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_28e00e6c-37b8-467e-8bb5-7b6034c9bd38" xlink:to="loc_us-gaap_FairValueInputsLevel2Member_bfe969e1-b0e2-451d-8e7f-59dbb351ba1e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueInputsLevel3Member_9ac7b100-e51d-427d-80af-c4bb0ce0a18b" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FairValueInputsLevel3Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_28e00e6c-37b8-467e-8bb5-7b6034c9bd38" xlink:to="loc_us-gaap_FairValueInputsLevel3Member_9ac7b100-e51d-427d-80af-c4bb0ce0a18b" xlink:type="arc" order="2"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/FAIRVALUEMEASUREMENTSSCHEDULEOFFAIRVALUESANDCARRYINGVALUESOFLONGTERMDEBTDetails" xlink:type="simple" xlink:href="hsy-20220703.xsd#FAIRVALUEMEASUREMENTSSCHEDULEOFFAIRVALUESANDCARRYINGVALUESOFLONGTERMDEBTDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/FAIRVALUEMEASUREMENTSSCHEDULEOFFAIRVALUESANDCARRYINGVALUESOFLONGTERMDEBTDetails" xlink:type="extended" id="i9885c14b217e4d33adaa8684aefd2aa7_FAIRVALUEMEASUREMENTSSCHEDULEOFFAIRVALUESANDCARRYINGVALUESOFLONGTERMDEBTDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_ba9ec911-8224-4592-8052-0af7c4aea89e" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_LongtermDebtCurrentMaturitiesFairValue_697fed71-eba4-4c62-8881-9389f9f06025" xlink:href="hsy-20220703.xsd#hsy_LongtermDebtCurrentMaturitiesFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_ba9ec911-8224-4592-8052-0af7c4aea89e" xlink:to="loc_hsy_LongtermDebtCurrentMaturitiesFairValue_697fed71-eba4-4c62-8881-9389f9f06025" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_LongtermDebtExcludingCurrentMaturitiesFairValue_fc37ad8b-b4e3-49c6-9b97-03d652346a00" xlink:href="hsy-20220703.xsd#hsy_LongtermDebtExcludingCurrentMaturitiesFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_ba9ec911-8224-4592-8052-0af7c4aea89e" xlink:to="loc_hsy_LongtermDebtExcludingCurrentMaturitiesFairValue_fc37ad8b-b4e3-49c6-9b97-03d652346a00" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongTermDebtFairValue_8e026e3f-67b4-4e7c-a460-7e4602204a0f" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LongTermDebtFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_ba9ec911-8224-4592-8052-0af7c4aea89e" xlink:to="loc_us-gaap_LongTermDebtFairValue_8e026e3f-67b4-4e7c-a460-7e4602204a0f" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongTermDebtCurrent_57334a5f-f057-4732-a258-e2008244d0b3" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LongTermDebtCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_ba9ec911-8224-4592-8052-0af7c4aea89e" xlink:to="loc_us-gaap_LongTermDebtCurrent_57334a5f-f057-4732-a258-e2008244d0b3" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongTermDebtNoncurrent_d3ae5f34-4ee7-437a-9b9c-c2a0ec5bd15e" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LongTermDebtNoncurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_ba9ec911-8224-4592-8052-0af7c4aea89e" xlink:to="loc_us-gaap_LongTermDebtNoncurrent_d3ae5f34-4ee7-437a-9b9c-c2a0ec5bd15e" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongTermDebt_85339d41-ae6b-4b73-9c87-402691cf6b75" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LongTermDebt"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_ba9ec911-8224-4592-8052-0af7c4aea89e" xlink:to="loc_us-gaap_LongTermDebt_85339d41-ae6b-4b73-9c87-402691cf6b75" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_cd652a32-b2fe-4d0b-8b9a-95769836756a" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_ba9ec911-8224-4592-8052-0af7c4aea89e" xlink:to="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_cd652a32-b2fe-4d0b-8b9a-95769836756a" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_8f2fb63c-dc95-4ceb-b309-c3f990a7a500" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FairValueByFairValueHierarchyLevelAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_cd652a32-b2fe-4d0b-8b9a-95769836756a" xlink:to="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_8f2fb63c-dc95-4ceb-b309-c3f990a7a500" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_8f2fb63c-dc95-4ceb-b309-c3f990a7a500_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FairValueMeasurementsFairValueHierarchyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_8f2fb63c-dc95-4ceb-b309-c3f990a7a500" xlink:to="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_8f2fb63c-dc95-4ceb-b309-c3f990a7a500_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_7da41591-37bb-43ab-98e0-5f07c2935df0" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FairValueMeasurementsFairValueHierarchyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_8f2fb63c-dc95-4ceb-b309-c3f990a7a500" xlink:to="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_7da41591-37bb-43ab-98e0-5f07c2935df0" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueInputsLevel2Member_5d702080-62c9-4172-8879-19265ed62fa1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FairValueInputsLevel2Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_7da41591-37bb-43ab-98e0-5f07c2935df0" xlink:to="loc_us-gaap_FairValueInputsLevel2Member_5d702080-62c9-4172-8879-19265ed62fa1" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/LEASESSUPPLEMENTALBALANCESHEETINFORMATIONRELATEDTOLEASESDetails" xlink:type="simple" xlink:href="hsy-20220703.xsd#LEASESSUPPLEMENTALBALANCESHEETINFORMATIONRELATEDTOLEASESDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/LEASESSUPPLEMENTALBALANCESHEETINFORMATIONRELATEDTOLEASESDetails" xlink:type="extended" id="i861b06565c2346f6980671d5421cde4f_LEASESSUPPLEMENTALBALANCESHEETINFORMATIONRELATEDTOLEASESDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeLeaseDescriptionLineItems_dfd42beb-7b5d-43dd-8de9-e6713f1c02f1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LesseeLeaseDescriptionLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLeaseRightOfUseAsset_aae1375c-c1ec-4fde-9a26-6583e9654f5a" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OperatingLeaseRightOfUseAsset"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_dfd42beb-7b5d-43dd-8de9-e6713f1c02f1" xlink:to="loc_us-gaap_OperatingLeaseRightOfUseAsset_aae1375c-c1ec-4fde-9a26-6583e9654f5a" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinanceLeaseRightOfUseAsset_ac02495f-6eb9-41a2-b6fa-e8da568376a6" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FinanceLeaseRightOfUseAsset"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_dfd42beb-7b5d-43dd-8de9-e6713f1c02f1" xlink:to="loc_us-gaap_FinanceLeaseRightOfUseAsset_ac02495f-6eb9-41a2-b6fa-e8da568376a6" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinanceLeaseRightOfUseAssetAccumulatedAmortization_6043cbb1-3443-4b6a-b79f-26f2b26939a7" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FinanceLeaseRightOfUseAssetAccumulatedAmortization"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_dfd42beb-7b5d-43dd-8de9-e6713f1c02f1" xlink:to="loc_us-gaap_FinanceLeaseRightOfUseAssetAccumulatedAmortization_6043cbb1-3443-4b6a-b79f-26f2b26939a7" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_LeaseRightofUseAsset_f23ccbd2-5da0-4080-8977-380fbea913f7" xlink:href="hsy-20220703.xsd#hsy_LeaseRightofUseAsset"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_dfd42beb-7b5d-43dd-8de9-e6713f1c02f1" xlink:to="loc_hsy_LeaseRightofUseAsset_f23ccbd2-5da0-4080-8977-380fbea913f7" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLeaseLiabilityCurrent_266750e6-46d3-4a47-91ee-56c8480e8c85" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OperatingLeaseLiabilityCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_dfd42beb-7b5d-43dd-8de9-e6713f1c02f1" xlink:to="loc_us-gaap_OperatingLeaseLiabilityCurrent_266750e6-46d3-4a47-91ee-56c8480e8c85" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinanceLeaseLiabilityCurrent_be5ca86e-e0cf-434a-a18a-7269d74adfe9" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FinanceLeaseLiabilityCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_dfd42beb-7b5d-43dd-8de9-e6713f1c02f1" xlink:to="loc_us-gaap_FinanceLeaseLiabilityCurrent_be5ca86e-e0cf-434a-a18a-7269d74adfe9" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLeaseLiabilityNoncurrent_1303ce0c-f09c-47fc-983c-c74303c211e1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OperatingLeaseLiabilityNoncurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_dfd42beb-7b5d-43dd-8de9-e6713f1c02f1" xlink:to="loc_us-gaap_OperatingLeaseLiabilityNoncurrent_1303ce0c-f09c-47fc-983c-c74303c211e1" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinanceLeaseLiabilityNoncurrent_e3849ae6-186d-46dc-98e8-b39b76f458f8" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FinanceLeaseLiabilityNoncurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_dfd42beb-7b5d-43dd-8de9-e6713f1c02f1" xlink:to="loc_us-gaap_FinanceLeaseLiabilityNoncurrent_e3849ae6-186d-46dc-98e8-b39b76f458f8" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_LeaseLiability_e6df3540-afcf-408d-9a14-e326ecf5346c" xlink:href="hsy-20220703.xsd#hsy_LeaseLiability"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_dfd42beb-7b5d-43dd-8de9-e6713f1c02f1" xlink:to="loc_hsy_LeaseLiability_e6df3540-afcf-408d-9a14-e326ecf5346c" xlink:type="arc" order="8"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeLeaseDescriptionTable_d2015282-3cf2-4bc6-adb7-8d63090621d6" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LesseeLeaseDescriptionTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_dfd42beb-7b5d-43dd-8de9-e6713f1c02f1" xlink:to="loc_us-gaap_LesseeLeaseDescriptionTable_d2015282-3cf2-4bc6-adb7-8d63090621d6" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BalanceSheetLocationAxis_f51fc76d-4f5d-4912-9588-d5d7e04355bf" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BalanceSheetLocationAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_LesseeLeaseDescriptionTable_d2015282-3cf2-4bc6-adb7-8d63090621d6" xlink:to="loc_us-gaap_BalanceSheetLocationAxis_f51fc76d-4f5d-4912-9588-d5d7e04355bf" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BalanceSheetLocationDomain_f51fc76d-4f5d-4912-9588-d5d7e04355bf_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BalanceSheetLocationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_BalanceSheetLocationAxis_f51fc76d-4f5d-4912-9588-d5d7e04355bf" xlink:to="loc_us-gaap_BalanceSheetLocationDomain_f51fc76d-4f5d-4912-9588-d5d7e04355bf_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BalanceSheetLocationDomain_075d540e-0e5f-44f5-8cb6-8d19e7fa2893" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BalanceSheetLocationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_BalanceSheetLocationAxis_f51fc76d-4f5d-4912-9588-d5d7e04355bf" xlink:to="loc_us-gaap_BalanceSheetLocationDomain_075d540e-0e5f-44f5-8cb6-8d19e7fa2893" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_PropertyPlantandEquipmentGrossMember_3a8e815e-def9-444a-8632-784166098776" xlink:href="hsy-20220703.xsd#hsy_PropertyPlantandEquipmentGrossMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BalanceSheetLocationDomain_075d540e-0e5f-44f5-8cb6-8d19e7fa2893" xlink:to="loc_hsy_PropertyPlantandEquipmentGrossMember_3a8e815e-def9-444a-8632-784166098776" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_AccumulatedDepreciationMember_f146a199-de83-4985-9ad2-0430c36d9c7e" xlink:href="hsy-20220703.xsd#hsy_AccumulatedDepreciationMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BalanceSheetLocationDomain_075d540e-0e5f-44f5-8cb6-8d19e7fa2893" xlink:to="loc_hsy_AccumulatedDepreciationMember_f146a199-de83-4985-9ad2-0430c36d9c7e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentMember_aeae2d72-6d14-4fb0-9c4a-45bea4442008" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PropertyPlantAndEquipmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BalanceSheetLocationDomain_075d540e-0e5f-44f5-8cb6-8d19e7fa2893" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentMember_aeae2d72-6d14-4fb0-9c4a-45bea4442008" xlink:type="arc" order="2"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/INVESTMENTSINUNCONSOLIDATEDAFFILIATESDetails" xlink:type="simple" xlink:href="hsy-20220703.xsd#INVESTMENTSINUNCONSOLIDATEDAFFILIATESDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/INVESTMENTSINUNCONSOLIDATEDAFFILIATESDetails" xlink:type="extended" id="i04f23f4cc3f14499b7e70d9a1d0b506b_INVESTMENTSINUNCONSOLIDATEDAFFILIATESDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionLineItems_024dfa45-db49-42f1-a5df-51849be5ff68" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessAcquisitionLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InvestmentsInAffiliatesSubsidiariesAssociatesAndJointVenturesFairValueDisclosure_62d3f6da-2ad6-4cec-a113-09e9bc02229b" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_InvestmentsInAffiliatesSubsidiariesAssociatesAndJointVenturesFairValueDisclosure"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_024dfa45-db49-42f1-a5df-51849be5ff68" xlink:to="loc_us-gaap_InvestmentsInAffiliatesSubsidiariesAssociatesAndJointVenturesFairValueDisclosure_62d3f6da-2ad6-4cec-a113-09e9bc02229b" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_f75fe4d4-c2dc-40f1-bf16-2bdcfa3e0f3f" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_024dfa45-db49-42f1-a5df-51849be5ff68" xlink:to="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_f75fe4d4-c2dc-40f1-bf16-2bdcfa3e0f3f" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BalanceSheetLocationAxis_821cf894-4cde-4aa4-a9c4-d9ca97eb92ec" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BalanceSheetLocationAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_f75fe4d4-c2dc-40f1-bf16-2bdcfa3e0f3f" xlink:to="loc_us-gaap_BalanceSheetLocationAxis_821cf894-4cde-4aa4-a9c4-d9ca97eb92ec" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BalanceSheetLocationDomain_821cf894-4cde-4aa4-a9c4-d9ca97eb92ec_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BalanceSheetLocationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_BalanceSheetLocationAxis_821cf894-4cde-4aa4-a9c4-d9ca97eb92ec" xlink:to="loc_us-gaap_BalanceSheetLocationDomain_821cf894-4cde-4aa4-a9c4-d9ca97eb92ec_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BalanceSheetLocationDomain_3691a556-8c9a-41c9-b9a9-5d21ca8600c0" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BalanceSheetLocationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_BalanceSheetLocationAxis_821cf894-4cde-4aa4-a9c4-d9ca97eb92ec" xlink:to="loc_us-gaap_BalanceSheetLocationDomain_3691a556-8c9a-41c9-b9a9-5d21ca8600c0" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherNoncurrentAssetsMember_c03ed196-85e6-4e78-96ac-65cba0ef850a" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherNoncurrentAssetsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BalanceSheetLocationDomain_3691a556-8c9a-41c9-b9a9-5d21ca8600c0" xlink:to="loc_us-gaap_OtherNoncurrentAssetsMember_c03ed196-85e6-4e78-96ac-65cba0ef850a" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/BUSINESSREALIGNMENTACTIVITIESSCHEDULEOFBUSINESSREALIGNMENTACTIVITYDetails" xlink:type="simple" xlink:href="hsy-20220703.xsd#BUSINESSREALIGNMENTACTIVITIESSCHEDULEOFBUSINESSREALIGNMENTACTIVITYDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/BUSINESSREALIGNMENTACTIVITIESSCHEDULEOFBUSINESSREALIGNMENTACTIVITYDetails" xlink:type="extended" id="id4450c26044a4d6e9d9c547129d64eff_BUSINESSREALIGNMENTACTIVITIESSCHEDULEOFBUSINESSREALIGNMENTACTIVITYDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringCostAndReserveLineItems_89dfd4eb-3315-4917-b046-01f585990116" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RestructuringCostAndReserveLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringCharges_409b3d5b-7708-4861-b520-5e006f36086c" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RestructuringCharges"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RestructuringCostAndReserveLineItems_89dfd4eb-3315-4917-b046-01f585990116" xlink:to="loc_us-gaap_RestructuringCharges_409b3d5b-7708-4861-b520-5e006f36086c" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_23aa57af-6aad-4d00-9510-e345d263a9cc" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfRestructuringAndRelatedCostsTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_RestructuringCostAndReserveLineItems_89dfd4eb-3315-4917-b046-01f585990116" xlink:to="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_23aa57af-6aad-4d00-9510-e345d263a9cc" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringCostAndReserveAxis_65cdf1e8-2e32-40bf-89d3-82e540658bf0" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RestructuringCostAndReserveAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_23aa57af-6aad-4d00-9510-e345d263a9cc" xlink:to="loc_us-gaap_RestructuringCostAndReserveAxis_65cdf1e8-2e32-40bf-89d3-82e540658bf0" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TypeOfRestructuringDomain_65cdf1e8-2e32-40bf-89d3-82e540658bf0_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_TypeOfRestructuringDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_RestructuringCostAndReserveAxis_65cdf1e8-2e32-40bf-89d3-82e540658bf0" xlink:to="loc_us-gaap_TypeOfRestructuringDomain_65cdf1e8-2e32-40bf-89d3-82e540658bf0_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TypeOfRestructuringDomain_189a0cb7-b765-4ab6-9a54-ccfc884418d2" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_TypeOfRestructuringDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_RestructuringCostAndReserveAxis_65cdf1e8-2e32-40bf-89d3-82e540658bf0" xlink:to="loc_us-gaap_TypeOfRestructuringDomain_189a0cb7-b765-4ab6-9a54-ccfc884418d2" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeSeveranceMember_e7bb92f6-437e-414b-8805-4d38394af463" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EmployeeSeveranceMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TypeOfRestructuringDomain_189a0cb7-b765-4ab6-9a54-ccfc884418d2" xlink:to="loc_us-gaap_EmployeeSeveranceMember_e7bb92f6-437e-414b-8805-4d38394af463" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherRestructuringMember_63c87301-d114-4d67-8461-e7ceca651187" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherRestructuringMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TypeOfRestructuringDomain_189a0cb7-b765-4ab6-9a54-ccfc884418d2" xlink:to="loc_us-gaap_OtherRestructuringMember_63c87301-d114-4d67-8461-e7ceca651187" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringPlanAxis_cf681b60-9af1-4b0e-8173-a206e0652a01" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RestructuringPlanAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_23aa57af-6aad-4d00-9510-e345d263a9cc" xlink:to="loc_us-gaap_RestructuringPlanAxis_cf681b60-9af1-4b0e-8173-a206e0652a01" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringPlanDomain_cf681b60-9af1-4b0e-8173-a206e0652a01_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RestructuringPlanDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_RestructuringPlanAxis_cf681b60-9af1-4b0e-8173-a206e0652a01" xlink:to="loc_us-gaap_RestructuringPlanDomain_cf681b60-9af1-4b0e-8173-a206e0652a01_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringPlanDomain_57ade0c9-a91b-4b67-9567-53cc0b5a397c" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RestructuringPlanDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_RestructuringPlanAxis_cf681b60-9af1-4b0e-8173-a206e0652a01" xlink:to="loc_us-gaap_RestructuringPlanDomain_57ade0c9-a91b-4b67-9567-53cc0b5a397c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_InternationalOptimizationProgramMember_8a273eb3-5eed-4569-b99d-5511f47bb3bf" xlink:href="hsy-20220703.xsd#hsy_InternationalOptimizationProgramMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RestructuringPlanDomain_57ade0c9-a91b-4b67-9567-53cc0b5a397c" xlink:to="loc_hsy_InternationalOptimizationProgramMember_8a273eb3-5eed-4569-b99d-5511f47bb3bf" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeStatementLocationAxis_4087327a-7431-4398-af96-556cb4a58055" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncomeStatementLocationAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_23aa57af-6aad-4d00-9510-e345d263a9cc" xlink:to="loc_us-gaap_IncomeStatementLocationAxis_4087327a-7431-4398-af96-556cb4a58055" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeStatementLocationDomain_4087327a-7431-4398-af96-556cb4a58055_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncomeStatementLocationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_IncomeStatementLocationAxis_4087327a-7431-4398-af96-556cb4a58055" xlink:to="loc_us-gaap_IncomeStatementLocationDomain_4087327a-7431-4398-af96-556cb4a58055_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeStatementLocationDomain_cc8baa6f-14ea-4c24-a552-6f7e1944dc32" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncomeStatementLocationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_IncomeStatementLocationAxis_4087327a-7431-4398-af96-556cb4a58055" xlink:to="loc_us-gaap_IncomeStatementLocationDomain_cc8baa6f-14ea-4c24-a552-6f7e1944dc32" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CostOfSalesMember_9c10af82-6bcb-430c-a2f8-a7ced51fcd81" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CostOfSalesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncomeStatementLocationDomain_cc8baa6f-14ea-4c24-a552-6f7e1944dc32" xlink:to="loc_us-gaap_CostOfSalesMember_9c10af82-6bcb-430c-a2f8-a7ced51fcd81" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SellingGeneralAndAdministrativeExpensesMember_6a2187af-b75a-442e-9f68-e5cbb0e06235" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_SellingGeneralAndAdministrativeExpensesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncomeStatementLocationDomain_cc8baa6f-14ea-4c24-a552-6f7e1944dc32" xlink:to="loc_us-gaap_SellingGeneralAndAdministrativeExpensesMember_6a2187af-b75a-442e-9f68-e5cbb0e06235" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringChargesMember_b2da8386-53e1-40d9-9925-ae0653928746" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RestructuringChargesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncomeStatementLocationDomain_cc8baa6f-14ea-4c24-a552-6f7e1944dc32" xlink:to="loc_us-gaap_RestructuringChargesMember_b2da8386-53e1-40d9-9925-ae0653928746" xlink:type="arc" order="2"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/BUSINESSREALIGNMENTACTIVITIESNARRATIVEDetails" xlink:type="simple" xlink:href="hsy-20220703.xsd#BUSINESSREALIGNMENTACTIVITIESNARRATIVEDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/BUSINESSREALIGNMENTACTIVITIESNARRATIVEDetails" xlink:type="extended" id="i86bc787ca30d4d3cbabac1e30c48520c_BUSINESSREALIGNMENTACTIVITIESNARRATIVEDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringCostAndReserveLineItems_29b0395d-8b34-47e9-b6a2-356a009a1847" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RestructuringCostAndReserveLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringAndRelatedCostExpectedCost1_77b691ec-0db7-4415-96bb-48917e0ae83f" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RestructuringAndRelatedCostExpectedCost1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RestructuringCostAndReserveLineItems_29b0395d-8b34-47e9-b6a2-356a009a1847" xlink:to="loc_us-gaap_RestructuringAndRelatedCostExpectedCost1_77b691ec-0db7-4415-96bb-48917e0ae83f" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_RestructuringandRelatedCostExpectedCostCashPortion_aa562c7e-9541-478b-b8a0-adf938ac9c07" xlink:href="hsy-20220703.xsd#hsy_RestructuringandRelatedCostExpectedCostCashPortion"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RestructuringCostAndReserveLineItems_29b0395d-8b34-47e9-b6a2-356a009a1847" xlink:to="loc_hsy_RestructuringandRelatedCostExpectedCostCashPortion_aa562c7e-9541-478b-b8a0-adf938ac9c07" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringAndRelatedCostExpectedNumberOfPositionsEliminated_a8134137-448a-4411-bf30-5eab149af214" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RestructuringAndRelatedCostExpectedNumberOfPositionsEliminated"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RestructuringCostAndReserveLineItems_29b0395d-8b34-47e9-b6a2-356a009a1847" xlink:to="loc_us-gaap_RestructuringAndRelatedCostExpectedNumberOfPositionsEliminated_a8134137-448a-4411-bf30-5eab149af214" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringCharges_1bcc54bc-c30f-456b-84c6-d15f20184eb3" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RestructuringCharges"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RestructuringCostAndReserveLineItems_29b0395d-8b34-47e9-b6a2-356a009a1847" xlink:to="loc_us-gaap_RestructuringCharges_1bcc54bc-c30f-456b-84c6-d15f20184eb3" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringAndRelatedCostCostIncurredToDate1_520d1ebf-53ef-40a6-86f2-feccbd1a86a0" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RestructuringAndRelatedCostCostIncurredToDate1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RestructuringCostAndReserveLineItems_29b0395d-8b34-47e9-b6a2-356a009a1847" xlink:to="loc_us-gaap_RestructuringAndRelatedCostCostIncurredToDate1_520d1ebf-53ef-40a6-86f2-feccbd1a86a0" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_5f1403d7-b5e8-4885-8a9f-0e8b6e7f6494" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfRestructuringAndRelatedCostsTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_RestructuringCostAndReserveLineItems_29b0395d-8b34-47e9-b6a2-356a009a1847" xlink:to="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_5f1403d7-b5e8-4885-8a9f-0e8b6e7f6494" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ConcentrationRiskByBenchmarkAxis_5d22030e-918c-4ed7-8879-8ec0e03514cf" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ConcentrationRiskByBenchmarkAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_5f1403d7-b5e8-4885-8a9f-0e8b6e7f6494" xlink:to="loc_us-gaap_ConcentrationRiskByBenchmarkAxis_5d22030e-918c-4ed7-8879-8ec0e03514cf" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ConcentrationRiskBenchmarkDomain_5d22030e-918c-4ed7-8879-8ec0e03514cf_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ConcentrationRiskBenchmarkDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_ConcentrationRiskByBenchmarkAxis_5d22030e-918c-4ed7-8879-8ec0e03514cf" xlink:to="loc_us-gaap_ConcentrationRiskBenchmarkDomain_5d22030e-918c-4ed7-8879-8ec0e03514cf_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ConcentrationRiskBenchmarkDomain_f6b468f5-1ae4-4e5e-b330-2d055e3f766d" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ConcentrationRiskBenchmarkDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_ConcentrationRiskByBenchmarkAxis_5d22030e-918c-4ed7-8879-8ec0e03514cf" xlink:to="loc_us-gaap_ConcentrationRiskBenchmarkDomain_f6b468f5-1ae4-4e5e-b330-2d055e3f766d" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ConcentrationRiskByTypeAxis_7f7786a6-80d3-4ab9-8639-03e9ff3e5201" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ConcentrationRiskByTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_5f1403d7-b5e8-4885-8a9f-0e8b6e7f6494" xlink:to="loc_us-gaap_ConcentrationRiskByTypeAxis_7f7786a6-80d3-4ab9-8639-03e9ff3e5201" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ConcentrationRiskTypeDomain_7f7786a6-80d3-4ab9-8639-03e9ff3e5201_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ConcentrationRiskTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_ConcentrationRiskByTypeAxis_7f7786a6-80d3-4ab9-8639-03e9ff3e5201" xlink:to="loc_us-gaap_ConcentrationRiskTypeDomain_7f7786a6-80d3-4ab9-8639-03e9ff3e5201_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ConcentrationRiskTypeDomain_7c31a899-9cc7-4cc7-9dc8-1bc233a8f0f9" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ConcentrationRiskTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_ConcentrationRiskByTypeAxis_7f7786a6-80d3-4ab9-8639-03e9ff3e5201" xlink:to="loc_us-gaap_ConcentrationRiskTypeDomain_7c31a899-9cc7-4cc7-9dc8-1bc233a8f0f9" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementBusinessSegmentsAxis_1773a244-3207-4afb-88df-fc370445c57d" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StatementBusinessSegmentsAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_5f1403d7-b5e8-4885-8a9f-0e8b6e7f6494" xlink:to="loc_us-gaap_StatementBusinessSegmentsAxis_1773a244-3207-4afb-88df-fc370445c57d" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SegmentDomain_1773a244-3207-4afb-88df-fc370445c57d_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_SegmentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementBusinessSegmentsAxis_1773a244-3207-4afb-88df-fc370445c57d" xlink:to="loc_us-gaap_SegmentDomain_1773a244-3207-4afb-88df-fc370445c57d_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SegmentDomain_619f9008-ae68-48c4-ace6-7523ae5eb5b4" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_SegmentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementBusinessSegmentsAxis_1773a244-3207-4afb-88df-fc370445c57d" xlink:to="loc_us-gaap_SegmentDomain_619f9008-ae68-48c4-ace6-7523ae5eb5b4" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringPlanAxis_5ec726db-c9e7-4286-b377-184d4f907bb9" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RestructuringPlanAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_5f1403d7-b5e8-4885-8a9f-0e8b6e7f6494" xlink:to="loc_us-gaap_RestructuringPlanAxis_5ec726db-c9e7-4286-b377-184d4f907bb9" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringPlanDomain_5ec726db-c9e7-4286-b377-184d4f907bb9_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RestructuringPlanDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_RestructuringPlanAxis_5ec726db-c9e7-4286-b377-184d4f907bb9" xlink:to="loc_us-gaap_RestructuringPlanDomain_5ec726db-c9e7-4286-b377-184d4f907bb9_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringPlanDomain_b7ae4603-1073-45d9-9292-4a95c77e5de7" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RestructuringPlanDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_RestructuringPlanAxis_5ec726db-c9e7-4286-b377-184d4f907bb9" xlink:to="loc_us-gaap_RestructuringPlanDomain_b7ae4603-1073-45d9-9292-4a95c77e5de7" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_InternationalOptimizationProgramMember_c07ce953-ccf9-4020-819f-edd841049456" xlink:href="hsy-20220703.xsd#hsy_InternationalOptimizationProgramMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RestructuringPlanDomain_b7ae4603-1073-45d9-9292-4a95c77e5de7" xlink:to="loc_hsy_InternationalOptimizationProgramMember_c07ce953-ccf9-4020-819f-edd841049456" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeAxis_c9981607-adc9-407a-a652-9918a5f47b2e" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_RangeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_5f1403d7-b5e8-4885-8a9f-0e8b6e7f6494" xlink:to="loc_srt_RangeAxis_c9981607-adc9-407a-a652-9918a5f47b2e" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_c9981607-adc9-407a-a652-9918a5f47b2e_default" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_RangeAxis_c9981607-adc9-407a-a652-9918a5f47b2e" xlink:to="loc_srt_RangeMember_c9981607-adc9-407a-a652-9918a5f47b2e_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_89f312f4-6cdf-4157-b604-3e748d810c57" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_RangeAxis_c9981607-adc9-407a-a652-9918a5f47b2e" xlink:to="loc_srt_RangeMember_89f312f4-6cdf-4157-b604-3e748d810c57" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MinimumMember_b82b9004-4375-4411-93aa-5b99466f47b8" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_MinimumMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_89f312f4-6cdf-4157-b604-3e748d810c57" xlink:to="loc_srt_MinimumMember_b82b9004-4375-4411-93aa-5b99466f47b8" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MaximumMember_148aa55b-35df-491d-afd2-23a81b5bf7ca" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_MaximumMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_89f312f4-6cdf-4157-b604-3e748d810c57" xlink:to="loc_srt_MaximumMember_148aa55b-35df-491d-afd2-23a81b5bf7ca" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_StatementGeographicalAxis_42f9081c-6d3a-491e-afa2-63e780a93cec" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_StatementGeographicalAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_5f1403d7-b5e8-4885-8a9f-0e8b6e7f6494" xlink:to="loc_srt_StatementGeographicalAxis_42f9081c-6d3a-491e-afa2-63e780a93cec" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_SegmentGeographicalDomain_42f9081c-6d3a-491e-afa2-63e780a93cec_default" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_SegmentGeographicalDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_StatementGeographicalAxis_42f9081c-6d3a-491e-afa2-63e780a93cec" xlink:to="loc_srt_SegmentGeographicalDomain_42f9081c-6d3a-491e-afa2-63e780a93cec_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_SegmentGeographicalDomain_59c86f25-289c-45a6-99ca-149b396e2bdf" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_SegmentGeographicalDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_StatementGeographicalAxis_42f9081c-6d3a-491e-afa2-63e780a93cec" xlink:to="loc_srt_SegmentGeographicalDomain_59c86f25-289c-45a6-99ca-149b396e2bdf" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NonUsMember_76a6aa0b-bc61-4cee-805d-6b139d5a1672" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NonUsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_SegmentGeographicalDomain_59c86f25-289c-45a6-99ca-149b396e2bdf" xlink:to="loc_us-gaap_NonUsMember_76a6aa0b-bc61-4cee-805d-6b139d5a1672" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/PENSIONANDOTHERPOSTRETIREMENTBENEFITPLANSSCHEDULEOFCOMPONENTSOFNETPERIODICBENEFITCOSTDetails" xlink:type="simple" xlink:href="hsy-20220703.xsd#PENSIONANDOTHERPOSTRETIREMENTBENEFITPLANSSCHEDULEOFCOMPONENTSOFNETPERIODICBENEFITCOSTDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/PENSIONANDOTHERPOSTRETIREMENTBENEFITPLANSSCHEDULEOFCOMPONENTSOFNETPERIODICBENEFITCOSTDetails" xlink:type="extended" id="if5a1e461b5c241509659c9adabfe1ef8_PENSIONANDOTHERPOSTRETIREMENTBENEFITPLANSSCHEDULEOFCOMPONENTSOFNETPERIODICBENEFITCOSTDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_4a36556a-14d7-4d40-9e29-759305fe56a8" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DefinedBenefitPlanDisclosureLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DefinedBenefitPlanServiceCost_a903e10c-7638-4890-91c5-351d102d6aba" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DefinedBenefitPlanServiceCost"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_4a36556a-14d7-4d40-9e29-759305fe56a8" xlink:to="loc_us-gaap_DefinedBenefitPlanServiceCost_a903e10c-7638-4890-91c5-351d102d6aba" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DefinedBenefitPlanInterestCost_925d5e04-c8d6-4fcd-9c5d-0de7fa0ae19e" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DefinedBenefitPlanInterestCost"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_4a36556a-14d7-4d40-9e29-759305fe56a8" xlink:to="loc_us-gaap_DefinedBenefitPlanInterestCost_925d5e04-c8d6-4fcd-9c5d-0de7fa0ae19e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DefinedBenefitPlanExpectedReturnOnPlanAssets_2f72bc3e-6c72-4861-9632-18fcfdb424bb" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DefinedBenefitPlanExpectedReturnOnPlanAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_4a36556a-14d7-4d40-9e29-759305fe56a8" xlink:to="loc_us-gaap_DefinedBenefitPlanExpectedReturnOnPlanAssets_2f72bc3e-6c72-4861-9632-18fcfdb424bb" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DefinedBenefitPlanAmortizationOfPriorServiceCostCredit_64cfad7f-bad2-46b8-9b3b-e2d05f60de76" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DefinedBenefitPlanAmortizationOfPriorServiceCostCredit"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_4a36556a-14d7-4d40-9e29-759305fe56a8" xlink:to="loc_us-gaap_DefinedBenefitPlanAmortizationOfPriorServiceCostCredit_64cfad7f-bad2-46b8-9b3b-e2d05f60de76" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DefinedBenefitPlanAmortizationOfGainsLosses_4551c230-bc3a-4ff0-9059-26b92c3550ce" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DefinedBenefitPlanAmortizationOfGainsLosses"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_4a36556a-14d7-4d40-9e29-759305fe56a8" xlink:to="loc_us-gaap_DefinedBenefitPlanAmortizationOfGainsLosses_4551c230-bc3a-4ff0-9059-26b92c3550ce" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DefinedBenefitPlanRecognizedNetGainLossDueToSettlements1_9a4c9276-6d40-4730-839b-c1b58fc74e82" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DefinedBenefitPlanRecognizedNetGainLossDueToSettlements1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_4a36556a-14d7-4d40-9e29-759305fe56a8" xlink:to="loc_us-gaap_DefinedBenefitPlanRecognizedNetGainLossDueToSettlements1_9a4c9276-6d40-4730-839b-c1b58fc74e82" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DefinedBenefitPlanNetPeriodicBenefitCost_6918fbc0-a365-4783-a55b-1317e646cab5" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DefinedBenefitPlanNetPeriodicBenefitCost"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_4a36556a-14d7-4d40-9e29-759305fe56a8" xlink:to="loc_us-gaap_DefinedBenefitPlanNetPeriodicBenefitCost_6918fbc0-a365-4783-a55b-1317e646cab5" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable_9573621f-f661-4b46-a969-ab1cb3034660" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_4a36556a-14d7-4d40-9e29-759305fe56a8" xlink:to="loc_us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable_9573621f-f661-4b46-a969-ab1cb3034660" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetirementPlanTypeAxis_a910698e-7d9a-47b9-9b5d-b4ecc20ce387" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RetirementPlanTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable_9573621f-f661-4b46-a969-ab1cb3034660" xlink:to="loc_us-gaap_RetirementPlanTypeAxis_a910698e-7d9a-47b9-9b5d-b4ecc20ce387" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetirementPlanTypeDomain_a910698e-7d9a-47b9-9b5d-b4ecc20ce387_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RetirementPlanTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_RetirementPlanTypeAxis_a910698e-7d9a-47b9-9b5d-b4ecc20ce387" xlink:to="loc_us-gaap_RetirementPlanTypeDomain_a910698e-7d9a-47b9-9b5d-b4ecc20ce387_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetirementPlanTypeDomain_2f585959-7cec-435f-85ee-57787b3d074c" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RetirementPlanTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_RetirementPlanTypeAxis_a910698e-7d9a-47b9-9b5d-b4ecc20ce387" xlink:to="loc_us-gaap_RetirementPlanTypeDomain_2f585959-7cec-435f-85ee-57787b3d074c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PensionPlansDefinedBenefitMember_87529fb1-bab8-4b84-9fc8-7d46b2497865" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PensionPlansDefinedBenefitMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RetirementPlanTypeDomain_2f585959-7cec-435f-85ee-57787b3d074c" xlink:to="loc_us-gaap_PensionPlansDefinedBenefitMember_87529fb1-bab8-4b84-9fc8-7d46b2497865" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherPostretirementBenefitPlansDefinedBenefitMember_60e9a605-e853-4321-8bfb-4b6ceb4c9462" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherPostretirementBenefitPlansDefinedBenefitMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RetirementPlanTypeDomain_2f585959-7cec-435f-85ee-57787b3d074c" xlink:to="loc_us-gaap_OtherPostretirementBenefitPlansDefinedBenefitMember_60e9a605-e853-4321-8bfb-4b6ceb4c9462" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/PENSIONANDOTHERPOSTRETIREMENTBENEFITPLANSNARRATIVEDetails" xlink:type="simple" xlink:href="hsy-20220703.xsd#PENSIONANDOTHERPOSTRETIREMENTBENEFITPLANSNARRATIVEDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/PENSIONANDOTHERPOSTRETIREMENTBENEFITPLANSNARRATIVEDetails" xlink:type="extended" id="i609b9deec22f4c01b53db6a69a0446a2_PENSIONANDOTHERPOSTRETIREMENTBENEFITPLANSNARRATIVEDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_48cfd108-3762-4076-aea4-1566610fa0c8" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DefinedBenefitPlanDisclosureLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DefinedBenefitPlanContributionsByEmployer_5dd681d8-6966-41e4-97f2-296d1d6e52e2" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DefinedBenefitPlanContributionsByEmployer"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_48cfd108-3762-4076-aea4-1566610fa0c8" xlink:to="loc_us-gaap_DefinedBenefitPlanContributionsByEmployer_5dd681d8-6966-41e4-97f2-296d1d6e52e2" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_DefinedBenefitPlanRemeasurementBasisSpreadOnDiscountRate_c0248690-b55a-4ae2-a039-266f9be642ae" xlink:href="hsy-20220703.xsd#hsy_DefinedBenefitPlanRemeasurementBasisSpreadOnDiscountRate"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_48cfd108-3762-4076-aea4-1566610fa0c8" xlink:to="loc_hsy_DefinedBenefitPlanRemeasurementBasisSpreadOnDiscountRate_c0248690-b55a-4ae2-a039-266f9be642ae" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DefinedBenefitPlanAssumptionsUsedCalculatingNetPeriodicBenefitCostExpectedLongTermReturnOnAssets_7f08f449-1364-4230-920d-4246f8f7b2fc" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DefinedBenefitPlanAssumptionsUsedCalculatingNetPeriodicBenefitCostExpectedLongTermReturnOnAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_48cfd108-3762-4076-aea4-1566610fa0c8" xlink:to="loc_us-gaap_DefinedBenefitPlanAssumptionsUsedCalculatingNetPeriodicBenefitCostExpectedLongTermReturnOnAssets_7f08f449-1364-4230-920d-4246f8f7b2fc" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable_21feecd9-2f3e-451a-84c6-a9c699e48799" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_48cfd108-3762-4076-aea4-1566610fa0c8" xlink:to="loc_us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable_21feecd9-2f3e-451a-84c6-a9c699e48799" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetirementPlanTypeAxis_c09ec357-bf8a-4df2-b132-13bbd24bdd1e" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RetirementPlanTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable_21feecd9-2f3e-451a-84c6-a9c699e48799" xlink:to="loc_us-gaap_RetirementPlanTypeAxis_c09ec357-bf8a-4df2-b132-13bbd24bdd1e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetirementPlanTypeDomain_c09ec357-bf8a-4df2-b132-13bbd24bdd1e_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RetirementPlanTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_RetirementPlanTypeAxis_c09ec357-bf8a-4df2-b132-13bbd24bdd1e" xlink:to="loc_us-gaap_RetirementPlanTypeDomain_c09ec357-bf8a-4df2-b132-13bbd24bdd1e_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetirementPlanTypeDomain_3a485721-9115-4dc6-ba10-16588c9875ac" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RetirementPlanTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_RetirementPlanTypeAxis_c09ec357-bf8a-4df2-b132-13bbd24bdd1e" xlink:to="loc_us-gaap_RetirementPlanTypeDomain_3a485721-9115-4dc6-ba10-16588c9875ac" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PensionPlansDefinedBenefitMember_b3bb1425-8c63-4b43-9289-445d8a3522dd" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PensionPlansDefinedBenefitMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RetirementPlanTypeDomain_3a485721-9115-4dc6-ba10-16588c9875ac" xlink:to="loc_us-gaap_PensionPlansDefinedBenefitMember_b3bb1425-8c63-4b43-9289-445d8a3522dd" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherPostretirementBenefitPlansDefinedBenefitMember_6327819d-aca9-4b75-856c-8687cf9550e9" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherPostretirementBenefitPlansDefinedBenefitMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RetirementPlanTypeDomain_3a485721-9115-4dc6-ba10-16588c9875ac" xlink:to="loc_us-gaap_OtherPostretirementBenefitPlansDefinedBenefitMember_6327819d-aca9-4b75-856c-8687cf9550e9" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetirementPlanNameAxis_9aff105c-fe62-44a4-a5a2-7772db2c578f" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RetirementPlanNameAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable_21feecd9-2f3e-451a-84c6-a9c699e48799" xlink:to="loc_us-gaap_RetirementPlanNameAxis_9aff105c-fe62-44a4-a5a2-7772db2c578f" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetirementPlanNameDomain_9aff105c-fe62-44a4-a5a2-7772db2c578f_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RetirementPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_RetirementPlanNameAxis_9aff105c-fe62-44a4-a5a2-7772db2c578f" xlink:to="loc_us-gaap_RetirementPlanNameDomain_9aff105c-fe62-44a4-a5a2-7772db2c578f_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetirementPlanNameDomain_aeac901e-633e-441c-a3f9-d6e42d868056" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RetirementPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_RetirementPlanNameAxis_9aff105c-fe62-44a4-a5a2-7772db2c578f" xlink:to="loc_us-gaap_RetirementPlanNameDomain_aeac901e-633e-441c-a3f9-d6e42d868056" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/STOCKCOMPENSATIONPLANSNARRATIVEDetails" xlink:type="simple" xlink:href="hsy-20220703.xsd#STOCKCOMPENSATIONPLANSNARRATIVEDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/STOCKCOMPENSATIONPLANSNARRATIVEDetails" xlink:type="extended" id="i5f601882ba2a48b0899cf1b66251e1df_STOCKCOMPENSATIONPLANSNARRATIVEDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_e16b4941-0e8d-4b03-80ff-8d862a8c1aa1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognized_d4051c01-9096-447f-a1a9-b98d796cbfee" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognized"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_e16b4941-0e8d-4b03-80ff-8d862a8c1aa1" xlink:to="loc_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognized_d4051c01-9096-447f-a1a9-b98d796cbfee" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedPeriodForRecognition1_f15d21f6-8b72-49ff-8932-884538cc671f" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedPeriodForRecognition1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_e16b4941-0e8d-4b03-80ff-8d862a8c1aa1" xlink:to="loc_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedPeriodForRecognition1_f15d21f6-8b72-49ff-8932-884538cc671f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardExpirationPeriod_8c872adc-b955-4b51-9e87-8c2b7dabc0b1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardExpirationPeriod"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_e16b4941-0e8d-4b03-80ff-8d862a8c1aa1" xlink:to="loc_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardExpirationPeriod_8c872adc-b955-4b51-9e87-8c2b7dabc0b1" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardVestingPeriod1_7b3563ee-af4d-40fb-bcb1-d3b0e6039268" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardVestingPeriod1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_e16b4941-0e8d-4b03-80ff-8d862a8c1aa1" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardVestingPeriod1_7b3563ee-af4d-40fb-bcb1-d3b0e6039268" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsGrantsInPeriodWeightedAverageGrantDateFairValue_8b86169b-99a7-45b3-a5b5-ddde527a9b21" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsGrantsInPeriodWeightedAverageGrantDateFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_e16b4941-0e8d-4b03-80ff-8d862a8c1aa1" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsGrantsInPeriodWeightedAverageGrantDateFairValue_8b86169b-99a7-45b3-a5b5-ddde527a9b21" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisesInPeriodTotalIntrinsicValue_2c23128d-1b49-4d31-8da8-317ce8194069" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisesInPeriodTotalIntrinsicValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_e16b4941-0e8d-4b03-80ff-8d862a8c1aa1" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisesInPeriodTotalIntrinsicValue_2c23128d-1b49-4d31-8da8-317ce8194069" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardRequisiteServicePeriod1_1789387a-71a4-42db-a19a-715f2feaa36d" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardRequisiteServicePeriod1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_e16b4941-0e8d-4b03-80ff-8d862a8c1aa1" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardRequisiteServicePeriod1_1789387a-71a4-42db-a19a-715f2feaa36d" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_ShareBasedCompensationArrangementByShareBasedPaymentAwardPerformanceScoreTargetAmounts_8c71889b-41cd-4c28-9855-0e011c5a7b29" xlink:href="hsy-20220703.xsd#hsy_ShareBasedCompensationArrangementByShareBasedPaymentAwardPerformanceScoreTargetAmounts"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_e16b4941-0e8d-4b03-80ff-8d862a8c1aa1" xlink:to="loc_hsy_ShareBasedCompensationArrangementByShareBasedPaymentAwardPerformanceScoreTargetAmounts_8c71889b-41cd-4c28-9855-0e011c5a7b29" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_ShareBasedCompensationArrangementByShareBasedPaymentAwardIntrinsicValueOfShareBasedLiabilitiesPaidCombinedWithFairValueOfSharesVested_1befb9af-34d9-4b63-aa5b-09945b62c499" xlink:href="hsy-20220703.xsd#hsy_ShareBasedCompensationArrangementByShareBasedPaymentAwardIntrinsicValueOfShareBasedLiabilitiesPaidCombinedWithFairValueOfSharesVested"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_e16b4941-0e8d-4b03-80ff-8d862a8c1aa1" xlink:to="loc_hsy_ShareBasedCompensationArrangementByShareBasedPaymentAwardIntrinsicValueOfShareBasedLiabilitiesPaidCombinedWithFairValueOfSharesVested_1befb9af-34d9-4b63-aa5b-09945b62c499" xlink:type="arc" order="8"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredCompensationArrangementWithIndividualSharesIssued_c11c5ef1-bdbd-4cb5-b5c5-bc4212ce8222" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredCompensationArrangementWithIndividualSharesIssued"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_e16b4941-0e8d-4b03-80ff-8d862a8c1aa1" xlink:to="loc_us-gaap_DeferredCompensationArrangementWithIndividualSharesIssued_c11c5ef1-bdbd-4cb5-b5c5-bc4212ce8222" xlink:type="arc" order="9"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_DeferredCompensationArrangementwithIndividualConversionBasis_73245f3a-4298-4135-8d98-2596feb41b87" xlink:href="hsy-20220703.xsd#hsy_DeferredCompensationArrangementwithIndividualConversionBasis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_e16b4941-0e8d-4b03-80ff-8d862a8c1aa1" xlink:to="loc_hsy_DeferredCompensationArrangementwithIndividualConversionBasis_73245f3a-4298-4135-8d98-2596feb41b87" xlink:type="arc" order="10"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_7c4be2b2-7e0b-423e-8948-04325ddacda9" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_e16b4941-0e8d-4b03-80ff-8d862a8c1aa1" xlink:to="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_7c4be2b2-7e0b-423e-8948-04325ddacda9" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AwardTypeAxis_e6b836df-e39f-4ef1-b9cf-89eca8d3def0" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AwardTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_7c4be2b2-7e0b-423e-8948-04325ddacda9" xlink:to="loc_us-gaap_AwardTypeAxis_e6b836df-e39f-4ef1-b9cf-89eca8d3def0" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_e6b836df-e39f-4ef1-b9cf-89eca8d3def0_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AwardTypeAxis_e6b836df-e39f-4ef1-b9cf-89eca8d3def0" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_e6b836df-e39f-4ef1-b9cf-89eca8d3def0_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_fb87c265-33ed-4a79-bcf2-b8563096bc7b" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AwardTypeAxis_e6b836df-e39f-4ef1-b9cf-89eca8d3def0" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_fb87c265-33ed-4a79-bcf2-b8563096bc7b" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeStockOptionMember_ceff8b33-13fc-463b-8d1f-35867da97a7b" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EmployeeStockOptionMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_fb87c265-33ed-4a79-bcf2-b8563096bc7b" xlink:to="loc_us-gaap_EmployeeStockOptionMember_ceff8b33-13fc-463b-8d1f-35867da97a7b" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_PerformanceStockUnitsandRestrictedStockUnitsMember_4bf2f31f-25bb-498b-92de-9d1384c67b1e" xlink:href="hsy-20220703.xsd#hsy_PerformanceStockUnitsandRestrictedStockUnitsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_fb87c265-33ed-4a79-bcf2-b8563096bc7b" xlink:to="loc_hsy_PerformanceStockUnitsandRestrictedStockUnitsMember_4bf2f31f-25bb-498b-92de-9d1384c67b1e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeAxis_da6f482a-33d4-4ea2-be74-a6b04792093a" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_RangeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_7c4be2b2-7e0b-423e-8948-04325ddacda9" xlink:to="loc_srt_RangeAxis_da6f482a-33d4-4ea2-be74-a6b04792093a" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_da6f482a-33d4-4ea2-be74-a6b04792093a_default" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_RangeAxis_da6f482a-33d4-4ea2-be74-a6b04792093a" xlink:to="loc_srt_RangeMember_da6f482a-33d4-4ea2-be74-a6b04792093a_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_9600968c-0dd5-4aab-b3a0-e3a682981abc" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_RangeAxis_da6f482a-33d4-4ea2-be74-a6b04792093a" xlink:to="loc_srt_RangeMember_9600968c-0dd5-4aab-b3a0-e3a682981abc" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MinimumMember_1bd7b205-43dc-4557-836e-d9b967368b95" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_MinimumMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_9600968c-0dd5-4aab-b3a0-e3a682981abc" xlink:to="loc_srt_MinimumMember_1bd7b205-43dc-4557-836e-d9b967368b95" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MaximumMember_9782ba0c-f530-4a0a-9b25-3ac40d115b27" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_MaximumMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_9600968c-0dd5-4aab-b3a0-e3a682981abc" xlink:to="loc_srt_MaximumMember_9782ba0c-f530-4a0a-9b25-3ac40d115b27" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/STOCKCOMPENSATIONPLANSSCHEDULEOFPSUsANDRSUsACTIVITYDetails" xlink:type="simple" xlink:href="hsy-20220703.xsd#STOCKCOMPENSATIONPLANSSCHEDULEOFPSUsANDRSUsACTIVITYDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/STOCKCOMPENSATIONPLANSSCHEDULEOFPSUsANDRSUsACTIVITYDetails" xlink:type="extended" id="i16789a1bdcd04660be18197cacf6ab81_STOCKCOMPENSATIONPLANSSCHEDULEOFPSUsANDRSUsACTIVITYDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_e4cec3ae-bb57-4a05-aa99-51182d134186" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsOutstandingRollForward_0ab0d0f8-c7b2-4b9b-8d03-cd82b759c88e" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsOutstandingRollForward"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_e4cec3ae-bb57-4a05-aa99-51182d134186" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsOutstandingRollForward_0ab0d0f8-c7b2-4b9b-8d03-cd82b759c88e" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber_32d58b5a-deaa-4c0d-9a21-9cec1c980eab" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsOutstandingRollForward_0ab0d0f8-c7b2-4b9b-8d03-cd82b759c88e" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber_32d58b5a-deaa-4c0d-9a21-9cec1c980eab" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod_22606ba7-99ca-432a-96e7-babe7bcb094a" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsOutstandingRollForward_0ab0d0f8-c7b2-4b9b-8d03-cd82b759c88e" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod_22606ba7-99ca-432a-96e7-babe7bcb094a" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsPerformanceAssumptionChange_6542628c-df5c-43e9-8659-375873d63e3c" xlink:href="hsy-20220703.xsd#hsy_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsPerformanceAssumptionChange"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsOutstandingRollForward_0ab0d0f8-c7b2-4b9b-8d03-cd82b759c88e" xlink:to="loc_hsy_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsPerformanceAssumptionChange_6542628c-df5c-43e9-8659-375873d63e3c" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod_8dce5d16-3f34-4c61-99db-360eedebc574" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsOutstandingRollForward_0ab0d0f8-c7b2-4b9b-8d03-cd82b759c88e" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod_8dce5d16-3f34-4c61-99db-360eedebc574" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod_5a59d5a8-f708-4273-80fd-5432a141e87c" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNonOptionEquityInstrumentsOutstandingRollForward_0ab0d0f8-c7b2-4b9b-8d03-cd82b759c88e" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod_5a59d5a8-f708-4273-80fd-5432a141e87c" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber_f384706b-8580-4668-80bf-dcd8f1151e3e" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_d32131d7-b93b-412a-8596-0a08b43e6465" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_e4cec3ae-bb57-4a05-aa99-51182d134186" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_d32131d7-b93b-412a-8596-0a08b43e6465" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue_ff4ac704-665e-4a2a-9749-2bc12d261b9a" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_d32131d7-b93b-412a-8596-0a08b43e6465" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue_ff4ac704-665e-4a2a-9749-2bc12d261b9a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue_c2290d3f-16c5-410b-85a4-0d348d4e1a43" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_d32131d7-b93b-412a-8596-0a08b43e6465" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue_c2290d3f-16c5-410b-85a4-0d348d4e1a43" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsPerformanceAssumptionChangeWeightedAverageGrantDateFairValue_b0a07217-f50c-42cf-a529-817b6ee8dc78" xlink:href="hsy-20220703.xsd#hsy_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsPerformanceAssumptionChangeWeightedAverageGrantDateFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_d32131d7-b93b-412a-8596-0a08b43e6465" xlink:to="loc_hsy_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsPerformanceAssumptionChangeWeightedAverageGrantDateFairValue_b0a07217-f50c-42cf-a529-817b6ee8dc78" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue_954fe5f2-989b-45fb-b6e2-1b5077a4e553" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_d32131d7-b93b-412a-8596-0a08b43e6465" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue_954fe5f2-989b-45fb-b6e2-1b5077a4e553" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue_22133eb7-3b49-4d14-ad4d-ac3b00acc869" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_d32131d7-b93b-412a-8596-0a08b43e6465" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue_22133eb7-3b49-4d14-ad4d-ac3b00acc869" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue_88bef01f-56ee-4f61-96cc-4766354353c8" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_78f7293b-404d-4aa2-80a2-fc6bb76be6a7" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_e4cec3ae-bb57-4a05-aa99-51182d134186" xlink:to="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_78f7293b-404d-4aa2-80a2-fc6bb76be6a7" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AwardTypeAxis_6d2ae760-8a09-4db7-8c72-cdff118547a4" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AwardTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_78f7293b-404d-4aa2-80a2-fc6bb76be6a7" xlink:to="loc_us-gaap_AwardTypeAxis_6d2ae760-8a09-4db7-8c72-cdff118547a4" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_6d2ae760-8a09-4db7-8c72-cdff118547a4_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AwardTypeAxis_6d2ae760-8a09-4db7-8c72-cdff118547a4" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_6d2ae760-8a09-4db7-8c72-cdff118547a4_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_ea4d8644-93c9-4df8-8966-99e494ad0662" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AwardTypeAxis_6d2ae760-8a09-4db7-8c72-cdff118547a4" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_ea4d8644-93c9-4df8-8966-99e494ad0662" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_PerformanceSharesAndRestrictedStockUnitsRSUMember_c4fac3b6-b724-45b7-b6ab-2d8a855709ea" xlink:href="hsy-20220703.xsd#hsy_PerformanceSharesAndRestrictedStockUnitsRSUMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_ea4d8644-93c9-4df8-8966-99e494ad0662" xlink:to="loc_hsy_PerformanceSharesAndRestrictedStockUnitsRSUMember_c4fac3b6-b724-45b7-b6ab-2d8a855709ea" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/STOCKCOMPENSATIONPLANSSCHEDULEOFPSUsANDRSUSFAIRVALUEWEIGHTEDAVERAGEASSUMPTIONSDetails" xlink:type="simple" xlink:href="hsy-20220703.xsd#STOCKCOMPENSATIONPLANSSCHEDULEOFPSUsANDRSUSFAIRVALUEWEIGHTEDAVERAGEASSUMPTIONSDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/STOCKCOMPENSATIONPLANSSCHEDULEOFPSUsANDRSUSFAIRVALUEWEIGHTEDAVERAGEASSUMPTIONSDetails" xlink:type="extended" id="i01bcff14b1f84bc7a4bd20621beee93c_STOCKCOMPENSATIONPLANSSCHEDULEOFPSUsANDRSUSFAIRVALUEWEIGHTEDAVERAGEASSUMPTIONSDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_4a2c4130-8e58-4001-81f3-2bb82f9f4f62" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod_e45586f7-495a-470a-8acb-0389478e7d1c" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_4a2c4130-8e58-4001-81f3-2bb82f9f4f62" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod_e45586f7-495a-470a-8acb-0389478e7d1c" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue_4ec93f8f-d72f-4215-bd7d-6ce76a724405" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_4a2c4130-8e58-4001-81f3-2bb82f9f4f62" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue_4ec93f8f-d72f-4215-bd7d-6ce76a724405" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SharePrice_fea66416-cbca-481a-92b0-3a32657d42ba" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_SharePrice"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_4a2c4130-8e58-4001-81f3-2bb82f9f4f62" xlink:to="loc_us-gaap_SharePrice_fea66416-cbca-481a-92b0-3a32657d42ba" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedDividendRate_e9628fc9-021d-4df9-8056-c4ba01c8e080" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedDividendRate"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_4a2c4130-8e58-4001-81f3-2bb82f9f4f62" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedDividendRate_e9628fc9-021d-4df9-8056-c4ba01c8e080" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedVolatilityRate_dd19af08-1981-40ad-b1fa-16a289c6d012" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedVolatilityRate"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_4a2c4130-8e58-4001-81f3-2bb82f9f4f62" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedVolatilityRate_dd19af08-1981-40ad-b1fa-16a289c6d012" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_9ad481fc-1574-474f-88e2-34d0a8b0524d" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_4a2c4130-8e58-4001-81f3-2bb82f9f4f62" xlink:to="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_9ad481fc-1574-474f-88e2-34d0a8b0524d" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AwardTypeAxis_aa79ca54-efbc-41ae-87dd-8eff21d96960" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AwardTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_9ad481fc-1574-474f-88e2-34d0a8b0524d" xlink:to="loc_us-gaap_AwardTypeAxis_aa79ca54-efbc-41ae-87dd-8eff21d96960" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_aa79ca54-efbc-41ae-87dd-8eff21d96960_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AwardTypeAxis_aa79ca54-efbc-41ae-87dd-8eff21d96960" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_aa79ca54-efbc-41ae-87dd-8eff21d96960_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_ccfd8867-b537-4d98-b094-c5f0d3d55da7" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AwardTypeAxis_aa79ca54-efbc-41ae-87dd-8eff21d96960" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_ccfd8867-b537-4d98-b094-c5f0d3d55da7" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_PerformanceSharesAndRestrictedStockUnitsRSUMember_f61c8596-fc1a-4749-be35-edd8ae658447" xlink:href="hsy-20220703.xsd#hsy_PerformanceSharesAndRestrictedStockUnitsRSUMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_ccfd8867-b537-4d98-b094-c5f0d3d55da7" xlink:to="loc_hsy_PerformanceSharesAndRestrictedStockUnitsRSUMember_f61c8596-fc1a-4749-be35-edd8ae658447" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/SEGMENTINFORMATIONNARRATIVEDetails" xlink:type="simple" xlink:href="hsy-20220703.xsd#SEGMENTINFORMATIONNARRATIVEDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/SEGMENTINFORMATIONNARRATIVEDetails" xlink:type="extended" id="if73f86412be7472ca36cc59460d7b79e_SEGMENTINFORMATIONNARRATIVEDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EntityWideRevenueMajorCustomerLineItems_e38514c2-a559-474e-9ca1-00b667874233" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EntityWideRevenueMajorCustomerLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NumberOfReportableSegments_929bf910-2371-42cf-9c49-49e05e274885" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NumberOfReportableSegments"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EntityWideRevenueMajorCustomerLineItems_e38514c2-a559-474e-9ca1-00b667874233" xlink:to="loc_us-gaap_NumberOfReportableSegments_929bf910-2371-42cf-9c49-49e05e274885" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_CumulativeAmountOfMarkToMarketGainsLossesOnCommodityDerivatives_7074a65d-e198-4dc7-969b-af5fac3c3ffa" xlink:href="hsy-20220703.xsd#hsy_CumulativeAmountOfMarkToMarketGainsLossesOnCommodityDerivatives"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EntityWideRevenueMajorCustomerLineItems_e38514c2-a559-474e-9ca1-00b667874233" xlink:to="loc_hsy_CumulativeAmountOfMarkToMarketGainsLossesOnCommodityDerivatives_7074a65d-e198-4dc7-969b-af5fac3c3ffa" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_NetGainLossOnCommodityDerivativePositionsReclassifiedFromUnallocatedDerivativeGainsLossesToSegmentIncome_672a8753-83ba-4ec3-bb67-9d773664ae90" xlink:href="hsy-20220703.xsd#hsy_NetGainLossOnCommodityDerivativePositionsReclassifiedFromUnallocatedDerivativeGainsLossesToSegmentIncome"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EntityWideRevenueMajorCustomerLineItems_e38514c2-a559-474e-9ca1-00b667874233" xlink:to="loc_hsy_NetGainLossOnCommodityDerivativePositionsReclassifiedFromUnallocatedDerivativeGainsLossesToSegmentIncome_672a8753-83ba-4ec3-bb67-9d773664ae90" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfEntityWideRevenueByMajorCustomersByReportingSegmentsTable_dec380cd-02bc-4214-b056-bed1f5171511" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfEntityWideRevenueByMajorCustomersByReportingSegmentsTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_EntityWideRevenueMajorCustomerLineItems_e38514c2-a559-474e-9ca1-00b667874233" xlink:to="loc_us-gaap_ScheduleOfEntityWideRevenueByMajorCustomersByReportingSegmentsTable_dec380cd-02bc-4214-b056-bed1f5171511" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeStatementLocationAxis_843bd209-4318-4c8f-b4de-996bb36888a5" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncomeStatementLocationAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfEntityWideRevenueByMajorCustomersByReportingSegmentsTable_dec380cd-02bc-4214-b056-bed1f5171511" xlink:to="loc_us-gaap_IncomeStatementLocationAxis_843bd209-4318-4c8f-b4de-996bb36888a5" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeStatementLocationDomain_843bd209-4318-4c8f-b4de-996bb36888a5_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncomeStatementLocationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_IncomeStatementLocationAxis_843bd209-4318-4c8f-b4de-996bb36888a5" xlink:to="loc_us-gaap_IncomeStatementLocationDomain_843bd209-4318-4c8f-b4de-996bb36888a5_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeStatementLocationDomain_423b1415-2f8a-4842-81e6-205da3b54148" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncomeStatementLocationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_IncomeStatementLocationAxis_843bd209-4318-4c8f-b4de-996bb36888a5" xlink:to="loc_us-gaap_IncomeStatementLocationDomain_423b1415-2f8a-4842-81e6-205da3b54148" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CostOfSalesMember_3e5a3577-4a56-4ef6-b71c-8887d6f50635" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CostOfSalesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncomeStatementLocationDomain_423b1415-2f8a-4842-81e6-205da3b54148" xlink:to="loc_us-gaap_CostOfSalesMember_3e5a3577-4a56-4ef6-b71c-8887d6f50635" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_StatementScenarioAxis_53cbe22c-2271-48f5-96f8-e5725173eb25" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_StatementScenarioAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfEntityWideRevenueByMajorCustomersByReportingSegmentsTable_dec380cd-02bc-4214-b056-bed1f5171511" xlink:to="loc_srt_StatementScenarioAxis_53cbe22c-2271-48f5-96f8-e5725173eb25" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ScenarioUnspecifiedDomain_53cbe22c-2271-48f5-96f8-e5725173eb25_default" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_ScenarioUnspecifiedDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_StatementScenarioAxis_53cbe22c-2271-48f5-96f8-e5725173eb25" xlink:to="loc_srt_ScenarioUnspecifiedDomain_53cbe22c-2271-48f5-96f8-e5725173eb25_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ScenarioUnspecifiedDomain_0cbf6c70-87d5-4201-a7d4-e06e4ef79748" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_ScenarioUnspecifiedDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_StatementScenarioAxis_53cbe22c-2271-48f5-96f8-e5725173eb25" xlink:to="loc_srt_ScenarioUnspecifiedDomain_0cbf6c70-87d5-4201-a7d4-e06e4ef79748" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ScenarioForecastMember_88ef3c1b-24e7-428a-ae97-1b33fd20f7de" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_ScenarioForecastMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ScenarioUnspecifiedDomain_0cbf6c70-87d5-4201-a7d4-e06e4ef79748" xlink:to="loc_srt_ScenarioForecastMember_88ef3c1b-24e7-428a-ae97-1b33fd20f7de" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsAxis_acf7c2b7-e9f1-43c3-85bb-142a90190e9d" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_ConsolidationItemsAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfEntityWideRevenueByMajorCustomersByReportingSegmentsTable_dec380cd-02bc-4214-b056-bed1f5171511" xlink:to="loc_srt_ConsolidationItemsAxis_acf7c2b7-e9f1-43c3-85bb-142a90190e9d" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsDomain_acf7c2b7-e9f1-43c3-85bb-142a90190e9d_default" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_ConsolidationItemsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_ConsolidationItemsAxis_acf7c2b7-e9f1-43c3-85bb-142a90190e9d" xlink:to="loc_srt_ConsolidationItemsDomain_acf7c2b7-e9f1-43c3-85bb-142a90190e9d_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsDomain_301f2d2a-1ad0-4a15-b0f0-411813dcc70c" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_ConsolidationItemsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_ConsolidationItemsAxis_acf7c2b7-e9f1-43c3-85bb-142a90190e9d" xlink:to="loc_srt_ConsolidationItemsDomain_301f2d2a-1ad0-4a15-b0f0-411813dcc70c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingSegmentsMember_00959d57-f90d-4235-b59a-118b6fd07862" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OperatingSegmentsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ConsolidationItemsDomain_301f2d2a-1ad0-4a15-b0f0-411813dcc70c" xlink:to="loc_us-gaap_OperatingSegmentsMember_00959d57-f90d-4235-b59a-118b6fd07862" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeInstrumentRiskAxis_3230ecc6-9be8-4df2-a8f3-ca08243ec185" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeInstrumentRiskAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfEntityWideRevenueByMajorCustomersByReportingSegmentsTable_dec380cd-02bc-4214-b056-bed1f5171511" xlink:to="loc_us-gaap_DerivativeInstrumentRiskAxis_3230ecc6-9be8-4df2-a8f3-ca08243ec185" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_3230ecc6-9be8-4df2-a8f3-ca08243ec185_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeContractTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_3230ecc6-9be8-4df2-a8f3-ca08243ec185" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_3230ecc6-9be8-4df2-a8f3-ca08243ec185_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_42684c10-33a5-462e-b4c9-e77109dfc66b" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeContractTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_3230ecc6-9be8-4df2-a8f3-ca08243ec185" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_42684c10-33a5-462e-b4c9-e77109dfc66b" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommodityContractMember_a4471aba-eafc-4ae0-ba22-257526397eaf" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CommodityContractMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_42684c10-33a5-462e-b4c9-e77109dfc66b" xlink:to="loc_us-gaap_CommodityContractMember_a4471aba-eafc-4ae0-ba22-257526397eaf" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/SEGMENTINFORMATIONSCHEDULEOFNETSALESANDEARNINGSBYSEGMENTDetails" xlink:type="simple" xlink:href="hsy-20220703.xsd#SEGMENTINFORMATIONSCHEDULEOFNETSALESANDEARNINGSBYSEGMENTDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/SEGMENTINFORMATIONSCHEDULEOFNETSALESANDEARNINGSBYSEGMENTDetails" xlink:type="extended" id="i47133ee3a29546e5980cc65247439c3c_SEGMENTINFORMATIONSCHEDULEOFNETSALESANDEARNINGSBYSEGMENTDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SegmentReportingInformationLineItems_8fbf0422-d938-4a13-bc34-c5a01bb780d6" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_SegmentReportingInformationLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax_bd7669e3-9cf5-4ed5-8b96-fb5c99977ac8" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_8fbf0422-d938-4a13-bc34-c5a01bb780d6" xlink:to="loc_us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax_bd7669e3-9cf5-4ed5-8b96-fb5c99977ac8" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingIncomeLoss_acc1c46f-a4d5-404a-8c42-4b9a5a64ad28" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OperatingIncomeLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_8fbf0422-d938-4a13-bc34-c5a01bb780d6" xlink:to="loc_us-gaap_OperatingIncomeLoss_acc1c46f-a4d5-404a-8c42-4b9a5a64ad28" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NonoperatingIncomeExpense_99d9ca68-c0ba-4a78-9488-30e405e598d1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NonoperatingIncomeExpense"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_8fbf0422-d938-4a13-bc34-c5a01bb780d6" xlink:to="loc_us-gaap_NonoperatingIncomeExpense_99d9ca68-c0ba-4a78-9488-30e405e598d1" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeGainLossOnDerivativeNet_9434c164-3015-41ca-b5ec-2e484d67e23c" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeGainLossOnDerivativeNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_8fbf0422-d938-4a13-bc34-c5a01bb780d6" xlink:to="loc_us-gaap_DerivativeGainLossOnDerivativeNet_9434c164-3015-41ca-b5ec-2e484d67e23c" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringCharges_0a3072da-4ad3-485d-a8fb-fff7ba3d2701" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RestructuringCharges"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_8fbf0422-d938-4a13-bc34-c5a01bb780d6" xlink:to="loc_us-gaap_RestructuringCharges_0a3072da-4ad3-485d-a8fb-fff7ba3d2701" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InterestIncomeExpenseNonoperatingNet_9fe754a3-3d7c-4485-95d3-ffdad8eac3da" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_InterestIncomeExpenseNonoperatingNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_8fbf0422-d938-4a13-bc34-c5a01bb780d6" xlink:to="loc_us-gaap_InterestIncomeExpenseNonoperatingNet_9fe754a3-3d7c-4485-95d3-ffdad8eac3da" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherNonoperatingIncomeExpense_ad077061-f1b3-4fea-9e6f-9643074c8b28" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherNonoperatingIncomeExpense"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_8fbf0422-d938-4a13-bc34-c5a01bb780d6" xlink:to="loc_us-gaap_OtherNonoperatingIncomeExpense_ad077061-f1b3-4fea-9e6f-9643074c8b28" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_f3372e83-1c84-4608-b063-9bdf91fd59fa" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_8fbf0422-d938-4a13-bc34-c5a01bb780d6" xlink:to="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_f3372e83-1c84-4608-b063-9bdf91fd59fa" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_bb8db34f-fef4-49da-8e3d-3ad95a7f9f8c" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_8fbf0422-d938-4a13-bc34-c5a01bb780d6" xlink:to="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_bb8db34f-fef4-49da-8e3d-3ad95a7f9f8c" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsAxis_da4d5c61-6a2c-4bde-a958-2ea6b7c5b545" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_ConsolidationItemsAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_bb8db34f-fef4-49da-8e3d-3ad95a7f9f8c" xlink:to="loc_srt_ConsolidationItemsAxis_da4d5c61-6a2c-4bde-a958-2ea6b7c5b545" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsDomain_da4d5c61-6a2c-4bde-a958-2ea6b7c5b545_default" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_ConsolidationItemsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_ConsolidationItemsAxis_da4d5c61-6a2c-4bde-a958-2ea6b7c5b545" xlink:to="loc_srt_ConsolidationItemsDomain_da4d5c61-6a2c-4bde-a958-2ea6b7c5b545_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsDomain_51d4ce6b-9e9d-4095-b163-63e3691a7e1a" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_ConsolidationItemsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_ConsolidationItemsAxis_da4d5c61-6a2c-4bde-a958-2ea6b7c5b545" xlink:to="loc_srt_ConsolidationItemsDomain_51d4ce6b-9e9d-4095-b163-63e3691a7e1a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingSegmentsMember_83780483-f6d6-48bf-91a0-0ef0a73bec7f" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OperatingSegmentsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ConsolidationItemsDomain_51d4ce6b-9e9d-4095-b163-63e3691a7e1a" xlink:to="loc_us-gaap_OperatingSegmentsMember_83780483-f6d6-48bf-91a0-0ef0a73bec7f" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CorporateNonSegmentMember_f3666611-4358-4636-9e81-3fa07abba303" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CorporateNonSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ConsolidationItemsDomain_51d4ce6b-9e9d-4095-b163-63e3691a7e1a" xlink:to="loc_us-gaap_CorporateNonSegmentMember_f3666611-4358-4636-9e81-3fa07abba303" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_MaterialReconcilingItemsMember_acf1cfbd-dcc9-43ef-85d7-fe97b41f6194" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_MaterialReconcilingItemsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ConsolidationItemsDomain_51d4ce6b-9e9d-4095-b163-63e3691a7e1a" xlink:to="loc_us-gaap_MaterialReconcilingItemsMember_acf1cfbd-dcc9-43ef-85d7-fe97b41f6194" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementBusinessSegmentsAxis_c8422963-d280-4f19-9798-89f675df3d76" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StatementBusinessSegmentsAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_bb8db34f-fef4-49da-8e3d-3ad95a7f9f8c" xlink:to="loc_us-gaap_StatementBusinessSegmentsAxis_c8422963-d280-4f19-9798-89f675df3d76" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SegmentDomain_c8422963-d280-4f19-9798-89f675df3d76_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_SegmentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementBusinessSegmentsAxis_c8422963-d280-4f19-9798-89f675df3d76" xlink:to="loc_us-gaap_SegmentDomain_c8422963-d280-4f19-9798-89f675df3d76_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SegmentDomain_b99b6f58-6be2-4fe6-bfec-45f426049d3c" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_SegmentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementBusinessSegmentsAxis_c8422963-d280-4f19-9798-89f675df3d76" xlink:to="loc_us-gaap_SegmentDomain_b99b6f58-6be2-4fe6-bfec-45f426049d3c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_NorthAmericaConfectionerySegmentMember_26b83cb3-070c-4496-bca9-0c849e59abfc" xlink:href="hsy-20220703.xsd#hsy_NorthAmericaConfectionerySegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentDomain_b99b6f58-6be2-4fe6-bfec-45f426049d3c" xlink:to="loc_hsy_NorthAmericaConfectionerySegmentMember_26b83cb3-070c-4496-bca9-0c849e59abfc" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_NorthAmericaSaltySnacksSegmentMember_e51cbc37-04f9-496f-a4db-af2c366ea350" xlink:href="hsy-20220703.xsd#hsy_NorthAmericaSaltySnacksSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentDomain_b99b6f58-6be2-4fe6-bfec-45f426049d3c" xlink:to="loc_hsy_NorthAmericaSaltySnacksSegmentMember_e51cbc37-04f9-496f-a4db-af2c366ea350" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_InternationalSegmentMember_dfa3e9b9-6585-4e7b-80c0-e43d788abc7f" xlink:href="hsy-20220703.xsd#hsy_InternationalSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentDomain_b99b6f58-6be2-4fe6-bfec-45f426049d3c" xlink:to="loc_hsy_InternationalSegmentMember_dfa3e9b9-6585-4e7b-80c0-e43d788abc7f" xlink:type="arc" order="2"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/SEGMENTINFORMATIONSCHEDULEOFUNALLOCATEDMARKTOMARKETGAINSLOSSESONCOMMODITYDERIVATIVESDetails" xlink:type="simple" xlink:href="hsy-20220703.xsd#SEGMENTINFORMATIONSCHEDULEOFUNALLOCATEDMARKTOMARKETGAINSLOSSESONCOMMODITYDERIVATIVESDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/SEGMENTINFORMATIONSCHEDULEOFUNALLOCATEDMARKTOMARKETGAINSLOSSESONCOMMODITYDERIVATIVESDetails" xlink:type="extended" id="i4388dab0e32041eeabea04c1cde1b24c_SEGMENTINFORMATIONSCHEDULEOFUNALLOCATEDMARKTOMARKETGAINSLOSSESONCOMMODITYDERIVATIVESDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SegmentReportingInformationLineItems_73a513c1-237f-4e42-8477-1a6927fc1c2d" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_SegmentReportingInformationLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeGainLossOnDerivativeNet_c5e8e2cb-5b76-461f-9ab6-386f627eb1d8" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeGainLossOnDerivativeNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_73a513c1-237f-4e42-8477-1a6927fc1c2d" xlink:to="loc_us-gaap_DerivativeGainLossOnDerivativeNet_c5e8e2cb-5b76-461f-9ab6-386f627eb1d8" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_NetGainLossOnCommodityDerivativePositionsReclassifiedFromUnallocatedDerivativeGainsLossesToSegmentIncome_bd5ff9c3-33ec-4ee7-95c0-29458d75d644" xlink:href="hsy-20220703.xsd#hsy_NetGainLossOnCommodityDerivativePositionsReclassifiedFromUnallocatedDerivativeGainsLossesToSegmentIncome"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_73a513c1-237f-4e42-8477-1a6927fc1c2d" xlink:to="loc_hsy_NetGainLossOnCommodityDerivativePositionsReclassifiedFromUnallocatedDerivativeGainsLossesToSegmentIncome_bd5ff9c3-33ec-4ee7-95c0-29458d75d644" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_NetMarktoMarketValuationofCertainDerivativePositionsRecognizedinUnallocatedDerivativeGainsLosses_42a09f04-386c-4aae-8103-ef96ed17ed0f" xlink:href="hsy-20220703.xsd#hsy_NetMarktoMarketValuationofCertainDerivativePositionsRecognizedinUnallocatedDerivativeGainsLosses"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_73a513c1-237f-4e42-8477-1a6927fc1c2d" xlink:to="loc_hsy_NetMarktoMarketValuationofCertainDerivativePositionsRecognizedinUnallocatedDerivativeGainsLosses_42a09f04-386c-4aae-8103-ef96ed17ed0f" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_335132ac-d7d4-4bed-a874-6afb3d5d07c1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_73a513c1-237f-4e42-8477-1a6927fc1c2d" xlink:to="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_335132ac-d7d4-4bed-a874-6afb3d5d07c1" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationAxis_b61a3706-9956-4c6f-8013-efc27355ae70" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_HedgingDesignationAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_335132ac-d7d4-4bed-a874-6afb3d5d07c1" xlink:to="loc_us-gaap_HedgingDesignationAxis_b61a3706-9956-4c6f-8013-efc27355ae70" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationDomain_b61a3706-9956-4c6f-8013-efc27355ae70_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_HedgingDesignationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_HedgingDesignationAxis_b61a3706-9956-4c6f-8013-efc27355ae70" xlink:to="loc_us-gaap_HedgingDesignationDomain_b61a3706-9956-4c6f-8013-efc27355ae70_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationDomain_8d55bdc9-47b1-4e40-940a-b308adcb1d6f" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_HedgingDesignationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_HedgingDesignationAxis_b61a3706-9956-4c6f-8013-efc27355ae70" xlink:to="loc_us-gaap_HedgingDesignationDomain_8d55bdc9-47b1-4e40-940a-b308adcb1d6f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NondesignatedMember_ba32be22-685c-4bdc-951a-4f36ed35b6b6" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NondesignatedMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_HedgingDesignationDomain_8d55bdc9-47b1-4e40-940a-b308adcb1d6f" xlink:to="loc_us-gaap_NondesignatedMember_ba32be22-685c-4bdc-951a-4f36ed35b6b6" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeInstrumentRiskAxis_ee37938b-fd33-496a-8b02-20eed65f2130" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeInstrumentRiskAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_335132ac-d7d4-4bed-a874-6afb3d5d07c1" xlink:to="loc_us-gaap_DerivativeInstrumentRiskAxis_ee37938b-fd33-496a-8b02-20eed65f2130" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_ee37938b-fd33-496a-8b02-20eed65f2130_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeContractTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_ee37938b-fd33-496a-8b02-20eed65f2130" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_ee37938b-fd33-496a-8b02-20eed65f2130_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_bb47e38b-9035-4dd4-8fde-1e596bbb3be6" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeContractTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_ee37938b-fd33-496a-8b02-20eed65f2130" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_bb47e38b-9035-4dd4-8fde-1e596bbb3be6" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommodityContractMember_ff9cb9ef-de25-46ba-85a1-5dc287320041" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CommodityContractMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_bb47e38b-9035-4dd4-8fde-1e596bbb3be6" xlink:to="loc_us-gaap_CommodityContractMember_ff9cb9ef-de25-46ba-85a1-5dc287320041" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsAxis_fca7af6d-e91c-42bd-bdff-82d693ae3e4f" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_ConsolidationItemsAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_335132ac-d7d4-4bed-a874-6afb3d5d07c1" xlink:to="loc_srt_ConsolidationItemsAxis_fca7af6d-e91c-42bd-bdff-82d693ae3e4f" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsDomain_fca7af6d-e91c-42bd-bdff-82d693ae3e4f_default" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_ConsolidationItemsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_ConsolidationItemsAxis_fca7af6d-e91c-42bd-bdff-82d693ae3e4f" xlink:to="loc_srt_ConsolidationItemsDomain_fca7af6d-e91c-42bd-bdff-82d693ae3e4f_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsDomain_119b1e5d-0e26-4852-b293-a2ce8796a538" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_ConsolidationItemsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_ConsolidationItemsAxis_fca7af6d-e91c-42bd-bdff-82d693ae3e4f" xlink:to="loc_srt_ConsolidationItemsDomain_119b1e5d-0e26-4852-b293-a2ce8796a538" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingSegmentsMember_f8e1e460-fec5-43db-979f-2969c45d6b18" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OperatingSegmentsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ConsolidationItemsDomain_119b1e5d-0e26-4852-b293-a2ce8796a538" xlink:to="loc_us-gaap_OperatingSegmentsMember_f8e1e460-fec5-43db-979f-2969c45d6b18" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/SEGMENTINFORMATIONSCHEDULEOFDEPRECIATIONANDAMORTIZATIONEXPENSEINCLUDEDWITHINSEGMENTINCOMEDetails" xlink:type="simple" xlink:href="hsy-20220703.xsd#SEGMENTINFORMATIONSCHEDULEOFDEPRECIATIONANDAMORTIZATIONEXPENSEINCLUDEDWITHINSEGMENTINCOMEDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/SEGMENTINFORMATIONSCHEDULEOFDEPRECIATIONANDAMORTIZATIONEXPENSEINCLUDEDWITHINSEGMENTINCOMEDetails" xlink:type="extended" id="id0d0f46b67544f06b981c71613ceb888_SEGMENTINFORMATIONSCHEDULEOFDEPRECIATIONANDAMORTIZATIONEXPENSEINCLUDEDWITHINSEGMENTINCOMEDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SegmentReportingInformationLineItems_cfccb322-3c92-4e05-b7a3-dae4eee18f01" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_SegmentReportingInformationLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DepreciationDepletionAndAmortization_5a3cdb17-2bf4-42b3-bfca-ef1dc5138d10" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DepreciationDepletionAndAmortization"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_cfccb322-3c92-4e05-b7a3-dae4eee18f01" xlink:to="loc_us-gaap_DepreciationDepletionAndAmortization_5a3cdb17-2bf4-42b3-bfca-ef1dc5138d10" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_bbc8a0de-1c4a-48b4-8e3a-0abe87c639d6" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_SegmentReportingInformationLineItems_cfccb322-3c92-4e05-b7a3-dae4eee18f01" xlink:to="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_bbc8a0de-1c4a-48b4-8e3a-0abe87c639d6" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsAxis_5fffa65d-b1cf-45dc-aad3-0b572763e16b" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_ConsolidationItemsAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_bbc8a0de-1c4a-48b4-8e3a-0abe87c639d6" xlink:to="loc_srt_ConsolidationItemsAxis_5fffa65d-b1cf-45dc-aad3-0b572763e16b" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsDomain_5fffa65d-b1cf-45dc-aad3-0b572763e16b_default" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_ConsolidationItemsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_ConsolidationItemsAxis_5fffa65d-b1cf-45dc-aad3-0b572763e16b" xlink:to="loc_srt_ConsolidationItemsDomain_5fffa65d-b1cf-45dc-aad3-0b572763e16b_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidationItemsDomain_0ded0fb2-83fb-4eca-b547-c1bfdc31fed4" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_ConsolidationItemsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_ConsolidationItemsAxis_5fffa65d-b1cf-45dc-aad3-0b572763e16b" xlink:to="loc_srt_ConsolidationItemsDomain_0ded0fb2-83fb-4eca-b547-c1bfdc31fed4" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingSegmentsMember_779bb909-2edd-4994-9a37-f155797ccac8" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OperatingSegmentsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ConsolidationItemsDomain_0ded0fb2-83fb-4eca-b547-c1bfdc31fed4" xlink:to="loc_us-gaap_OperatingSegmentsMember_779bb909-2edd-4994-9a37-f155797ccac8" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CorporateNonSegmentMember_dfb708ac-d450-4c58-94a0-a3279bdb46ba" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CorporateNonSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ConsolidationItemsDomain_0ded0fb2-83fb-4eca-b547-c1bfdc31fed4" xlink:to="loc_us-gaap_CorporateNonSegmentMember_dfb708ac-d450-4c58-94a0-a3279bdb46ba" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementBusinessSegmentsAxis_1c8b5f8b-005e-4887-8624-1bfd3bc026a8" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StatementBusinessSegmentsAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfSegmentReportingInformationBySegmentTable_bbc8a0de-1c4a-48b4-8e3a-0abe87c639d6" xlink:to="loc_us-gaap_StatementBusinessSegmentsAxis_1c8b5f8b-005e-4887-8624-1bfd3bc026a8" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SegmentDomain_1c8b5f8b-005e-4887-8624-1bfd3bc026a8_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_SegmentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementBusinessSegmentsAxis_1c8b5f8b-005e-4887-8624-1bfd3bc026a8" xlink:to="loc_us-gaap_SegmentDomain_1c8b5f8b-005e-4887-8624-1bfd3bc026a8_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SegmentDomain_224ecfb1-e8bd-4adc-b9e0-543ef65836f4" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_SegmentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementBusinessSegmentsAxis_1c8b5f8b-005e-4887-8624-1bfd3bc026a8" xlink:to="loc_us-gaap_SegmentDomain_224ecfb1-e8bd-4adc-b9e0-543ef65836f4" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_NorthAmericaConfectionerySegmentMember_6898cddf-ed4f-4ed8-8c37-9029ee0f9d67" xlink:href="hsy-20220703.xsd#hsy_NorthAmericaConfectionerySegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentDomain_224ecfb1-e8bd-4adc-b9e0-543ef65836f4" xlink:to="loc_hsy_NorthAmericaConfectionerySegmentMember_6898cddf-ed4f-4ed8-8c37-9029ee0f9d67" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_NorthAmericaSaltySnacksSegmentMember_a2524954-fcf2-4567-9f5d-c31648aaa594" xlink:href="hsy-20220703.xsd#hsy_NorthAmericaSaltySnacksSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentDomain_224ecfb1-e8bd-4adc-b9e0-543ef65836f4" xlink:to="loc_hsy_NorthAmericaSaltySnacksSegmentMember_a2524954-fcf2-4567-9f5d-c31648aaa594" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_InternationalSegmentMember_98214a03-5315-4322-b1a3-979cbf5ab278" xlink:href="hsy-20220703.xsd#hsy_InternationalSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentDomain_224ecfb1-e8bd-4adc-b9e0-543ef65836f4" xlink:to="loc_hsy_InternationalSegmentMember_98214a03-5315-4322-b1a3-979cbf5ab278" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CorporateMember_222819ee-76c9-4093-9ba6-f3baf4971cb0" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CorporateMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SegmentDomain_224ecfb1-e8bd-4adc-b9e0-543ef65836f4" xlink:to="loc_us-gaap_CorporateMember_222819ee-76c9-4093-9ba6-f3baf4971cb0" xlink:type="arc" order="3"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/SEGMENTINFORMATIONSCHEDULEOFSEGMENTINFORMATIONBYGEOGRAPHYDetails" xlink:type="simple" xlink:href="hsy-20220703.xsd#SEGMENTINFORMATIONSCHEDULEOFSEGMENTINFORMATIONBYGEOGRAPHYDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/SEGMENTINFORMATIONSCHEDULEOFSEGMENTINFORMATIONBYGEOGRAPHYDetails" xlink:type="extended" id="i041a500874c248f295856b5c8d275082_SEGMENTINFORMATIONSCHEDULEOFSEGMENTINFORMATIONBYGEOGRAPHYDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EntityWideRevenueMajorCustomerLineItems_a064ba05-9fdd-40e6-acca-1e97df080184" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EntityWideRevenueMajorCustomerLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax_a9763e3c-5e53-4d0f-905f-88fce07d76c4" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EntityWideRevenueMajorCustomerLineItems_a064ba05-9fdd-40e6-acca-1e97df080184" xlink:to="loc_us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax_a9763e3c-5e53-4d0f-905f-88fce07d76c4" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfEntityWideRevenueByMajorCustomersByReportingSegmentsTable_9dbfc54f-a12a-4e19-a93f-43f826a3a1c1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfEntityWideRevenueByMajorCustomersByReportingSegmentsTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_EntityWideRevenueMajorCustomerLineItems_a064ba05-9fdd-40e6-acca-1e97df080184" xlink:to="loc_us-gaap_ScheduleOfEntityWideRevenueByMajorCustomersByReportingSegmentsTable_9dbfc54f-a12a-4e19-a93f-43f826a3a1c1" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_StatementGeographicalAxis_b7508bc1-e64a-4d54-a24c-f972ce39c585" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_StatementGeographicalAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfEntityWideRevenueByMajorCustomersByReportingSegmentsTable_9dbfc54f-a12a-4e19-a93f-43f826a3a1c1" xlink:to="loc_srt_StatementGeographicalAxis_b7508bc1-e64a-4d54-a24c-f972ce39c585" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_SegmentGeographicalDomain_b7508bc1-e64a-4d54-a24c-f972ce39c585_default" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_SegmentGeographicalDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_StatementGeographicalAxis_b7508bc1-e64a-4d54-a24c-f972ce39c585" xlink:to="loc_srt_SegmentGeographicalDomain_b7508bc1-e64a-4d54-a24c-f972ce39c585_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_SegmentGeographicalDomain_13b97d68-0beb-47f8-bf37-1199a66bfc0e" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_SegmentGeographicalDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_StatementGeographicalAxis_b7508bc1-e64a-4d54-a24c-f972ce39c585" xlink:to="loc_srt_SegmentGeographicalDomain_13b97d68-0beb-47f8-bf37-1199a66bfc0e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_country_US_d630636e-a88f-4879-9d5e-dde860f02de6" xlink:href="https://xbrl.sec.gov/country/2021/country-2021.xsd#country_US"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_SegmentGeographicalDomain_13b97d68-0beb-47f8-bf37-1199a66bfc0e" xlink:to="loc_country_US_d630636e-a88f-4879-9d5e-dde860f02de6" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NonUsMember_f08cc243-8aae-4fb7-b8f4-a487070a53f1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NonUsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_SegmentGeographicalDomain_13b97d68-0beb-47f8-bf37-1199a66bfc0e" xlink:to="loc_us-gaap_NonUsMember_f08cc243-8aae-4fb7-b8f4-a487070a53f1" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/TREASURYSTOCKACTIVITYSCHEDULEOFTREASURYSTOCKACTIVITYDetails" xlink:type="simple" xlink:href="hsy-20220703.xsd#TREASURYSTOCKACTIVITYSCHEDULEOFTREASURYSTOCKACTIVITYDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/TREASURYSTOCKACTIVITYSCHEDULEOFTREASURYSTOCKACTIVITYDetails" xlink:type="extended" id="ib5a747cec8a24bc894928f069a86da46_TREASURYSTOCKACTIVITYSCHEDULEOFTREASURYSTOCKACTIVITYDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockLineItems_8dac8ffd-2156-495c-a2d8-6ddb411dcb67" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ClassOfStockLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TreasuryStockSharesAcquired_ec98abd9-b085-4b2f-9620-398effe5f8a8" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_TreasuryStockSharesAcquired"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockLineItems_8dac8ffd-2156-495c-a2d8-6ddb411dcb67" xlink:to="loc_us-gaap_TreasuryStockSharesAcquired_ec98abd9-b085-4b2f-9620-398effe5f8a8" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockIssuedDuringPeriodSharesShareBasedCompensationGross_ceef7e9f-fbbd-4b52-957f-82fc387d799f" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StockIssuedDuringPeriodSharesShareBasedCompensationGross"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockLineItems_8dac8ffd-2156-495c-a2d8-6ddb411dcb67" xlink:to="loc_us-gaap_StockIssuedDuringPeriodSharesShareBasedCompensationGross_ceef7e9f-fbbd-4b52-957f-82fc387d799f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_TreasuryStockChangeinShares_69a63986-c9d8-4d25-a04f-a051edccfe0c" xlink:href="hsy-20220703.xsd#hsy_TreasuryStockChangeinShares"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockLineItems_8dac8ffd-2156-495c-a2d8-6ddb411dcb67" xlink:to="loc_hsy_TreasuryStockChangeinShares_69a63986-c9d8-4d25-a04f-a051edccfe0c" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockRepurchasedDuringPeriodValue_43789a67-3711-44cc-a593-f72378ce23c1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StockRepurchasedDuringPeriodValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockLineItems_8dac8ffd-2156-495c-a2d8-6ddb411dcb67" xlink:to="loc_us-gaap_StockRepurchasedDuringPeriodValue_43789a67-3711-44cc-a593-f72378ce23c1" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockIssuedDuringPeriodValueShareBasedCompensationGross_a927732d-b6fd-4b8a-a3c9-637c72de2e10" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StockIssuedDuringPeriodValueShareBasedCompensationGross"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockLineItems_8dac8ffd-2156-495c-a2d8-6ddb411dcb67" xlink:to="loc_us-gaap_StockIssuedDuringPeriodValueShareBasedCompensationGross_a927732d-b6fd-4b8a-a3c9-637c72de2e10" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_TreasuryStockChangeinValue_eddea6ee-c60e-47e8-9201-77044e85c723" xlink:href="hsy-20220703.xsd#hsy_TreasuryStockChangeinValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockLineItems_8dac8ffd-2156-495c-a2d8-6ddb411dcb67" xlink:to="loc_hsy_TreasuryStockChangeinValue_eddea6ee-c60e-47e8-9201-77044e85c723" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfStockByClassTable_5475a2ea-200b-4463-9c8e-01b37ff4b51b" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfStockByClassTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ClassOfStockLineItems_8dac8ffd-2156-495c-a2d8-6ddb411dcb67" xlink:to="loc_us-gaap_ScheduleOfStockByClassTable_5475a2ea-200b-4463-9c8e-01b37ff4b51b" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementClassOfStockAxis_8b894ae2-f41a-4864-82cb-65e47e5ba148" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StatementClassOfStockAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfStockByClassTable_5475a2ea-200b-4463-9c8e-01b37ff4b51b" xlink:to="loc_us-gaap_StatementClassOfStockAxis_8b894ae2-f41a-4864-82cb-65e47e5ba148" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_8b894ae2-f41a-4864-82cb-65e47e5ba148_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementClassOfStockAxis_8b894ae2-f41a-4864-82cb-65e47e5ba148" xlink:to="loc_us-gaap_ClassOfStockDomain_8b894ae2-f41a-4864-82cb-65e47e5ba148_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_9677aeec-f4bf-45ff-a5f8-db8232c46dbe" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementClassOfStockAxis_8b894ae2-f41a-4864-82cb-65e47e5ba148" xlink:to="loc_us-gaap_ClassOfStockDomain_9677aeec-f4bf-45ff-a5f8-db8232c46dbe" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_HersheyCommonStockMember_2bdb4062-8ac3-442c-b356-3baedb7d3eec" xlink:href="hsy-20220703.xsd#hsy_HersheyCommonStockMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_9677aeec-f4bf-45ff-a5f8-db8232c46dbe" xlink:to="loc_hsy_HersheyCommonStockMember_2bdb4062-8ac3-442c-b356-3baedb7d3eec" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AwardTypeAxis_0c16b26e-7529-4635-a6e4-ec0b20bda898" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AwardTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfStockByClassTable_5475a2ea-200b-4463-9c8e-01b37ff4b51b" xlink:to="loc_us-gaap_AwardTypeAxis_0c16b26e-7529-4635-a6e4-ec0b20bda898" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_0c16b26e-7529-4635-a6e4-ec0b20bda898_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AwardTypeAxis_0c16b26e-7529-4635-a6e4-ec0b20bda898" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_0c16b26e-7529-4635-a6e4-ec0b20bda898_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_8bac9e51-b840-4928-a8e6-902768bb6fd5" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AwardTypeAxis_0c16b26e-7529-4635-a6e4-ec0b20bda898" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_8bac9e51-b840-4928-a8e6-902768bb6fd5" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_HersheyTrustCompanyMember_c2af0d82-2bea-4d4f-87f5-7d36e9d4e940" xlink:href="hsy-20220703.xsd#hsy_HersheyTrustCompanyMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_8bac9e51-b840-4928-a8e6-902768bb6fd5" xlink:to="loc_hsy_HersheyTrustCompanyMember_c2af0d82-2bea-4d4f-87f5-7d36e9d4e940" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeStockOptionMember_0508c6e9-5471-49de-ab52-ace7ae6d6075" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EmployeeStockOptionMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_8bac9e51-b840-4928-a8e6-902768bb6fd5" xlink:to="loc_us-gaap_EmployeeStockOptionMember_0508c6e9-5471-49de-ab52-ace7ae6d6075" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/TREASURYSTOCKACTIVITYNARRATIVEDetails" xlink:type="simple" xlink:href="hsy-20220703.xsd#TREASURYSTOCKACTIVITYNARRATIVEDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/TREASURYSTOCKACTIVITYNARRATIVEDetails" xlink:type="extended" id="i59c643fe3aaa4a8291caf6c0c9e7cf42_TREASURYSTOCKACTIVITYNARRATIVEDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquityClassOfTreasuryStockLineItems_7789a88f-58c6-47e1-bd70-3f6b0619c47b" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EquityClassOfTreasuryStockLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TreasuryStockSharesAcquired_51742ba9-05bb-4fcb-aaf2-7797b69c144a" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_TreasuryStockSharesAcquired"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityClassOfTreasuryStockLineItems_7789a88f-58c6-47e1-bd70-3f6b0619c47b" xlink:to="loc_us-gaap_TreasuryStockSharesAcquired_51742ba9-05bb-4fcb-aaf2-7797b69c144a" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TreasuryStockAcquiredAverageCostPerShare_02aecea3-a31b-4da3-9235-aec5b29328df" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_TreasuryStockAcquiredAverageCostPerShare"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityClassOfTreasuryStockLineItems_7789a88f-58c6-47e1-bd70-3f6b0619c47b" xlink:to="loc_us-gaap_TreasuryStockAcquiredAverageCostPerShare_02aecea3-a31b-4da3-9235-aec5b29328df" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockRepurchasedDuringPeriodValue_094645c3-4678-4679-a5ea-7728b7867eb6" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StockRepurchasedDuringPeriodValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityClassOfTreasuryStockLineItems_7789a88f-58c6-47e1-bd70-3f6b0619c47b" xlink:to="loc_us-gaap_StockRepurchasedDuringPeriodValue_094645c3-4678-4679-a5ea-7728b7867eb6" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockRepurchaseProgramAuthorizedAmount1_fa251051-54b4-42a9-bc21-e00671cd04cf" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StockRepurchaseProgramAuthorizedAmount1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityClassOfTreasuryStockLineItems_7789a88f-58c6-47e1-bd70-3f6b0619c47b" xlink:to="loc_us-gaap_StockRepurchaseProgramAuthorizedAmount1_fa251051-54b4-42a9-bc21-e00671cd04cf" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockRepurchaseProgramRemainingAuthorizedRepurchaseAmount1_065f604d-3be9-4ff4-b7f7-5483db1afa8a" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StockRepurchaseProgramRemainingAuthorizedRepurchaseAmount1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityClassOfTreasuryStockLineItems_7789a88f-58c6-47e1-bd70-3f6b0619c47b" xlink:to="loc_us-gaap_StockRepurchaseProgramRemainingAuthorizedRepurchaseAmount1_065f604d-3be9-4ff4-b7f7-5483db1afa8a" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfTreasuryStockTable_8e447bdc-3e71-4430-8988-92c1db31f560" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ClassOfTreasuryStockTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_EquityClassOfTreasuryStockLineItems_7789a88f-58c6-47e1-bd70-3f6b0619c47b" xlink:to="loc_us-gaap_ClassOfTreasuryStockTable_8e447bdc-3e71-4430-8988-92c1db31f560" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AwardTypeAxis_5b403484-5301-435a-bb76-8352e1de1a6a" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AwardTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ClassOfTreasuryStockTable_8e447bdc-3e71-4430-8988-92c1db31f560" xlink:to="loc_us-gaap_AwardTypeAxis_5b403484-5301-435a-bb76-8352e1de1a6a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_5b403484-5301-435a-bb76-8352e1de1a6a_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AwardTypeAxis_5b403484-5301-435a-bb76-8352e1de1a6a" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_5b403484-5301-435a-bb76-8352e1de1a6a_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_3a37c6c2-1b32-4297-9de1-ac39a8035d24" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AwardTypeAxis_5b403484-5301-435a-bb76-8352e1de1a6a" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_3a37c6c2-1b32-4297-9de1-ac39a8035d24" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_HersheyTrustCompanyMember_ed75501f-89c1-49f9-a108-dc85a5e453fc" xlink:href="hsy-20220703.xsd#hsy_HersheyTrustCompanyMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_3a37c6c2-1b32-4297-9de1-ac39a8035d24" xlink:to="loc_hsy_HersheyTrustCompanyMember_ed75501f-89c1-49f9-a108-dc85a5e453fc" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareRepurchaseProgramAxis_6b821e58-006e-44d9-8614-93ec4c0b5b1b" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareRepurchaseProgramAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ClassOfTreasuryStockTable_8e447bdc-3e71-4430-8988-92c1db31f560" xlink:to="loc_us-gaap_ShareRepurchaseProgramAxis_6b821e58-006e-44d9-8614-93ec4c0b5b1b" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareRepurchaseProgramDomain_6b821e58-006e-44d9-8614-93ec4c0b5b1b_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareRepurchaseProgramDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_ShareRepurchaseProgramAxis_6b821e58-006e-44d9-8614-93ec4c0b5b1b" xlink:to="loc_us-gaap_ShareRepurchaseProgramDomain_6b821e58-006e-44d9-8614-93ec4c0b5b1b_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareRepurchaseProgramDomain_1717d91b-840e-4331-b9e9-97dd16db3cd1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareRepurchaseProgramDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_ShareRepurchaseProgramAxis_6b821e58-006e-44d9-8614-93ec4c0b5b1b" xlink:to="loc_us-gaap_ShareRepurchaseProgramDomain_1717d91b-840e-4331-b9e9-97dd16db3cd1" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_A2018ShareRepurchaseProgramMember_b6543c09-23bd-4d3d-9c6f-c2d824075097" xlink:href="hsy-20220703.xsd#hsy_A2018ShareRepurchaseProgramMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareRepurchaseProgramDomain_1717d91b-840e-4331-b9e9-97dd16db3cd1" xlink:to="loc_hsy_A2018ShareRepurchaseProgramMember_b6543c09-23bd-4d3d-9c6f-c2d824075097" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_A2021ShareRepurchaseProgramMember_8b6297b3-8589-4604-a46f-0d156a5e6493" xlink:href="hsy-20220703.xsd#hsy_A2021ShareRepurchaseProgramMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareRepurchaseProgramDomain_1717d91b-840e-4331-b9e9-97dd16db3cd1" xlink:to="loc_hsy_A2021ShareRepurchaseProgramMember_8b6297b3-8589-4604-a46f-0d156a5e6493" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/EARNINGSPERSHARENARRATIVEDetails" xlink:type="simple" xlink:href="hsy-20220703.xsd#EARNINGSPERSHARENARRATIVEDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/EARNINGSPERSHARENARRATIVEDetails" xlink:type="extended" id="i69bf5826e7884c3492a424c03bb009eb_EARNINGSPERSHARENARRATIVEDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareLineItems_c6ceae00-3a2a-418d-8755-bd424bb20ea7" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ConversionOfStockSharesConverted1_4e6176d0-0a6e-4ef8-a36e-1fe95c2a623e" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ConversionOfStockSharesConverted1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareLineItems_c6ceae00-3a2a-418d-8755-bd424bb20ea7" xlink:to="loc_us-gaap_ConversionOfStockSharesConverted1_4e6176d0-0a6e-4ef8-a36e-1fe95c2a623e" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareAmount_97dad5ed-3ae3-4623-9830-ce77dcbfd3f1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareAmount"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareLineItems_c6ceae00-3a2a-418d-8755-bd424bb20ea7" xlink:to="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareAmount_97dad5ed-3ae3-4623-9830-ce77dcbfd3f1" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTable_f03f793a-3ee1-4631-ae6d-77e4f87ae2f4" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareLineItems_c6ceae00-3a2a-418d-8755-bd424bb20ea7" xlink:to="loc_us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTable_f03f793a-3ee1-4631-ae6d-77e4f87ae2f4" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_CounterpartyNameAxis_1daa8ca6-a1c6-47bb-ba96-88da79986a0b" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_CounterpartyNameAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTable_f03f793a-3ee1-4631-ae6d-77e4f87ae2f4" xlink:to="loc_srt_CounterpartyNameAxis_1daa8ca6-a1c6-47bb-ba96-88da79986a0b" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RepurchaseAgreementCounterpartyNameDomain_1daa8ca6-a1c6-47bb-ba96-88da79986a0b_default" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_RepurchaseAgreementCounterpartyNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_CounterpartyNameAxis_1daa8ca6-a1c6-47bb-ba96-88da79986a0b" xlink:to="loc_srt_RepurchaseAgreementCounterpartyNameDomain_1daa8ca6-a1c6-47bb-ba96-88da79986a0b_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RepurchaseAgreementCounterpartyNameDomain_cbb1d52a-12dc-4896-be08-dbbcb8c2435f" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_RepurchaseAgreementCounterpartyNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_CounterpartyNameAxis_1daa8ca6-a1c6-47bb-ba96-88da79986a0b" xlink:to="loc_srt_RepurchaseAgreementCounterpartyNameDomain_cbb1d52a-12dc-4896-be08-dbbcb8c2435f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_HersheyTrustCompanyMember_ff4b00eb-f969-409a-8c6f-db90a00759c2" xlink:href="hsy-20220703.xsd#hsy_HersheyTrustCompanyMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RepurchaseAgreementCounterpartyNameDomain_cbb1d52a-12dc-4896-be08-dbbcb8c2435f" xlink:to="loc_hsy_HersheyTrustCompanyMember_ff4b00eb-f969-409a-8c6f-db90a00759c2" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementClassOfStockAxis_58ee124f-70cb-48b5-ace6-3a120661a4b7" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StatementClassOfStockAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTable_f03f793a-3ee1-4631-ae6d-77e4f87ae2f4" xlink:to="loc_us-gaap_StatementClassOfStockAxis_58ee124f-70cb-48b5-ace6-3a120661a4b7" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_58ee124f-70cb-48b5-ace6-3a120661a4b7_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementClassOfStockAxis_58ee124f-70cb-48b5-ace6-3a120661a4b7" xlink:to="loc_us-gaap_ClassOfStockDomain_58ee124f-70cb-48b5-ace6-3a120661a4b7_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_3dd7b7cd-02c6-4c16-9621-dac11fc91e1d" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementClassOfStockAxis_58ee124f-70cb-48b5-ace6-3a120661a4b7" xlink:to="loc_us-gaap_ClassOfStockDomain_3dd7b7cd-02c6-4c16-9621-dac11fc91e1d" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonClassBMember_c7968cce-b29d-40d0-939e-9d9e9280befc" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CommonClassBMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_3dd7b7cd-02c6-4c16-9621-dac11fc91e1d" xlink:to="loc_us-gaap_CommonClassBMember_c7968cce-b29d-40d0-939e-9d9e9280befc" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis_5eadf594-8bd1-48e2-b4ab-dc5435e5a1de" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTable_f03f793a-3ee1-4631-ae6d-77e4f87ae2f4" xlink:to="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis_5eadf594-8bd1-48e2-b4ab-dc5435e5a1de" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AntidilutiveSecuritiesNameDomain_5eadf594-8bd1-48e2-b4ab-dc5435e5a1de_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AntidilutiveSecuritiesNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis_5eadf594-8bd1-48e2-b4ab-dc5435e5a1de" xlink:to="loc_us-gaap_AntidilutiveSecuritiesNameDomain_5eadf594-8bd1-48e2-b4ab-dc5435e5a1de_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AntidilutiveSecuritiesNameDomain_cbd206a1-083d-4051-ba11-03ceca79fa52" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AntidilutiveSecuritiesNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis_5eadf594-8bd1-48e2-b4ab-dc5435e5a1de" xlink:to="loc_us-gaap_AntidilutiveSecuritiesNameDomain_cbd206a1-083d-4051-ba11-03ceca79fa52" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeStockOptionMember_4dd7eebe-ad68-4459-882f-437c11dac99e" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EmployeeStockOptionMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AntidilutiveSecuritiesNameDomain_cbd206a1-083d-4051-ba11-03ceca79fa52" xlink:to="loc_us-gaap_EmployeeStockOptionMember_4dd7eebe-ad68-4459-882f-437c11dac99e" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/EARNINGSPERSHARESCHEDULEOFBASICANDDILUTEDEARNINGSPERSHAREDetails" xlink:type="simple" xlink:href="hsy-20220703.xsd#EARNINGSPERSHARESCHEDULEOFBASICANDDILUTEDEARNINGSPERSHAREDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/EARNINGSPERSHARESCHEDULEOFBASICANDDILUTEDEARNINGSPERSHAREDetails" xlink:type="extended" id="i16f06770476246d4914c3cd0c3281312_EARNINGSPERSHARESCHEDULEOFBASICANDDILUTEDEARNINGSPERSHAREDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EarningsPerShareBasicLineItems_5c4b590c-6463-461f-bf78-d2fadadffa9d" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EarningsPerShareBasicLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EarningsPerShareBasicTwoClassMethodAbstract_fa1f20b9-047e-449d-bc8f-a55534ba5c1d" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EarningsPerShareBasicTwoClassMethodAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareBasicLineItems_5c4b590c-6463-461f-bf78-d2fadadffa9d" xlink:to="loc_us-gaap_EarningsPerShareBasicTwoClassMethodAbstract_fa1f20b9-047e-449d-bc8f-a55534ba5c1d" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Dividends_a1b08fe7-c45c-433b-9404-4179ef94605b" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_Dividends"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareBasicTwoClassMethodAbstract_fa1f20b9-047e-449d-bc8f-a55534ba5c1d" xlink:to="loc_us-gaap_Dividends_a1b08fe7-c45c-433b-9404-4179ef94605b" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_UndistributedEarningsLossAllocatedToParticipatingSecuritiesBasic_5f6fd9ca-2c70-4fe7-95e0-8bd0334d083d" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_UndistributedEarningsLossAllocatedToParticipatingSecuritiesBasic"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareBasicTwoClassMethodAbstract_fa1f20b9-047e-449d-bc8f-a55534ba5c1d" xlink:to="loc_us-gaap_UndistributedEarningsLossAllocatedToParticipatingSecuritiesBasic_5f6fd9ca-2c70-4fe7-95e0-8bd0334d083d" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ParticipatingSecuritiesDistributedAndUndistributedEarningsLossBasic_853a1e90-107a-4dec-bfb8-1d4326691430" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ParticipatingSecuritiesDistributedAndUndistributedEarningsLossBasic"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareBasicTwoClassMethodAbstract_fa1f20b9-047e-449d-bc8f-a55534ba5c1d" xlink:to="loc_us-gaap_ParticipatingSecuritiesDistributedAndUndistributedEarningsLossBasic_853a1e90-107a-4dec-bfb8-1d4326691430" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_WeightedAverageNumberOfSharesOutstandingBasic_80996a47-896a-48cb-8527-b57f4ef00856" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_WeightedAverageNumberOfSharesOutstandingBasic"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareBasicTwoClassMethodAbstract_fa1f20b9-047e-449d-bc8f-a55534ba5c1d" xlink:to="loc_us-gaap_WeightedAverageNumberOfSharesOutstandingBasic_80996a47-896a-48cb-8527-b57f4ef00856" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EarningsPerShareBasic_cd7ac672-541c-46c5-8732-c019f6f891f3" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EarningsPerShareBasic"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareBasicTwoClassMethodAbstract_fa1f20b9-047e-449d-bc8f-a55534ba5c1d" xlink:to="loc_us-gaap_EarningsPerShareBasic_cd7ac672-541c-46c5-8732-c019f6f891f3" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EarningsPerShareDilutedTwoClassMethodAbstract_8485c1ea-78ae-4c57-a53d-ca96ff5225b0" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EarningsPerShareDilutedTwoClassMethodAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareBasicLineItems_5c4b590c-6463-461f-bf78-d2fadadffa9d" xlink:to="loc_us-gaap_EarningsPerShareDilutedTwoClassMethodAbstract_8485c1ea-78ae-4c57-a53d-ca96ff5225b0" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DistributedEarnings_f6f0bfe5-b624-4ca2-830a-392e7d184f2a" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DistributedEarnings"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareDilutedTwoClassMethodAbstract_8485c1ea-78ae-4c57-a53d-ca96ff5225b0" xlink:to="loc_us-gaap_DistributedEarnings_f6f0bfe5-b624-4ca2-830a-392e7d184f2a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_UndistributedEarningsLossAllocatedToParticipatingSecuritiesDiluted_a40aadd1-b446-49cc-a4b8-60668cbdaa4c" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_UndistributedEarningsLossAllocatedToParticipatingSecuritiesDiluted"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareDilutedTwoClassMethodAbstract_8485c1ea-78ae-4c57-a53d-ca96ff5225b0" xlink:to="loc_us-gaap_UndistributedEarningsLossAllocatedToParticipatingSecuritiesDiluted_a40aadd1-b446-49cc-a4b8-60668cbdaa4c" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ParticipatingSecuritiesDistributedAndUndistributedEarningsLossDiluted_74691f1a-a207-4b4c-b7bf-eb63db12205b" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ParticipatingSecuritiesDistributedAndUndistributedEarningsLossDiluted"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareDilutedTwoClassMethodAbstract_8485c1ea-78ae-4c57-a53d-ca96ff5225b0" xlink:to="loc_us-gaap_ParticipatingSecuritiesDistributedAndUndistributedEarningsLossDiluted_74691f1a-a207-4b4c-b7bf-eb63db12205b" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_IncrementalCommonSharesAttributabletoDilutiveEffectofConversionofCommonStock_c68b0bc0-491b-4096-a889-ae349726106f" xlink:href="hsy-20220703.xsd#hsy_IncrementalCommonSharesAttributabletoDilutiveEffectofConversionofCommonStock"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareDilutedTwoClassMethodAbstract_8485c1ea-78ae-4c57-a53d-ca96ff5225b0" xlink:to="loc_hsy_IncrementalCommonSharesAttributabletoDilutiveEffectofConversionofCommonStock_c68b0bc0-491b-4096-a889-ae349726106f" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncrementalCommonSharesAttributableToShareBasedPaymentArrangements_08b72519-bcdf-470d-b482-f33625189a09" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncrementalCommonSharesAttributableToShareBasedPaymentArrangements"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareDilutedTwoClassMethodAbstract_8485c1ea-78ae-4c57-a53d-ca96ff5225b0" xlink:to="loc_us-gaap_IncrementalCommonSharesAttributableToShareBasedPaymentArrangements_08b72519-bcdf-470d-b482-f33625189a09" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding_21810f2f-1a24-465d-a403-b60b3b614af7" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareDilutedTwoClassMethodAbstract_8485c1ea-78ae-4c57-a53d-ca96ff5225b0" xlink:to="loc_us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding_21810f2f-1a24-465d-a403-b60b3b614af7" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EarningsPerShareDiluted_3a597ae5-09ab-45f7-9188-34578b17bd95" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EarningsPerShareDiluted"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareDilutedTwoClassMethodAbstract_8485c1ea-78ae-4c57-a53d-ca96ff5225b0" xlink:to="loc_us-gaap_EarningsPerShareDiluted_3a597ae5-09ab-45f7-9188-34578b17bd95" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfEarningsPerShareBasicByCommonClassTable_b7e4b54d-7369-4f8c-b606-b8dd7c3d1659" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfEarningsPerShareBasicByCommonClassTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_EarningsPerShareBasicLineItems_5c4b590c-6463-461f-bf78-d2fadadffa9d" xlink:to="loc_us-gaap_ScheduleOfEarningsPerShareBasicByCommonClassTable_b7e4b54d-7369-4f8c-b606-b8dd7c3d1659" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementClassOfStockAxis_7040aca3-2cd9-46a4-9b64-4e0ce1a5a993" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StatementClassOfStockAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfEarningsPerShareBasicByCommonClassTable_b7e4b54d-7369-4f8c-b606-b8dd7c3d1659" xlink:to="loc_us-gaap_StatementClassOfStockAxis_7040aca3-2cd9-46a4-9b64-4e0ce1a5a993" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_7040aca3-2cd9-46a4-9b64-4e0ce1a5a993_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementClassOfStockAxis_7040aca3-2cd9-46a4-9b64-4e0ce1a5a993" xlink:to="loc_us-gaap_ClassOfStockDomain_7040aca3-2cd9-46a4-9b64-4e0ce1a5a993_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_d4b5efb7-4119-4b7e-aa57-9fced6edb98a" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementClassOfStockAxis_7040aca3-2cd9-46a4-9b64-4e0ce1a5a993" xlink:to="loc_us-gaap_ClassOfStockDomain_d4b5efb7-4119-4b7e-aa57-9fced6edb98a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockMember_a86843df-a3df-4b73-91da-3266b162e69d" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CommonStockMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_d4b5efb7-4119-4b7e-aa57-9fced6edb98a" xlink:to="loc_us-gaap_CommonStockMember_a86843df-a3df-4b73-91da-3266b162e69d" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonClassBMember_4bcdcbd6-a94d-47d0-9a6b-fab03607549f" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CommonClassBMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_d4b5efb7-4119-4b7e-aa57-9fced6edb98a" xlink:to="loc_us-gaap_CommonClassBMember_4bcdcbd6-a94d-47d0-9a6b-fab03607549f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AwardTypeAxis_3427b431-e1fd-4337-8128-0ee0d1c987ae" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AwardTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfEarningsPerShareBasicByCommonClassTable_b7e4b54d-7369-4f8c-b606-b8dd7c3d1659" xlink:to="loc_us-gaap_AwardTypeAxis_3427b431-e1fd-4337-8128-0ee0d1c987ae" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_3427b431-e1fd-4337-8128-0ee0d1c987ae_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AwardTypeAxis_3427b431-e1fd-4337-8128-0ee0d1c987ae" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_3427b431-e1fd-4337-8128-0ee0d1c987ae_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_61a720f4-f954-4efc-bd34-97b4389115f0" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AwardTypeAxis_3427b431-e1fd-4337-8128-0ee0d1c987ae" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_61a720f4-f954-4efc-bd34-97b4389115f0" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeStockOptionMember_70b531da-0c8b-49f2-82d1-b15ea25c6016" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EmployeeStockOptionMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_61a720f4-f954-4efc-bd34-97b4389115f0" xlink:to="loc_us-gaap_EmployeeStockOptionMember_70b531da-0c8b-49f2-82d1-b15ea25c6016" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_PerformanceSharesAndRestrictedStockUnitsRSUMember_1cae7158-41e5-442b-a476-ce33c8771231" xlink:href="hsy-20220703.xsd#hsy_PerformanceSharesAndRestrictedStockUnitsRSUMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_61a720f4-f954-4efc-bd34-97b4389115f0" xlink:to="loc_hsy_PerformanceSharesAndRestrictedStockUnitsRSUMember_1cae7158-41e5-442b-a476-ce33c8771231" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.hersheys.com/role/RELATEDPARTYTRANSACTIONSDetails" xlink:type="simple" xlink:href="hsy-20220703.xsd#RELATEDPARTYTRANSACTIONSDetails"/>
  <link:definitionLink xlink:role="http://www.hersheys.com/role/RELATEDPARTYTRANSACTIONSDetails" xlink:type="extended" id="i60ea0df37c37489bb646c73008b97518_RELATEDPARTYTRANSACTIONSDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RelatedPartyTransactionLineItems_2e8bece6-5e5f-4bf2-bd33-48d8bf89a3f9" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RelatedPartyTransactionLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AreaOfLand_4a0dd962-6053-483f-8296-5e15d5ba2f0b" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AreaOfLand"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RelatedPartyTransactionLineItems_2e8bece6-5e5f-4bf2-bd33-48d8bf89a3f9" xlink:to="loc_us-gaap_AreaOfLand_4a0dd962-6053-483f-8296-5e15d5ba2f0b" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProceedsFromSaleOfPropertyPlantAndEquipment_9654c891-0060-43a0-93c0-6ead20053364" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ProceedsFromSaleOfPropertyPlantAndEquipment"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RelatedPartyTransactionLineItems_2e8bece6-5e5f-4bf2-bd33-48d8bf89a3f9" xlink:to="loc_us-gaap_ProceedsFromSaleOfPropertyPlantAndEquipment_9654c891-0060-43a0-93c0-6ead20053364" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GainLossOnSaleOfProperties_7c84e6c7-ca9a-4734-b000-17c87fe55e1e" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_GainLossOnSaleOfProperties"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RelatedPartyTransactionLineItems_2e8bece6-5e5f-4bf2-bd33-48d8bf89a3f9" xlink:to="loc_us-gaap_GainLossOnSaleOfProperties_7c84e6c7-ca9a-4734-b000-17c87fe55e1e" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfRelatedPartyTransactionsByRelatedPartyTable_e8575956-4155-42a0-bd37-37523a8570b1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfRelatedPartyTransactionsByRelatedPartyTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_RelatedPartyTransactionLineItems_2e8bece6-5e5f-4bf2-bd33-48d8bf89a3f9" xlink:to="loc_us-gaap_ScheduleOfRelatedPartyTransactionsByRelatedPartyTable_e8575956-4155-42a0-bd37-37523a8570b1" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RelatedPartyTransactionsByRelatedPartyAxis_318bbf51-9885-4f9f-8147-99f37889b65e" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RelatedPartyTransactionsByRelatedPartyAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfRelatedPartyTransactionsByRelatedPartyTable_e8575956-4155-42a0-bd37-37523a8570b1" xlink:to="loc_us-gaap_RelatedPartyTransactionsByRelatedPartyAxis_318bbf51-9885-4f9f-8147-99f37889b65e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RelatedPartyDomain_318bbf51-9885-4f9f-8147-99f37889b65e_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RelatedPartyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_RelatedPartyTransactionsByRelatedPartyAxis_318bbf51-9885-4f9f-8147-99f37889b65e" xlink:to="loc_us-gaap_RelatedPartyDomain_318bbf51-9885-4f9f-8147-99f37889b65e_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RelatedPartyDomain_aed7b908-142d-4dc8-8106-4d0293ae407a" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RelatedPartyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_RelatedPartyTransactionsByRelatedPartyAxis_318bbf51-9885-4f9f-8147-99f37889b65e" xlink:to="loc_us-gaap_RelatedPartyDomain_aed7b908-142d-4dc8-8106-4d0293ae407a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_HersheyTrustCompanyMember_cc6b7616-ad8a-4507-843b-70cd63394e0c" xlink:href="hsy-20220703.xsd#hsy_HersheyTrustCompanyMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RelatedPartyDomain_aed7b908-142d-4dc8-8106-4d0293ae407a" xlink:to="loc_hsy_HersheyTrustCompanyMember_cc6b7616-ad8a-4507-843b-70cd63394e0c" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RelatedPartyTransactionAxis_eccc0aae-bf50-471a-93b3-5e1a1a499df3" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RelatedPartyTransactionAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfRelatedPartyTransactionsByRelatedPartyTable_e8575956-4155-42a0-bd37-37523a8570b1" xlink:to="loc_us-gaap_RelatedPartyTransactionAxis_eccc0aae-bf50-471a-93b3-5e1a1a499df3" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RelatedPartyTransactionDomain_eccc0aae-bf50-471a-93b3-5e1a1a499df3_default" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RelatedPartyTransactionDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_RelatedPartyTransactionAxis_eccc0aae-bf50-471a-93b3-5e1a1a499df3" xlink:to="loc_us-gaap_RelatedPartyTransactionDomain_eccc0aae-bf50-471a-93b3-5e1a1a499df3_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RelatedPartyTransactionDomain_31b2abe7-aeae-47dd-bed1-4a9ece1c5f4a" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RelatedPartyTransactionDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_RelatedPartyTransactionAxis_eccc0aae-bf50-471a-93b3-5e1a1a499df3" xlink:to="loc_us-gaap_RelatedPartyTransactionDomain_31b2abe7-aeae-47dd-bed1-4a9ece1c5f4a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_hsy_DonationAgreementMember_810970cb-93fe-4224-8c0f-3cc1bb523602" xlink:href="hsy-20220703.xsd#hsy_DonationAgreementMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RelatedPartyTransactionDomain_31b2abe7-aeae-47dd-bed1-4a9ece1c5f4a" xlink:to="loc_hsy_DonationAgreementMember_810970cb-93fe-4224-8c0f-3cc1bb523602" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://fasb.org/us-gaap/role/eedm/ExtensibleEnumerationLists" xlink:type="simple" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-roles-2021-01-31.xsd#eedm"/>
  <link:definitionLink xlink:role="http://fasb.org/us-gaap/role/eedm/ExtensibleEnumerationLists" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesCurrentAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LiabilitiesCurrentAbstract"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccruedLiabilitiesCurrent" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.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="0"/>
  </link:definitionLink>
</link:linkbase>
