Hanover is a borough in York County, Pennsylvania, 19 miles (31 km) southwest of York and 54 miles (87 km) north-northwest of Baltimore, Maryland. The town is situated in a productive agricultural region. The population was 15,289 at the 2010 census. The borough is served by a 717 area code and the Zip Codes of 17331-34. Hanover is named after the German city of Hannover.
Hanover is located at 39°48′26″N 76°59′5″W / 39.80722°N 76.98472°W / 39.80722; -76.98472 (39.807297, -76.984747). Hanover is 5 miles (8.0 km) north of the Mason-Dixon line.
According to the United States Census Bureau, the borough has a total area of 3.7 square miles (9.5 km²), all land.