Datong is a prefecture-level city located in northern Shanxi Province, China. Situated within the Datong Basin at an elevation of 1,040 metres (3,410 ft), the city serves as a regional hub bordering Inner Mongolia to the north and west, and Hebei to the east.
According to the 2020 census, the city has a population of 3,105,591. Of this total, 1,790,452 residents live within the built-up area, which consists of two of its four urban districts: Pingcheng and Yungang. The remaining two districts, Yunzhou and Xinrong, are not yet conurbated with the main urban center.