Emperor Huidi 明惠帝 (1377-1402, r. 1398-1402), personal name Zhu Yunwen 朱允蚊, was the second emperor of the Ming dynasty 明 (1368-1644). He was the second son of Zhu Biao 朱標, Prince Yiwen 懿文太子, a son of Emperor Taizu 明太祖 (the Hongwu Emperor 洪武, r. 1368-1398), the founder of the Ming dynasty, died, When Emperor Taizu died in 1398 Zhu Yunwen was chosen as successor because both his father and his older brother Zhu Xiongying 朱雄英 were already dead. He chose the reign motto Jianwen 建文 "Founding Civilization".
Zhu Yunwen doubted that his accession to the throne would be accepted by all princes and therefore decided to challenge their power, as Minister of War (bingbu shangshu 兵部尚書) Qi Tai 齊泰 and Chamberlain for Ceremonials (taichangqing 太常卿) Huang Zicheng 黃子澄 had suggested. He first demoted Prince Su of Zhou 周王橚, Prince Bo of Qi 齊王博, Prince Xian of Xiang 湘獻王, Prince Jian of Dai 代簡王 and Prince Zhuang of Mei 岷莊王 to commoners, in order to strengthen his own power. Yet in the seventh month of 1399 Prince Di of Yan 燕王棣, residing in modern Beijing, rose in rebellion in order to comply with the "ancestral injunctions" (qing jun ze 清君側), with the campaign for the "pacification of problems" (jingnan 靖難). After four years of fights he was able to enter the capital Nanjing 南京 because the defender Li Jinglong 李景隆 defected. It is said that Zhu Yunwen died in the fire blaze that devoured the imperial palace, but rumours spread that he had escaped in the disguise of a Buddhist monk and lived among the common people, known with the name Monk Yingwen 應文. Accordingly, he was not given a state funeral. Only during the Qing period 清 (1644-1911) he was bestowed the posthumous honorific title of Gongwen Huidi 恭閔惠皇帝. Ming period sources commonly call him the "Jianwen Emperor" 明建文帝. In later generations people appeared claiming descendancy of the Jianwen Emperor.
Zhu Di 朱棣, the Prince of Yan, usurped the throne. He is known to history as Emperor Chengzu 明成祖 (the Yongle Emperor 永樂, r. 1402-1424).