Imperial Examination (Keju)
The imperial examination, or keju, selected China's officials by written test for thirteen centuries, replacing aristocracy with scholars.

The imperial examination, known in Chinese as keju, was China's system for choosing government officials through written tests. It lasted roughly thirteen centuries, from 605 to 1905. Each test-taker sat alone in a small brick cubicle, sometimes for three days straight, writing essays on classical Confucian texts. The men who earned the highest degree joined the imperial government and could end up running provinces with populations larger than most European kingdoms. During the Ming dynasty, around one million men entered the qualifying rounds in each cycle, and roughly 300 made it to the top. Britain created its own competitive civil service exams in the 1850s, openly borrowing from the Chinese example.
How the imperial examination worked
Emperor Yang of the Sui dynasty held the first standardized test around 605 and created the jinshi ("presented scholar") degree. The Tang dynasty expanded the system. Under the Song dynasty it became the primary path to government office. The Song also introduced anonymous grading and used the newly available technology of printing to distribute the curriculum more widely.
By the Ming dynasty, the exams followed a fixed structure with three levels. The first was a county test. Men who passed became licentiates, a title that carried local prestige and tax exemptions. The second was a provincial test, given once every three years. Those who passed became juren and could receive government appointments. The third was held in the capital: a metropolitan test followed by a palace test, where the emperor personally ranked the top candidates. The men who survived all three levels received the jinshi title.
The curriculum centered on a small set of texts: the Four Books and Five Classics, read through the lens of Zhu Xi, a Song-era philosopher who lived from 1130 to 1200. Starting in the fifteenth century, answers on these texts had to follow the eight-legged essay format, which demanded a rigid layout with prescribed sections, parallel phrasing, and strict length limits. The government was not trying to train experts in any particular subject. It wanted to shape a large group of men across the country who had absorbed the same books, shared the same ideas about morality, and understood their duties the same way.
The exams consumed entire lifetimes. Men took them again and again, some continuing into their fifties and sixties. The cost of years of preparation gave wealthy families a large advantage. Still, almost any male commoner could sit the test by law, something no European country offered at the time. In some villages, several families would combine their savings over generations to put one talented boy through the years of study he needed.
How the imperial examination held China together
The exam system addressed problems that European countries did not solve until much later. Because every official in the empire had studied the same canon and wrote the same literary language, a bureaucrat transferred from Guangdong to Sichuan could work with colleagues he had never met before. This gave the government a consistency that held across enormous distances. Because the path to power ran through test scores rather than bloodlines, China lost the kind of entrenched noble families that competed with kings across Europe. The system also bought the dynasty loyalty: an ambitious young man who could study his way into a government career had less reason to rebel.
Korea ran a similar system during the Joseon dynasty, and Vietnam did the same. Both countries built governing classes of scholar-officials on this model.
The personal consequences of failing could be extreme. Hong Xiuquan, a village schoolteacher in Guangdong, sat the county exam four times and failed every attempt. After his third failure in 1837, he suffered a mental collapse, later became convinced he was the younger brother of Jesus, and went on to lead the Taiping Rebellion. That war killed an estimated twenty million people.
Why did China abolish the imperial examination?
The exam tested moral reasoning and literary skill. It did not cover mathematics, science, engineering, or any foreign language, and the material had barely changed since the fifteenth century. By the 1800s, foreign powers were arriving with modern weapons and industrial technology, while China was still picking its officials based on how well they could interpret a commentary written six hundred years earlier.
In 1905, the Qing government ended the examination system. The plan was to speed up modernization by sending young men to Western-style schools in China and abroad. The reform backfired. Millions of men who had spent years preparing for the tests were suddenly left with no way to enter government service. The educated gentry, the class that had kept the provinces connected to the central government, no longer had a personal stake in supporting the dynasty. The leaders who followed, Sun Yat-sen and Chiang Kai-shek among them, did not rise through the exam ladder. Mao Zedong was eleven years old when the tests ended. In 1911, six years after the exams ended, the Qing dynasty fell.
How the imperial examination influenced modern civil services
In 1854, a British government report by Stafford Northcote and Charles Trevelyan recommended that the civil service stop filling positions through personal connections and start using open competitive tests. Several members of Parliament said openly that the idea came from China. Britain first applied competitive exams to its Indian Civil Service, then to the home service. The concept that a government should hire based on test results rather than patronage spread from the imperial examination through Britain to much of the modern world.
Inside China, the principle survived the empire. The gaokao, the national university entrance exam, drew about 12.9 million test-takers in 2026. Families structure their children's entire upbringing around it. The Communist Party selects its own officials through competitive tests as well. The belief that the people who lead should be the people who score highest is still central to how China governs.