Han Yu was born in 768,[4] in Heyang (河陽, present day Mengzhou) in Henan to a family of noble lineage.[5] His father worked as a minor official but died when Han Yu was two, who was then raised in the family of his older brother, Han Hui (韓會).[1] He was a student of philosophical writings and confucian thought. His family moved to Chang'an in 774 but was banished to Southern China in 777 because of its association with disgraced minister Yuan Zai. Han Hui died in 781 while serving as a prefect in Guangdong province.[5] In 792, after four attempts, Han Yu passed the jinshiimperial examination. In 796, after failing to secure a position in the civil service at the capital, he went into the service of the provincial military governor of Bianzhou until 799,[1] and then of the military governor of Xuzhou.[6] He gained his first central government position in 802 on the recommendation of the military governor. However, he was soon exiled, seemingly for failing to support the heir apparent's faction (other possible reasons are because of his criticism of the misbehaviour of the emperor's servants or his request for reduction of taxes during a famine).

From 807 to 819 he held a series of posts first in Luoyang and then in Chang'an. During these years, he was strong advocate of reimposing central control over the separatist provinces of the north-east. This period of service came to an end when he wrote his famous Memorial on Bone-relics of the Buddha (諫迎佛骨表) presented to Emperor Xianzong. The memorial is a strongly worded protest against Buddhist influence on the country. The Emperor, offended by Han Yu's criticism, ordered his execution. He was however saved by his friends at the court, and he was demoted and exiled to Chaozhou instead.[7] After Han Yu offered a formal apology to the Emperor a few months later, he was transferred to a province nearer to the capital. Emperor Xianzong died within a year, and his successor Emperor Muzong brought Han Yu back to the capital where he worked in the War Office.[8] He was then appointed to a high-ranking position after he successfully completed a mission to persuade a rebellious military commander to return to the fold.[5]

Han Yu held a number of their distinguished government posts such as the rector of the Imperial university. At the age of fifty-six, Han Yu died in Chang'an on December 25, 824 and was buried on April 21, 825 in the ancestral cemetery at Heyang.[6][9]

Han Yu was an important Confucian intellectual who influenced later generations of Confucian thinkers. He also sponsored many literary figures of the turn of the ninth century. He led a revolt against pianwen (駢文), a formal, richly ornamented literary style, advocating a return to a classical, simple, logical, and exact style.[6] He felt that this classical style of writing—called guwen (古文), literally, "ancient writing"—would be appropriate for the restoration of Confucianism.[10] To him literature and ethics were intertwined, and he advocated the personal assimilation of Confucian values through the Classics, making them part of one's life.[11]

Han Yu promoted Confucianism but was also deeply opposed to Buddhism, a religion that was then popular at the Tang court. In 819, he sent a letter, "Memorial on Bone-relics of the Buddha", to the emperor in which he denounced "the elaborate preparations being made by the state to receive the Buddha's fingerbone, which he called 'a filthy object' and which he said should be 'handed over to the proper officials for destruction by water and fire to eradicate forever its origin'.[7] Han Yu contrasted the Chinese civilization and barbarism where people were "like birds and wild beast or like the barbarians". He considered Buddhism to be of barbarian (夷狄) origin, therefore an unsuitable religion for the Chinese people.[12][13]

Han Yu was also critical of Daoism which he considered to be a harmful accretion to Chinese culture, he nevertheless made the distinction between Daoism which is a home-grown religion and Buddhism as a foreign faith.[12] In "The Origin of Dao" (原道, Yuandao), he argued that the monasticism of both Buddhism and Daoism to be economically non-productive, creating economic and social dislocation. He also criticised both of these beliefs for being unable to deal with social problems.[14] He considered Confucianism to be distinct from these two beliefs in linking the private, moral life of the individual with the public welfare of the state. He emphasised Mencius's method of assuring public morality and social order,[14] and his concept of the expression of Confucian spirituality through political action would later form the intellectual basis for neo-Confucianism.[15]

Han Yu is often considered the greatest master of classical prose in the Tang. He was listed first among the "Eight Great Prose Masters of the Tang and Song" by Ming Dynasty scholar Mao Kun. Together with Liu Zongyuan he headed the Classical Prose Movement to return to the unornamented prose of the Han Dynasty.[16] He considered the classical "old style prose" or guwen to be the kind of writing more suited to argumentation and the expression of ideas.[6] Han Yu's guwen however was not an imitation of ancient prose, but a new style based on the ancient ideals of clarity, concision, and utility.[1] Han Yu wrote in many modes, often with discursiveness and experimental daring.

Amongst his best known essays are his polemics against Buddhism and Daoism and support for Confucianism, such as "Buddhism Memorial on Bone-relics of the Buddha" and "The Origin of Dao". Other notable works include "Text for the Crocodiles" (鱷魚文) in which he declares that crocodiles be formally banished from Chaozhou,[17] and "Goodbye to Penury" (送窮文) that describes his failed attempt to rid himself of the ghost of poverty.[18]

Han Yu also wrote poetry, however, while Han Yu's essays are highly regarded, his poetry is not considered the finest. According to A History of Chinese Literature by Herbert Giles, Han Yu "wrote a large quantity of verse, frequently playful, on an immense variety of subjects, and under his touch the commonplace was often transmuted into wit. Among other pieces there is one on his teeth, which seemed to drop out at regular intervals, so that he could calculate roughly what span of life remained to him. Altogether, his poetry cannot be classed with that of the highest order, unlike his prose writings".[19]

Han Yu ranks among the most important personalities in the history of traditional Chinese culture. His works not only become classics in Chinese literature, but his writings redefined and changed the course of the tradition itself. He was a stylistic innovator in the many genres he wrote in, and was a major influence on the literary and intellectual life of his time as well as later dynasties.[1] The writings of Han Yu would become influential to Song Dynasty writers and poets, in particular Ouyang Xiu who popularized the use of guwen as advocated by Han Yu, a style that would stay as the model for Chinese prose until the revolution in Chinese literature of modern China.[20] In an inscription for a shrine to Han Yu, Song DynastypoetSu Shi praised Han Yu:[21]

His prose reversed the literary decline of eight dynasties, his teachings aided the misguided throughout the world, his loyalty led him to risk the wrath of his master, his courage surpassed the generals of three armies.

— Su Shi, Inscription on Stele for Han Yu's Temple in Chaozhou

All the major accounts of Han Yu's life agree that he had an open and forthright character, which manifested itself in his unswerving loyalty to his friends. According to Li Ao, Han Yu was a great conversationalist and an inspired teacher: "His teaching and his efforts to mold his students were unrelenting, fearing they would not be perfect. Yet he amused them with jokes and with the chanting of poems, so that they were enraptured with his teaching and forgot about returning home".[22] The sense of humor that is so obvious in his writing was also important in his life. Herbert Giles judged that it was "due to his calm and dignified patriotism that the Chinese still keep his memory green".[19]

Han Yu led a defense of Confucianism at a time when Confucian doctrine was in decline, and attacked both Buddhism and Daoism which were then the dominant belief systems. His writings would have a significant influence on Neo-Confucians of later eras, such as the Song dynasty scholars Cheng Yi and Zhu Xi,[14] although he was criticized by Song Confucians for being much more of a stylist than a moralist.[23] Most modern scholarship, although content to assign to Han Yu a secure place in the history of Chinese literature, has been embarrassed by the violence of his Confucian passions.[24]

In honor of Han's contribution to Chaoshan when he was exiled to Chaozhou, the Han River flowing through Chaozhou is named after him. Han Yu Temple (韩文公祠) in Chaozhou was established since the Song dynasty at the riverside of Mount Han, which also named after him.[25]

Erwin von Zach wrote Han Yüs poetische Werke, a German language study. The Poetry of Meng Chiao and Han Yü, a book by Stephen Owen published by the Yale University Press, was the first substantial English-language study of Han Yu. It was published 13 years after Zach's book.[26]

In an essay on Kafka, the Argentinian writer Jorge Luis Borges, in making the argument that "each writer creates his own precursors", placed Han Yu as one of the antecedents of Kafka due to some resemblance between them.[27]

Han Yu's offspring held the title of Wujing Boshi (五經博士; Wǔjīng Bóshì).[28][29]

In 1976, Han Yu was the subject of a high-profile defamation lawsuit in Taiwan called Han Sih-Tao v. Kuo Sho-Hua. In that case, Han Sih-Tao, a 39th-generation direct descendant of the Han Yu, brought a criminal suit against Kuo for writing a defamatory article alleging Han Yu died of a venereal disease because he frequented some houses of ill repute. Many celebrated academic experts on Chinese literature testified as expert witnesses on one side or another. After extensive litigation, Kuo was fined for a token amount (about US$30) for criminal libel.[citation needed]