The Hanlinyuan 翰林院 "Hanlin Academy" (literally: Brush Forest Court) was an institution subordinated to the central government and entrusted with the draft of official documents. It was never consistently organised but was loosely staffed with so-called academicians (Hanlin xueshi 翰林學士). The first literati entrusted with the task to draft official proclamations were sent to the Academy during the reign of Emperor Xuan of the Tang dynasty 唐玄宗 (r. 712-755). From then on the Hanlin Academy became a fixed institution of the imperial central government. The academicians had a various disciplinary background. Some were poets, others experts in the Confucian Classics, some others were actually experts of Daoist techniques or in Buddhist writings, and there were also experts in divination and calligraphy.
Those most highly regarded were literati because they were able to write in a refined and polished language. Normally the task to draft edicts was undertaken by officials in the Palace Secretariat (zhongshusheng 中書省), but especially in the early Tang period 唐 (618-907), Academicians from the North Gate (Beimen 北門) were entrusted with the draft of edicts. Emperor Xuanzong wanted to entrust this important task to real experts and therefore ordered Zhang Yue 張說, Zhang Jiuling 張九齡 and Xu Anzhen 徐安貞 to assign trustworthy experts in literature as Hanlin Academicians. The Academy was located within the palace compound west of the Linde Hall 麟德宮 and thus located nearer to the imperial lodge than the Secretariat. In 738 a new building was constructed where the academicians had to live, the Hanlin xueshi yuan 翰林學士院 and the title of academician became institutionalized. An additional title was gongfeng 供奉 "for court service" or daizhao 待詔 "editorial assistant". The exact number of academicians of that time is not known, but it must have been considerably: In 805 Emperor Shun 唐順宗 805 (r. 805) dismissed all diviners, chess masters and physicians from the Academy, numbering 32 persons. The old Institute of Academicians (xueshiyuan 學士院) lived on in the old place.
The title of "academician" xueshi was a term for duty assignment (chaiqian 差遣) to special posts, and not only for the Hanlin Academy. There were various institutions of the central government in need of academicians, like the Institute for the Advancement of Literature (Hongwenguan 弘文館), the Institute for the Veneration of Worthies (Chongxianguan 崇賢館) or the Academy of Scholary Worthies (Jixianyuan 集賢院). For this reason there were acutally no fixed numbers of offices to be filled, and the academicians appointed to the Academy were not attributed a defined official rank. Each of them brought with him the rank of the previous office and was paid according to the former position. Members of the Secretariat could also be assigned to the Academy. Only somewhat later, a number of six academicians was fixed, with one of them acting as "recipient of edicts" (chengzhi 承旨). During the An Lushan rebellion the position of the Hanlin academicians greatly improved, and some of them were not only used to do the paperwork but were also consulted in politicial matters by the emperor. During the reign of Emperor De 唐德宗 (r. 779-804) academician Lu Zhi 陸贄 had such a high influence on politicial decisions that he was called the "inner Counsellor-in-chief" (neixiang 内相).
The Hanlin Academy and the Imperial Secretariat divided their work. The former mainly took over the draft of important documents about the appointment or dismissal of counsellors-in-chief and other high ministers, the proclamation of amnesties, and imperial commands during military campaigns. These documents of "inner regulation" (neizhi 内制) were written on white hemp paper and were therefore called baima 白麻. The Secretariat took over the draft of documents of minor importance, the so-called "outer regulations" (waizhi 外制). These documents were written on yellow hemp paper and were called huangma 黃麻. Some academicians were entrusted with the task to help the emperor reading or writing documents. These were called Academician Reader-in-waiting (shidu xueshi 侍讀學士) resp. Academician Calligrapher-in-Waiting (shishu xueshi 侍書學士; note: missing in Hucker 1985). The position of the Hanlin academicians became so powerful that Emperor Jing 唐敬宗 (r. 824-826) once planned to replace this institution by a new one. Later on, there were even academic commissionaries (yuanshi 院使) to mediate between the Academy and the emperor. For a short time in the 940s the task of drafting all documents was shifted back to the Secretariat.
The Song dynasty continued the institution of the Hanlin Academy without changing the duties of the six academicians. At some times a seventh academician (yuanwai xueshi 員外學士) could be assigned. As during the Tang period, many an academician rose to a high position, and some counsellors-in-chief were selected from among their ranks. Academicians could be assigned to other duties in other central government agencies, and then obtained the additional title of "drafter" (zhizhigao 知制誥). After the goverment reform of the Xianfeng era 元豐 (1078-1085) the position of Hanlin Academician became a fixed position, with the official rank of 3A. From then on, all drafters were Hanlin Academicians, and vice versa. The number of Academicians was fixed at two. If any additional persons were entrustred with the draft of edicts, they were given the designation of auxiliary Hanlin academician (zhi xueshi yuan 直學士院, shortly zhiyuan 直院)．Auxiliary academicians assigned in case of a vacancy of the two full Academicians were called provisional auxilary Hanlin academicians (quan zhi xueshi yuan 權直學士院, shortly quanzhi 權直), if their original official rank was higher than 3A, the title was provisional Hanlin academician (quan Hanlin xueshi 權翰林學士)． The term Hanlinyuan was, during the Song period, often used for the institute of academicians (xueshiyuan). To make matter even more compilated, there was an Artisans Institute of the Palace Domestic Service also called Hanlinyuan.
During the Yuan period 元 (1279-1368) the Hanlin Academy was retained, but there was also a Mongolian Hanlin Academy (Menggu Hanlin yuan 蒙古翰林院) entrusted with the translation of documents. The task to supervise imperially sponsored publications, especially the dynastic histories, became an ever more important aspect of the Hanlin Academy.
The structure of the Hanlin Academy became more complex from the Ming period 明 (1368-1644) on. At the head was a Chancellor of the Hanlin Academy (Zhangyuan xueshi 掌院學士, rank 5A) supervising an Academician Expositor-in-waiting (shijiang xueshi 侍講學士, rank 6A), an Academician Reader-in-waiting (shidu xueshi, rank 6A), and an hereditary erudite of the Five Classics (shixi wujing boshi 世襲五經博士, rank 8A), as well as several Hanlin bachelors of the six offices of scrutinity (liuke shujishi 六科庶吉士) with or without an official rank. Although the official rank of the academicians was not very high, a post in the Academy could serve as a booster for further career. Academicians were, furthermore, allowed to enter the Wenyuan Hall 文淵閣 to consult secret documents.
The number of Academicians increased considerably under the Qing dynasty 清 (1644-1911). There were two Chancellors (rank 5A), a Manchu and a Chinese, selected from among the Grand Academicians (daxueshi 大學士), the ministers of the six ministries (liubu shangshu 六部尚書) and the vice ministers (shilang 侍郎). There were six Readers-in-waiting (rank 5B) and six Expositors-in-waiting (rank 5B), half staffed by Manchus and half by Chinese; an hereditary erudite of the Court of Imperial Sacrifices (Shengyi taichangsi boshi 聖裔太常寺博士, rank 7A), a position inheritable to the descendants of the third son of Duke Yansheng 衍聖公, a descendant of Confucius; an hereditary erudite of the Five Classics (rank 8A), and Hanlin bachelors of the six offices of scrutinity. The high positions of the Qing period Hanlin Academy were not occupied by professional drafters but were mere honorific posts often occupied by persons concurrently acting in another position. The persons occupying the hereditary positions were also not entrusted with the drafting of documents but instead had to supervise the administration of the national Confucius temples and those of the Song period Neo-Confucian scholar Zhu Xi 朱熹. The offical posts in the Hanlin Academy were thus only vain titles, but titles of high regard. Once obtaining such a title, it would be easy to rise into higher positions in the central government. Persons occupying the lower ranks of the Hanlin Academy were often assigned to positions concurrently serving in the Southern Study (nanshufang xingzou 南書房行走) and thus had easily access to the Emperor or the Crown Prince and had insight and eventually influence on the daily business, or were at least highly estimated by outsiders.