Hamilton is a city in Hancock County, Illinois, United States. The population was 2,753 at the 2020 census, a decline from 2,951 in 2010. The city is located directly across the Mississippi River from Keokuk, Iowa. Hamilton is the largest city in Hancock County.