Hannibal is a town in Oswego County, New York, United States. The population was 4,854 at the 2010 census. The name is derived from the hero of ancient Carthage, Hannibal.
The Town of Hannibal also contains a village also called Hannibal. The town is on the west border of the county.
The first settlement occurred around 1802. Much of the region was purchased from the Onondaga and Oneida tribes to form the Central New York Military Tract to pay off war veterans. The town was formed in 1806 from the Town of Lysander while still part of Onondaga County, New York. The name was provided by Robert Harpur, an employee of the New York survey, who is responsible for many of the "classical" names applied to political entities in the central part of New York.
According to the United States Census Bureau, the town has a total area of 44.8 square miles (116.0 km²), of which, 44.8 square miles (116.0 km²) of it is land and 0.04 square miles (0.1 km²) of it (0.04%) is water.
The west town line is the border of Cayuga County, New York.
As of the census of 2000, there were 4,956 people, 1,760 households, and 1,307 families residing in the town. The population density was 110.7 people per square mile (42.7/km²). There were 1,962 housing units at an average density of 43.8 per square mile (16.9/km²). The racial makeup of the town was 98.00% White, 0.22% Black or African American, 0.44% Native American, 0.12% Asian, 0.46% from other races, and 0.75% from two or more races. Hispanic or Latino of any race were 0.89% of the population.