McLeansboro is a city in Hamilton County, Illinois, United States. The population was 2,675 at the 2020 census.[1] It is the county seat of Hamilton County.[2]