The Sui dynasty (/swɛɪ/ SWAY) was a Chinese imperial dynasty that ruled from 581 to 618. The re-unification of China proper under the Sui brought the Northern and Southern dynasties era to a close, ending a prolonged period of political division since the War of the Eight Princes. The Sui endeavoured to rebuild the country, re-establishing and reforming many imperial institutions; in so doing, the Sui laid much of the foundation for the subsequent Tang dynasty, who after toppling the Sui would ultimately preside over a new golden age in Chinese history. Often compared to the Qin dynasty (221–206 BC), the Sui likewise unified China after a prolonged period of division, undertook wide-ranging reforms and construction projects to consolidate state power, and collapsed after a brief period.
The dynasty was founded by Yang Jian (Emperor Wen), who had been a member of the military aristocracy that had developed in the northwest during the prolonged period of division. The Sui capital was initially based in Daxing (Chang'an, modern Xi'an), but later moved to Luoyang in 605, which had been re-founded as a planned city. Wen and his successor Emperor Yang undertook various centralising reforms, most notably among them the equal-field system that aimed to reduce economic inequality and improve agricultural productivity, the Five Departments and Six Boards system, which preceded the Three Departments and Six Ministries system, and the standardisation and re-unification of the coinage. The Sui also encouraged the spread of Buddhism throughout the empire. By the dynasty's mid-point, the state experienced considerable prosperity, enjoying a vast agricultural surplus that supported rapid population growth.