These are the dynasties in China’s history that contributed to the Great Wall. It’s important to note that other dynasties not listed here did not build or maintain Great Walls.
Before China was unified, the Warring States built many walls to protect themselves from each other.
The Qin Dynasty, Imperial China’s first dynasty (221–206 BC), built the first Great Walls, using many existing walls from the Warring States and destroying others. The Qin Dynasty built a Great Wall of more than 5000 kilometers (3100 miles).
The Han Dynasty (206 BC–AD 220) was involved in extensive wall-building. Their Great Wall was over 7000 kilometers (4300 miles) in length, more than any other dynasty.
The Northern Dynasties, namely the Northern Wei Dynasty (386-535) and the Northern Qi Dynasty (550-577), built extensive Great Walls.
The Sui Dynasty (581–618) built some Great Walls.
The Tang Dynasty (618–907) built city walls but did not build border walls.
The Song Dynasty (960–1279) built some Great Walls.
The Liao Dynasty (907–1125) built city walls and border walls.
The Jin Dynasty (1115–1234) built some Great Walls.
The Yuan Dynasty (1271–1368) built some fortifications but did not build long walls.
The Ming Dynasty (1368–1644) performed extensive city and border wall-building including new construction, and maintained, enlarged, and improved existing walls built in earlier dynasties.
Post-Imperial China (1911–present) rebuilt some wall areas for tourism purposes.
So over China’s history, the Great Wall went through many building periods interspersed with periods of neglect.