Yuan Hao () (died 529), courtesy name Ziming () was an imperial prince and pretender to the throne of the Chinese/Xianbei dynasty Northern Wei, who briefly received allegiance from most of the provinces south of the Yellow River after he captured the capital Luoyang with support of neighboring Liang Dynasty. He became complacent after capturing Luoyang, however, and when the general Erzhu Rong, who supported Emperor Xiaozhuang, counterattacked later that year, Yuan Hao fled Luoyang and was killed in flight.
Yuan Hao's father Yuan Xiang () was a son of Emperor Xianwen and a younger brother of Emperor Xiaowen, and was created the Prince of Beihai early in Emperor Xiaowen's reign. Yuan Xiang became powerful, as the prime minister, during the reign of Emperor Xiaowen's son Emperor Xuanwu, but was later accused of corruption and stripped of his titles. He died in imprisonment 504, and after his death, although his titles were stripped, Yuan Hao was allowed to inherit the title of Prince of Beihai. His mother's family name was Fan (?), and she was not Yuan Xiang's wife.
Yuan Hao was considered generous and ambitious in his youth. After inhering the title he was made a general, but later was accused of unspecified crimes, and both his general status and his princely title were stripped.
After Emperor Xuanwu's death in 515, his young son Emperor Xiaoming took the throne, and the imperial government was under the successive regencies of Emperor Xiaoming's mother Empress Dowager Hu and Yuan Cha, both of whom openly tolerated corruption. As a result, the empire fell into chaos, with many agrarian rebellions dividing the empire. In 524, while Yuan Cha was regent, Yuan Hao, who was considered military capable, was restored to his princely title and commissioned with an army to fight the forces of the rebel leader Hu Chen (). Yuan Hao enjoyed some early successes, and while he was unable to destroy either Hu Chen or Hu Chen's successor Moqi Chounu (?), he was largely able to hold his own. As a result, he received increasingly great responsibilities. In 527, however, when fellow general Xiao Baoyin's forces were defeated by Mozhe Tiansheng (?), Yuan Hao's forces also collapsed, and he was forced to flee back to Luoyang. In spring 528, Yuan Hao was again commissioned with an army and put into the post of governor of Xiang Province (, roughly modern Handan, Hebei), to defend the region against the rebel leader Ge Rong (), who had by this point taken much of the territory north of the Yellow River and claimed the title of Emperor of Qi.
Less than two months after Yuan Hao was posted to Xiang Province, Emperor Xiaoming and Empress Dowager Hu, who had been restored as regent in 525, were in serious dispute over Emperor Xiaoming's displeasure at Empress Dowager Hu's overtolerance of corruption by her lover Zheng Yan () and Zheng's associate Xu Ge (). Emperor Xiaoming conspired with the general Erzhu Rong to have Erzhu advance on Luoyang to force Empress Dowager to give up power and to kill Zheng and Xu. When this plot was discovered, Empress Dowager Hu poisoned Emperor Xiaoming and installed Yuan Zhao, a young child of an imperial prince, as emperor. Erzhu refused to recognize Yuan Zhao as emperor, and he advanced on Luoyang, capturing and then drowning Empress Dowager Hu and Yuan Zhao in the Yellow River. He made Yuan Hao's cousin Yuan Ziyou the Prince of Changle emperor instead (as Emperor Xiaozhuang). Erzhu subsequently carried out a great massacre of the imperial officials at Heyin (, near Luoyang), and while he subsequently regretted that action, the surviving imperial officials became distrustful of him. He tried to appease other generals and officials who were out in the provinces by promoting them, and Yuan Hao was promoted to a high honorary post as Taifu (, "imperial professor"). Apprehensive of both Erzhu Rong and Ge Rong's power, however, Yuan Hao considered seizing the region around Xiang Province and becoming independent. He tried to commission his uncle Fan Zhun () as the governor of the neighboring Yin Province (, roughly modern Xingtai, Hebei), but this move was resisted by the local officials who suspected his intentions. When he could not receive cooperation from those local officials, he abandoned his army and fled to Liang.
When Yuan Hao met Emperor Wu of Liang, he made an impassioned plea in which he displayed both mournfulness and ambition. Emperor Wu was impressed, and in winter 528 he created Yuan Hao the Prince of Wei, with the intention that Yuan Hao seize the Northern Wei throne and serve as a vassal to Liang. Emperor Wu also commissioned the well-regarded general Chen Qingzhi to escort and support Yuan Hao on his campaign. Chen, however, was only given 7,000 men.
In spring and early summer 529, Liang troops under Chen pushed into Northern Wei territory. Not far away was a large Northern Wei army commanded by the general Yuan Tianmu () the Prince of Shangdang. However, Yuan Tianmu did not consider Yuan Hao a threat, and he instead proceeded to attack another rebel leader, Xing Gao (), who had claimed the title of Prince of Han. Yuan Tianmu and Erzhu Rong's nephew Erzhu Zhao were able to crush Xing and capture him. Meanwhile, however, Chen was able to win battle after battle against Northern Wei generals with much larger forces, and after Chen captured Suiyang, Yuan Hao declared himself emperor there. Chen's army then proceeded to capture Yingyang (, in modern Zhengzhou, Henan), not far from Luoyang, and when Yuan Tianmu, realizing the seriousness of the Yuan Hao threat, advanced on Yingyang, intending to crush Chen's army, Chen defeated him, forcing him to flee. Yuan Hao then approached Luoyang. Emperor Xiaozhuang, fearful of Yuan Hao's army, fled Luoyang north of the Yellow River to rendezvous with Erzhu Rong and Yuan Tianmu. Yuan Hao was welcomed into Luoyang, whose people were resentful of Erzhu Rong and therefore hoped that Yuan Hao could deliver them. Most of the provinces south of the Yellow River also declared allegiance to him, while most of the provinces north of the Yellow River continued to recognize Emperor Xiaozhuang.
Yuan Hao, once he entered Luoyang, became complacent and believed that he was favored by the gods, and therefore grew arrogant and lazy. He put his old friends and associates into high posts, and he spent his days feasting, not caring about the matters of state. The Liang forces escorting him bullied the local populace, and the populace began to turn against Yuan Hao. Meanwhile, Yuan Hao, believing that he had already succeeded, began to secretly plot with Yuan Yu () the Prince of Linhuai and Yuan Yanming () the Prince of Anfeng to consider how to throw off the Liang yoke. When Chen, whose army was badly outnumbered, petitioned Emperor Wu of Liang for reinforcements, Yuan Hao preemptorily petitioned Emperor Wu, arguing that additional Liang troops would merely cause more shock to the Northern Wei people. Emperor Wu therefore stopped sending reinforcements. At one point, Chen considered assassinating Yuan Hao and seizing Luoyang himself, but decided against the idea.
Meanwhile, Erzhu Rong's forces, as well as other forces loyal to Emperor Xiaozhuang, had arrived at the northern bank of the Yellow River opposite Luoyang. When they made exploratory attacks, Chen repelled each one. Erzhu Rong was so frustrated that he considered withdrawing, but after suggestions by the officials Yang Kan () and Gao Daomu () that doing so would only allow Yuan Hao to be entrenched, he prepared a surprise attack at night, crossing the Yellow River and capturing Yuan Hao's son Yuan Guanshou. Yuan Hao's forces subsequently collapsed, and Yuan Hao fled with his guards. Chen tried to withdraw in an orderly fashion, but his forces were trapped by the Songshan River (, east of Luoyang) and crushed. Chen himself was able to flee back to Liang. Meanwhile, Yuan Hao's guards began to desert, and a local policeman of Linyin County (, in modern Luohe, Henan), Jiang Feng (), killed him and delivered his head to Luoyang.
Yuan Hao was never officially recognized as an emperor, although, for reasons unknown, Emperor Xiaowu later restored his title of Prince of Beihai and posthumously honored him with a number of honors.