Elgin is a city in Grant County, North Dakota, United States. The population was 642 at the 2010 census.