Han Xiangzi, courtesy name Qingfu or Beizhu, is a Chinese mythological figure and one of the Eight Immortals in the Taoist pantheon. He studied Taoist magical arts under the tutelage of Lü Dongbin, another of the Eight Immortals. Han Xiangzi is often depicted carrying a dizi (Chinese flute), so he is also regarded as the patron deity of flutists. He is also believed to be the composer of the Taoist musical piece Tian Hua Yin (天花引).
It is not known if Han Xiangzi existed historically. However, he is believed to be Han Xiang, a grandnephew of Han Yu, a prominent politician, poet and Confucian scholar who lived in the Tang dynasty. There are at least three different accounts about Han Xiang and Han Yu's grandnephew.
Han Yu once dedicated three poems to his grandnephew, Han Xiang, whose courtesy name was "Qingfu". The three poems are Zuo Qian Zhi Languan Shi Zhisun Xiang (左遷至藍關示侄孫湘), and the two-part poem Su Zeng Jiang Kou Shi Zhisun Xiang (宿曾江口示侄孫湘). In 819, during the reign of Emperor Xianzong of Tang, the emperor arranged a grand ceremony for an alleged Buddhist relic to be escorted to the imperial palace in Chang'an and encouraged the people to worship the relic and donate to Buddhist monasteries. Han Yu wrote a memorial to Emperor Xianzong to advise him against doing so, and drew on the example of Emperor Wu of Liang and Hou Jing to caution the emperor. Emperor Xianzong was furious and wanted to execute Han Yu, but eventually pardoned him, demoted him, and sent him out of Chang'an to serve as the Prefect of Chao Prefecture (潮州; present-day Chaozhou, Guangdong). Along the way, Han Yu passed by Lan Pass (藍關; in present-day Lantian County, Xi'an, Shaanxi), where Han Xiang came to join him on his journey. Han Yu wrote the poem Zuo Qian Zhi Languan Shi Zhisun Xiang and dedicated it to Han Xiang.
The historical text New Book of Tang mentioned that Han Yu had a grandnephew, Han Xiang, whose courtesy name was "Beizhu". Han Xiang served as a da li cheng (大理丞), an official in the Ministry of Justice, under the Tang government.
In the miscellany Miscellaneous Morsels from Youyang, Han Yu had an unnamed grandnephew who lived in the Huai River region. He instructed his grandnephew to study Confucian classics in a school, but his grandnephew showed no interest in his studies and bullied his classmates. Han Yu then arranged for his grandnephew to study in a Buddhist school, but the abbot complained that he was defiant and reckless. Han Yu then brought his grandnephew home and scolded him for not spending his time productively. However, his grandnephew claimed that he had the special ability to change the colour of peony flowers, and demonstrated it in front of him. Han Yu was greatly surprised. His grandnephew then returned to the Huai River region and led the rest of his life as a simple commoner.
- 左遷至藍關示侄孫湘 (Zuo Qian Zhi Languan Shi Zhisun Xiang) on Chinese Wikisource.
- (湘字北渚，大理丞。) Xin Tang Shu vol. 73 (1)
- (韓愈侍郎有疏從子侄自江淮來，年甚少，韓令學院中伴子弟，子弟悉為淩辱。韓知之，遂為街西假僧院令讀書，經旬，寺主綱復訴其狂率。韓遽令歸，且責曰：「市肆賤類營衣食，尚有一事長處。汝所為如此，竟作何物？」侄拜謝，徐曰：「某有一藝，恨叔不知。」因指階前牡丹曰：「叔要此花青、紫、黃、赤，唯命也。」韓大奇之，遂給所須試之。乃豎箔曲尺遮牡丹叢，不令人窺。掘窠四面，深及其根，寬容入座。唯賫紫礦、輕粉、朱紅，旦暮治其根。幾七日，乃填坑，白其叔曰：「恨校遲一月。」時冬初也。牡丹本紫，及花發，色白紅歷綠，每朵有一聯詩，字色紫，分明乃是韓出官時詩。一韻曰「雲橫秦嶺家何在，雪擁藍關馬不前」十四字，韓大驚異。侄且辭歸江淮，竟不願仕。) Youyang Zazu ch. 19.
- Duan, Chengshi. Miscellaneous Morsels from Youyang (Youyang Zazu).
- Ouyang, Xiu and Song, Qi. New Book of Tang (Xin Tang Shu).