Datong is one of those Chinese cities that surprises travellers who are willing to leave the most beaten track. In a dry, windy corner of northern Shanxi, near the old frontiers with the steppe, this former imperial capital holds one of the most impressive artistic treasures in all of China: the Yungang Grottoes, a mountain hollowed out by tens of thousands of Buddhas carved into the rock more than fifteen hundred years ago, when Datong was the heart of the Northern Wei kingdom. It is Buddhist art on a colossal scale, comparable to humanity's great rock-cut sites.
But there's more to Datong than Yungang. A few kilometres away, clinging as if by a miracle to a dizzying cliff face, is the Hanging Monastery of Hengshan, a temple suspended in mid-air and one of the most astonishing sights in the country. The city itself, after a controversial and monumental reconstruction of its historic centre, offers walls you can walk along, centuries-old Buddhist temples and the delicate Nine Dragon Wall. All of this makes Datong a fascinating stop between Beijing and the rest of Shanxi.
This guide covers the essentials of Datong with a practical eye: how to plan your visit to the Yungang Grottoes and the Hanging Monastery (both outside the city), what to see inside the walled old town, how to get around, and what you need to know about prices, transport and opening hours. Less crowded than China's big cities and on a more human scale, Datong delivers some of the most memorable moments of a trip through northern China.
Datong owes its greatness to the Northern Wei dynasty, founded by the Tuoba, a people of nomadic (Xianbei) origin who unified northern China in the 4th century. At the beginning of the 5th century they made Datong, then called Pingcheng, their capital, and from there they sponsored an extraordinary flowering of Buddhism: between 460 and 525 the Yungang Grottoes were carved, with tens of thousands of Buddha images cut into the rock, a work that blended Indian, Central Asian and Chinese influences. When the Wei court moved its capital to Luoyang at the end of the 5th century, Datong lost its prominence, but it remained a key frontier stronghold facing the peoples of the steppe. Under the Liao and Jin dynasties (10th to 13th centuries), ruled by northern peoples, it became a secondary capital again, and large Buddhist temples such as Huayan were built. During the Ming dynasty it was strengthened as a military bastion on the northern frontier, with its walls and its proximity to sections of the Great Wall. In recent decades Datong, a coal-mining city, undertook a controversial and ambitious reconstruction of its historic centre. The full story, from the Wei kingdom to the present day, is on our history page.
Read the full history ↓The historic heart of the country, the cradle of civilisation on the banks of the Yellow River: the imperial capitals, the Great Wall, the Buddhist grottoes and the Ming walled city of Pingyao.
Read the history of Northern China →No exact prices: a scale from $ (budget) to $$$$$ (luxury), with 2-3 options per category.
Origins, formation and what the sources say.
Datong's great moment came more than fifteen hundred years ago, in a turbulent era when northern China was fragmented and ruled by peoples of nomadic origin who had come from the steppe. One of those peoples, the Tuoba, of Xianbei ethnicity, managed to unify the north and found the Northern Wei dynasty. At the start of the 5th century, in the year 398, their ruler set up the capital in the city then called Pingcheng, today's Datong, in an arid, strategic corner near the frontier between the Chinese farming world and the nomadic grasslands.
For almost a century, Pingcheng was the centre of a powerful state that ruled over much of northern China. The Tuoba emperors, though of foreign origin, gradually adopted Chinese culture, language and institutions, in a process of sinicisation that would prove decisive for the country's history. The city grew into a great metropolis, with palaces, markets and a cosmopolitan population that mixed Chinese, Xianbei and people from Central Asia who arrived along the trade routes.
It was under the Northern Wei dynasty that Buddhism, which had come from India along the Silk Road, became the dominant religion and the great artistic driving force of the age. The Tuoba emperors embraced the new faith with fervour and used it as a tool of power and legitimacy. From that fusion of imperial patronage, Buddhist devotion and artistic influences arriving from the West came the work that would make Datong immortal: the Yungang Grottoes.
Around the year 460, under imperial patronage, one of the greatest artistic undertakings of ancient China began: the excavation of the Yungang Grottoes, on the outskirts of Pingcheng. According to tradition, the project was driven by the monk Tan Yao, who proposed to the emperor that a series of colossal Buddha images be carved into the rock, partly as an act of devotion and partly as reparation after a period of persecution of Buddhism. The first five great caves, known as the 'Tan Yao caves', house giant Buddhas that, according to some scholars, symbolically represent the first Wei emperors: the ruler thus identified himself with the Buddha, reinforcing his divine authority.
Over the following decades, until around the year 525, dozens more caves and thousands of niches were cut into the sandstone cliff, until there were more than 50,000 statues and images. The Yungang style is a fascinating synthesis: in the carvings you can recognise the influence of the Greco-Buddhist art of Gandhara, with its robe folds and features of Hellenistic origin; Central Asian models that arrived along the Silk Road; and, in the later caves, an increasingly Chinese style, with more slender figures and locally cut garments. That evolution makes Yungang a unique record of how Buddhism gradually became Chinese.
When, in the year 494, Emperor Xiaowen moved the Wei capital further south, to Luoyang, the great building drive at Yungang gradually faded, and the artists continued their work in the new Longmen Grottoes, near the new capital. But what had been carved at Datong remained as an indelible testament to that glorious age. Today the Yungang Grottoes are inscribed on the UNESCO World Heritage List and are considered one of the three great jewels of Buddhist rock art in China, alongside Longmen and Mogao (Dunhuang).
After the Wei capital moved to Luoyang at the end of the 5th century, Pingcheng lost its imperial status and became a frontier stronghold again. Over the following centuries, the city — which would eventually take the name Datong, 'great harmony', under the Liao dynasty — lived to the rhythm of the tensions between the China of the plains and the peoples of the north. Its position, on the passage between the Chinese heartland and the steppes, made it a contested military outpost time and again.
From the 10th to the 13th centuries, northern China was ruled by dynasties of nomadic origin. First the Khitan of the Liao dynasty and then the Jurchen of the Jin dynasty made Datong one of their secondary capitals (a 'western capital'), and under their patronage the city flourished again, above all in religious terms. Some of the most valuable wooden Buddhist temples surviving in China date from this period: the great Huayan Temple, with its imposing hall and exquisite Liao sculptures — among them the famous 'smiling bodhisattva' — and the Shanhua Temple, with its ensemble of Jin-era guardians and deities.
These temples, with their wooden halls joined without nails and their extraordinarily expressive statues, are exceptional testaments to the architecture and art of a time when Datong was ruled by peoples from the north. One curious detail reveals that origin: unlike most Chinese temples, which face south, the Huayan Temple faces east, following the solar beliefs of the Khitan. Datong thus preserves, in stone and wood, the memory of a time when the cultural frontier between China and the steppe ran right past its walls.
With the arrival of the Ming dynasty at the end of the 14th century, Datong regained first-rate strategic importance, though this time mainly military. The Ming, who had driven the Mongols from power in China, were obsessed with the threat of a possible reconquest from the steppes, and they reinforced the entire northern frontier with a formidable defensive system, of which the Great Wall is the most famous part. Datong sat at the centre of that system, as one of the great strongholds guarding the approaches to the Beijing plain.
The city thus became a powerful military fortress, home to garrisons and commanders who watched over the mountain passes and nearby stretches of wall. It was in this period that the great earth-and-brick walls surrounding the town were built, with their towers and monumental gates, giving Datong the silhouette of a frontier bastion that, heavily rebuilt, can still be recognised today. The great Nine Dragon Wall also dates from the early Ming dynasty, built in front of the palace of an imperial prince who held his fief here.
Life on the frontier was hard and often violent: Datong suffered sieges, raids and the constant tension of a no man's land between empires. With the fall of the Ming and the arrival of the Qing dynasty in the 17th century, and above all with Mongolia's definitive incorporation into the empire, the frontier stopped being a line of war and Datong lost part of its military importance, remaining a provincial city in northern Shanxi, rich in coal but far from the great centres of power.
During the 20th century and much of the 21st, Datong was known mainly for a reason far more prosaic than its glorious imperial past: coal. The region is one of China's largest coalfields, and the city became a major mining and industrial centre, with everything that entailed: growth, pollution and an image of a grey, industrial city that had little to do with its thousand-year-old heritage. Mining shaped Datong's economy and landscape for generations.
At the start of the 21st century, however, the local authorities opted for a radical change of course: turning Datong into a tourist and cultural city, building on its extraordinary heritage. The project, pursued with great ambition in the 2010s, included the almost complete reconstruction of the historic walls and large parts of the old town, with the aim of recreating the image of the old fortified imperial city. The operation was enormously expensive and also highly controversial: it meant rehousing tens of thousands of residents and building from scratch monuments of which only remains survived, which led many to speak of a 'stage set' rather than a genuine restoration.
The debate over Datong's reconstruction sums up a tension found throughout China: the one between faithful preservation of heritage and monumental recreation geared towards tourism and identity. Beyond that controversy, the fact is that Datong is attracting travellers again thanks to its truly exceptional treasures — the Yungang Grottoes, the Hanging Monastery, the Liao and Jin temples — which stand apart from any controversy. Today the city is trying to leave behind its image as a mining town and reclaim its role as one of the great historic capitals of northern China.