A native of Luoyang, Yuan Zhen was a descendant of Northern Wei's imperial family. He lost his father at the age of seven and moved to Fengxiang (), near today's Baoji, Shaanxi with his mother Lady Zheng (). Yuan began his writings at the age of fifteen. He was a member of Bai Juyi's literary circle and a key figure in the ancient literature revival. He was a friend of Bai Juyi and also of Xue Tao, a courtesan and famous poet who might have been his lover. Bai Juyi and Yuan Zhen made a "Green Mountain pact" to retire together as Taoist recluses once they had accumulated enough funds, but Yuan's untimely death kept them from achieving that dream. In 813, Yuan wrote a grave inscription for Du Fu, which contains some of the earliest known praise for his predecessor's works.