Hamburg is a town in Erie County, New York, south of Buffalo on the shore of Lake Erie, with a population of 60,085 at the 2020 census. Formed in 1812 and named for Hamburg, Germany, it takes in the villages of Hamburg and Blasdell and covers about 41 square miles between the lake and Eighteen Mile Creek. The Erie County Fair has been held in the town since 1868 on a 275-acre fairgrounds, and by local account the hamburger sandwich was first served at the 1885 fair. Woodlawn Beach State Park and the Seaway Trail along Route 5 run the lakeshore.