Hershey is located in southeastern Dauphin County, in the center and eastern parts of Derry Township.
According to the U.S. Census Bureau, the Hershey CDP has a total area of , of which is land and , or 0.41%, is water [REF].