Cáo Xuěqín (1715 or 1724–1763 or 1764) was a Chinese writer during the Qing dynasty. He is best known as the author of Dream of the Red Chamber, one of the Four Great Classical Novels of Chinese literature. His given name was Cáo Zhān (曹霑) and his courtesy name was Mèngruǎn.
Cao Xueqin was born to a Han Chinese clan that was brought into personal service (as booi aha or bondservants of Cigu Niru) to the Manchu royalty in the late 1610s. His ancestors distinguished themselves through military service in the Plain White Banner (正白旗) of the Eight Banners and subsequently held posts as officials which brought both prestige and wealth.
After the Plain White Banner was put under the direct jurisdiction of the Qing emperor, Cao's family began to serve in civil positions of the Imperial Household Department.
During the Kangxi Emperor's reign, the clan's prestige and power reached its height. Cao Xueqin's grandfather, Cao Yin (曹寅), was a childhood playmate to Kangxi while Cao Yin's mother, Lady Sun (孫氏), was Kangxi's wet nurse. Two years after his ascension, Kangxi appointed Cao Xueqin's great-grandfather, Cao Xi (曹璽), as the Commissioner of Imperial Textiles (織造) in Jiangning (present-day Nanjing), and the family relocated there.
When Cao Xi died in 1684, Cao Yin, as Kangxi's personal confidant, took over the post. Cao Yin was one of the era's most prominent men of letters and a keen book collector. Jonathan Spence notes the strong Manchu element in the lives of these Imperial Household bondservants. They balanced the two cultures: Cao Yin took pleasure in horse riding and hunting and Manchu military culture, but was at the same time a sensitive interpreter of Chinese culture to the Manchus. By the early 18th century, the Cao clan had become so rich and influential as to be able to play host four times to the Kangxi Emperor in his six separate itinerant trips south to the Nanjing region. In 1705, the emperor ordered Cao Yin, himself a fluent poet, to compile all surviving shi (lyric poems) from the Tang dynasty, which resulted in The Complete Poems of the Tang.
When Cao Yin died in 1712, Kangxi passed the office over to Cao Yin's only son, Cao Yong (曹顒). Cao Yong died in 1715. Kangxi then allowed the family to adopt a paternal nephew, Cao Fu (曹頫), as Cao Yin's posthumous son to continue in that position. Hence the clan held the office of Imperial Textile Commissioner at Jiangning for three generations.
The family's fortunes lasted until Kangxi's death and the ascension of the Yongzheng Emperor to the throne. Yongzheng severely attacked the family and later confiscated their properties, while Cao Fu was thrown in jail. This was ostensibly for their mismanagement of funds, though perhaps this purge was politically motivated. When Cao Fu was released a year later, the impoverished family was forced to relocate to Beijing. Cao Xueqin, still a young child, lived in poverty with his family.