Cao Huan, ch.曹奐, py. cáo hùan, wg. Ts'ao-Huan (between 245 and 247-303) was a grandson of Cao Pi and last emperor of the Kingdom of Wei. He is also known as the Emperor Yuan of Wei, ch. 魏元帝, py. wèi yúan dì, wg. Wei Yüan_ti.
His fatherCao Yu (曹宇) was the Prince of Yan and one of the youngest sons of CaoCao, the father of Cao Wei's first emperor, Cao Pi (Emperor Wen), who was considered (but ultimately rejected) as regent for the emperor Cao Fang by Cao Fang's father, Cao Rui (Emperor Ming), in 238.
Sima Yan (Emperor Wu of Jin) permitted CaoHuan to retain imperial banners and wagons and to worship ancestors with imperial ceremonies.
Wei: CaoCao - Cao Pi - Cao Rui - Cao Fang - Cao Mao - CaoHuan
According to the Chronicles of the Three Kingdoms, Cao Zhen was a distant nephew of CaoCao.
In 190, when CaoCao was raising an army to join the coalition against Dong Zhuo, the tyrannical warlord who held Emperor Xian hostage, Cao Zhen's fatherCao Shao heeded the call but was killed before he could join CaoCao.
In 195, as CaoCao was fleeing from rebels, he hid in the Qin's.