McHenry is a city in McHenry County, Illinois, United States. At the 2005 census, the city population was 24,631. McHenry was at one time the county seat of McHenry County. McHenry was named for Major William McHenry, an old Indian fighter. McHenry is located northwest of Chicago in northern Illinois on the Fox River.