The leishu (Chinese: 類書; literally: "category books") is a genre of reference books historically compiled in China and other countries of the Sinosphere. The term is generally translated as "encyclopedia", although the leishu are quite different from the modern notion of encyclopedia.
The leishu are composed of sometimes lengthy citations from other works, and often contain copies of entire works, not just excerpts. The works are classified by a systematic set of categories, which are further divided into subcategories.Leishu may be considered anthologies, but are encyclopedic in the sense that they may comprise the entire realm of knowledge at the time of compilation.
Approximately 600 leishu were compiled from the early third century until the eighteenth century, of which 200 have survived. The largest leishu ever compiled was the 1408 Yongle Dadian, containing 370 million Chinese characters, and the largest ever printed was the Gujin Tushu Jicheng, containing 100 million characters and 852,408 pages.
The genre first appeared in the early third century. The earliest known was the Huanglan ("Emperor's mirror"). Sponsored by the emperor of Cao Wei, it was compiled around 220, but has since been lost. However, the term leishu was not used until the Song dynasty (960–1279).
In later imperial China dynasties, such as the Ming and Qing, emperors sponsored monumental projects to compile all known human knowledge into a single leishu, in which entire works, rather than excerpts, were copied and classified by category. The largest leishu ever compiled, on the order of the Yongle Emperor of Ming, was the Yongle Dadian containing a total of 370 million Chinese characters. The project involved 2,169 scholars, who worked for four years under general editor Yao Guangxiao. It was completed in 1408, but never printed, as the imperial treasury had run out of money.