The eight-legged essay (bāgǔwén) was a highly structured and rigid essay format central to the imperial civil service examinations during China's Ming and Qing dynasties. Designed to test candidates' deep knowledge of Confucian classics and governmental ideals, it required coherent writing and logical reasoning within its eight distinct sections, such such as "breaking open the topic" and "middle leg."

Originating from earlier rhetorical forms, this style became standardized by the 15th century and was essential for entry into government service, leading to the commercial printing of successful essays as study guides. However, its restrictive nature drew widespread dissatisfaction, with emperors like Qianlong struggling to comprehend them, and critics later accusing it of causing China's "cultural stagnation and economic backwardness." After centuries of prominence, the controversial eight-legged essay was finally abolished in 1905 by the Guangxu Emperor, marking a significant shift in Chinese education and governance.