Datong is a prefecture-level city located in northern Shanxi Province, China. It is situated within the Datong Basin at an elevation of approximately 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 areas of the Pingcheng and Yungang urban districts. The remaining two urban districts, Yunzhou and Xinrong, are not currently conurbated with these primary centers.