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 and is 5 miles (8.0 km) north of the Mason-Dixon line. The town is situated in a productive agricultural region. The population was 15,289 at the 2010 census. The borough is served by the 717 area code and the ZIP Codes of 17331-34. Hanover is named after the German city of Hannover.
The site of the final encounter between the Union and Confederate States armies before they fought against each other in the Battle of Gettysburg during the American Civil War, this borough has since become known as the "Snack Food Capital of the World" due to the establishment of multiple food manufacturing businesses there during the 20th century.
In 1727, John Digges, an Irish nobleman of Prince George's County, Maryland, obtained a grant of 10,000 acres (40 km2) of land where Hanover is now located from Charles Calvert, the fourth Lord Baltimore. The area was called Digges Choice, and in 1730, a group of Catholics started the settlement that became known as the Conewego Settlement. Settlers from both Maryland and Pennsylvania began moving into the area in the 1730s. At this time, Maryland and Pennsylvania did not agree on the northern border of Maryland and the southern border of Pennsylvania, and the area that is now Hanover was in the disputed area claimed by both states. This led to numerous disputes about property ownership from the 1730s until 1760.