Elgin () is a city in Illinois in the United States. It is roughly northwest of Chicago on the Fox River. Most of Elgin lies within Kane County, Illinois, with a portion in Cook County, Illinois. As of the 2010 census, the city had a total population of 108,188. It is the eighth-largest city in Illinois and the 241st largest city in the United States. It is part of the Chicago metropolitan area.