The term fangshu 方術 (also called fangyi 方技, fangji 方伎, yishu 藝術, shuyi 術藝 or guice 龜策), often translated as "magic", was a means of prognosticating and providing advice concerning the fate of humans or the state. The theoretical framework of magicians was Yin-Yang theory 陰陽 and the concept of the Five Agents (wuxing 五行). They used to observe nature and particularly unusual phenomena and occurrences. In a wider sense, "magic" involved astronomy/astrology, medical treatment, geomancy (kanyu 堪輿), various methods of numerology (e.g. dunjia 遁甲 or liuren 六壬) and even procedures to achieve longevity or "immortality". Fangshu was thus related to a variety of professions and beliefs, such as scientific medicine and astronomy or religious Daoism, and can hardly be separated from occultism and soothsaying, i.e. the determining of auspicious (ji 吉) and inauspicious (xiong 凶) places and moments.
Liu Xie 劉勰 (465-522), author of the literary critique Wenxin diaolong 文心雕龍 (ch. Shuji 書記), explained that fang 方 (direction, method) meant "one corner" (yi yu 一隅) because there were, as in medicine, many different approaches to heal a sick person. The word shu 術 (skill) meant "way" (lu 路) because calculations, as in arithmetics, opened a way for solving difficult questions, but only after detailed operations. Magic arts were thus reserved to specialists, while the "six arts" (liuyi 六藝) could be performed by all male members of the nobility.
The word fangshu, literally meaning "methods and skills", is first mentioned in the Daoist book Zhuangzi 莊子 (ch. Tianxia 天下) which succinctly says that there were "many magicians or kinds of magic" (fangshu zhe duo 方術者多) on earth. Cheng Xuanying 成玄英 (631–655) from the Tang period 唐 (618-907) who commented on the text (Nanhua zhenjing zhushu 南華真經注疏) explained that the word "method" (fang 方) referred to the Way (dao 道) and the expression "methods and skills" (fang shu) to techniques of "mastering the Way" (zhi dao 治道).
The collective biography of magicians (82 Fangshu liezhuan 方術列傳) in the official dynastic history Houhanshu 後漢書 includes experts in oracle by stalks and chips (bushi 卜筮, also called buqian 卜簽), the calculation of astronomical phenomena (yinyang tuibu 陰陽推步), interpreters of magic inscriptions (like the Yellow River Chart and the Inscription of River Luo, "divine scriptures and miraculous books" or "jade instructions and golden threads"), masters in the technique of Jizi 箕子 (Yin-Yang and Five Agents) and the writings of Shi Kuang 師曠 (interpretation of disasters and abnormal phenomena), as well as specialists in apocryphal interpretations (weihou 緯候) and talismanic signs for the army (lingjue zhi fu 鈴決之符).
The number of methods and skills is amazing: the sound of wind (fengjiao 風角), the secret combinations of the ten Celestial Stems (dunjia 遁甲, qimen dunjia 奇門遁甲), the seven celestial bodies (qizheng 七政), "primordial energy" (yuanqi 元氣), the 6 7/80 days-per-hexagram method (liu ri qi fen 六日七分), divination on inauspicious days transformable into auspicious ones (fengzhan 逢占), prognostication by time of occurrence (qike 起課), soothsaying by day (rizhe 日者, also called zeri 擇日 "picking out [auspicious] days"), divination by numinous-herb packages (tingzhuan 挺專), divination by name character strokes (zhezi 拆字), divination by five sounds/agents and cyclical characters (xuyu 須臾) or the solitary-Branches method (guxu 孤虛). Other magicians "inspected the clouds and observed the energies" (wang yun sheng qi 望云省氣) or "tapped all spots in search for demons" (tui chu xiang yao 推處祥妖).
During the Tang period, medical aspects played a much more important role, as can be seen in the Fangshu chapter (ch. 75) of the encyclopaedia Yiwen leiju 藝文類聚. The same is true for the Song-period 宋 (960-1279) encyclopaedia Taiping yulan 太平御覽 (ch. 720-730), which counts nourishing life (yangsheng 養生), medicine (yi 醫), special (bu 卜) and general divination (zhubu 諸卜), divination by stalks and chips (bu shi 卜筮, bu qian 卜簽), divination by inspection (xiang 相, e.g. of the face or the palm, as xiangming 命相 or mingxiang 相命, prognosting fate by prosopomancy), prognostication by weather (zhanhou 占候), the stars (zhanxing 占星), wind (zhanhou 占風), rain (zhanyu 占雨), the observation of "energies" (wangqi 望氣), sorcery (wu 巫), witchcraft (yangu 厭蠱), supplication (zhu 祝, perhaps cursing, zhou 咒), talismans (fu 符), various skills (shu 術), taboos (jin 禁), and illusions huan 幻) into the frame of "magic". Because of its more scientific character, medicine was later taken out.
The art of magic quite probably originated in shamanic or priestly activities which had the aim to interpret "signs" of spirits and deities and adapt to them the activities of political leaders and the society following them. Extraordinary phenomena were interpreted as omina (zhao 兆). The creation of oracles (zhanbu 占卜) in the Neolithic Longshan Culture 龍山 (3200–1850 BCE) and during the Shang period 商 (17th-11th cent. BCE) is one expression of investigating and interpreting the "will" of ancestral spirits. The Shang also began to record and archive this kind of divinatory practice (see oracle bones). The Shang oracle bones record quite a few solar and lunar eclipses or abnormal wind or rain and wrote down when they delivered sacrifices to what supernatural power.
In oldest times, "magic" was found in the persons of "shamans" or mediums (wu 巫 /*C.mro/), who established "connections" to the spiritual world. The Han-period 漢 (206 BCE-220 CE) dictionary Shuowen jiezi 說文解字 explains the word wu as a female person who was able to "serve the unshaped [beings]" (nü neng shi wu xing 女能事無形) and to cause, by way of dancing (wu 舞 /*k.mraʔ/), the spirits to come down. The character 巫 is interpreted as the image of a dancer whose sleeves are moving. Shang-period sources demonstrate that not just professionals used to supplicate the spirits, but also the sovereign. In the ancient cosmos of imagination, politics and religion were one (zheng jiao he yi 政教合一). During the early imperial age, the function of "shamans" or mediums left the political world and entered that of commoners. It was closely connected to religious sacrifices and healing. Wang Wei's 王維 (692-761) poem Liangzhou jiaowai youwang 涼州郊外游望 describes how he observed a female medium summoning the spirits down to the fields.
The Zhou dynasty 周 (11th cent.-221 BCE) believed that Heaven observed the rule of earthly sovereigns and was able to reward or sanction a king (see Heavenly mandate). The observation of the trinity of Heaven, Earth, and Man was an important aspect of prognostication. The inspection of celestial phenomena (xiang 象) and the interpretetation of them was seen as a recognition of "Heaven's will" with regard to the ruling dynasty and the state. The most important method was to divide the celestial sphere into twelve sections (shi'er ci 十二次) whose location was determined by the movements of Jupiter (muxing 木星). Apart from this method, astrologer-astronomers observed the movements of the twenty-eight starry constellations (ershiba xiu 二十八宿, a special reading, see calendar) or "star officials" (xingguan 星官). The four cardinal directions were believed to be dominated by seven constellations and one animal each: the East by the Azure Dragon (canglong 蒼龍), the West by the White Tiger (baihu 白虎), the South by the Crimson Bird (zhuque 朱雀), and the North by the Black Tortoise (wuanwu 玄武).
Against this backdrop, the movements of sun, moon, the five planets, comets, and asteroids were observed, and eclipses of the sun and moon recorded in great detail, in order to find out abnormal signs. The five planets were brought into direct relation with the Five Agents (Jupiter for wood, Mars for fire, Mercury for water, Venus for metal, and Saturn for earth). The most outstanding constellation was "the bewilderer (Mars) guarding the heart (α Scorpii/Antares)" (ying huo shou xin 熒惑守心), a situation expressing great disaster.
Entities of the starry sky were brought into congruence with geographical regions inside the Chinese world. These astronomical sections were called fenye 分野. The starry constellations (xiu 宿 /*suks/) corresponded to earthly provinces (zhou 州 /*tu/, perhaps a wordplay) and their shape (xing 形). The commandery of Yuzhang 豫章 (Tang-period Hongzhou 洪州, today's Nanchang 南昌, Jiangxi), for instance, was influenced by the constellations Ji 翼 and Zhen 軫. The astrological school of geomancy had another approach to perceiving the "will" of supernatural powers than the topographical school, which laid stress on the form of the landscape in order to determine the auspiciousness of a site.
The third realm of observation was the human body (xiang ren 相人). Kuai Tong 蒯通, an advisor of the early Han period, is the first known prosopomancer (telling fortune by appearance of the face). He believed that fate (high or low social standing) was determined by one's bones (gufa 骨法), prosperity by facial complexion (rongse 容色), and success by character or decisiveness (jueduan 決斷).
Even if they were somewhat older, the Yin-Yang and Five-Agents theories came to full development during the Warring States period 戰國 (5th cent.-221 BCE). Parts of the ancient Classics that were compiled during that time therefore include chapters like the Hongfan 洪範 text of the Shangshu 尚書 "Book of Documents" where the Five Agents are described. The Yin-Yang theory is reflected in the binary system of the Yijing 易經 "Classic of Changes". The most prominent master of the Five-Agents theory was Zou Yan 鄒衍 (c. 305-240 BCE) from the regional state of Qi 齊 (today's Shandong). His main proposition was that the world, and in particular the life of a dynasty, was ruled by five agents (often translated as "elements" water, fire, wood, metal, and earth) which emerged from each other or devoured one the other in a kind of cycle. An abnormal phenomenon might thus be a sign of an eventual change in the ruling agent, bringing about political change or natural disasters at least.
Another "school" was the Daoist one, with representatives like the "immortals" (fangxian 方仙, xian 仙, shenxian 神仙) Song Wuji 宋毋忌, Zheng Boqiao 正伯僑, Chong Shang 充尚 or Xianmen Gao 羨門高 who lived in the state of Yan 燕 (around present-day Beijing). They asserted to be able to send their souls out of the body to approach gods and spirits. The two regions of Yan and Qi therefore were seen as the "homeland of magicians". The immortals reported that there were three islands in the Eastern Sea (Bohai 渤海) where immortals were living. Golden palaces were standing on the islands of Penglai 蓬萊, Fangzhang 方丈, and Yingzhou 瀛洲 where the herb of immortality was enclosed in a treasure. Some of the kings of the coastal states of Qi and Yan – King Wei 齊威王 (r. 378-343) and King Xuan of Qi 齊宣王 (r. 342-324) as well as King Zhao of Yan 燕昭王 (r. 311-279) - sent out missions to these islands, but all of them failed.
Most famous is the mission sent out by the First Emperor of Qin 秦始皇帝 (r. 246-210 BCE), headed by Xu Fu 徐巿 (also written 徐福) from Qi. All five hundred persons of the mission, mostly young boys and girls, perished in the ocean. The Emperor also sent out Master Lu 盧生 from Yan in search for Xianmen Gao and Gao Shi 高誓 as well as Han Zhong 韓終 in search for the herb of immortality. Magicians promised the sovereign to create for him an elixir of a marvellous herb (lian yi qi yao 煉以奇藥).
Having conquered the the other regional states, the emperor of Qin took over all experts to serve him in his capital, for instance, the many scholars of the Jixia Academy 稷下 of the state of Qi. The resettled experts did not only include the "various masters" (zhuzi 諸子), but also experts in poetry and rhapsodies (shi fu 詩賦), the numerological skills (shushu 術數), and magicians (fangji 方伎). Qin created a system of "erudites" (boshi 博士), among which also magicians were found.
Apart from the Zhuangzi, the books Hanfeizi 韓非子, Chuci 楚辭 (part Tianwen 天問) and Lüshi chunqiu 呂氏春秋 mention immortals. A fictional journey to a western realm of immortals, Mt. Kunlun 昆侖, is described in the novella Mu Tianzi zhuan 穆天子傳.
More than a hundred years later, Emperor Wu 漢武帝 (r. 141-87 BCE) of the Han dynasty sent out a similar mission in the search for Penglai. He had been motivated by a memorandum submitted to the throne, in which it was said that as much as ten thousand persons had become immortals, among them magicians like Li Shaojun 李少君, Shao Weng 少翁, Luan Da 欒大 or Gongsun Qing 公孫卿. In 89 BCE, Tian Qianqiu 田千秋 (d. 77 BCE) urged Emperor Wu to abstain from such futile missions. The sovereign nonetheless continued his belief in immortality and hoped to find a true immortal one day who might help him. A few decades later, Kuang Heng 匡衡 had to stop Emperor Cheng's 漢成帝 (r. 33-7 BCE) attempts to gain immortality. Emperor Ai 漢哀帝 (r. 7-1 BCE), frequently lying on the sickbed, ordered countless times to deliver sacrifices to the spirits and to search for means to cure him.
In a wider sense, the many cases of witchcraft and sorcery (wugu 巫蠱) of the time might also be counted into the wide frame of fangshu. Some magicians took part in machinations at the imperial court and even influence the succession to the throne. Yet in general, the family of the emperor employed magicians as healers and prayers. As "floating clerical underclasses", sorcerers disturbed social life even in late imperial times (Kuhn 1990).
During the time of Emperor Wu, a unison was created between the Five-Agents "magicians" and the Confucian classicists, who had gained the status as representatives of the state ideology. The scholar Dong Zhongshu 董仲舒 (179-104 BCE) merged the two belief systems and contributed to a new trend in the interpretation of the Confucian texts which laid stress on omina and portents. This was the so-called apocryphal school (chenwei 讖緯). The usurper Wang Mang 王莽 (45 BCE-23 CE), who made an end to the Former Han dynasty 前漢 (206 BCE-8 CE), and Emperor Guangwu 漢光武帝 (r. 25-57 CE), who re-founded it as the Eastern or Later Han 後漢 (25-220 CE), made use of ominous incidents to legitimate their rule as announced and desired by supernatural powers.
Apocryphal scriptures were a magic-related phenomenon particularly popular during the Han period. The term chenwei is a composition of two elements, namely chen 讖, which were objects, phenomena or texts of "divine evidence" (shenyan 神驗), and wei 緯 "wefts", which were para-interpretations of the Classics "warps" (jing 經) with relation to contemporary events. Both demonstrated the interference of Heaven into politics and even dynastic succession. Examples for "divine evidence" were foxes announcing the accession of a pretender to the throne, texts written on silk strips found in the belly of a fish, inscriptions found on a stone, or children gangs heralding someone as a future ruler. Forged "signs of Heaven" were used throughout history.
Philosophers of the age like Dong Zhongshu believed to have found evidence that man was a natural tool of Heaven (tian ren gan ying 天人感應 "Heaven and man interact with each other"): The Five Agents were reflected in the five intestines, and the four seasons by the four limbs. With the help of Dong Zhongshu's book Chunqiu fanlu, the Han emperors systematized and "officialized" (guanfanghua 官方化, Zhang 1998: 856) this kind of correlative thinking. Because this trend led to a hypertrophy in apocryphal texts, talismans and signs (tuchen 圖讖), Emperor Guangwu fixed a number of officially recognized texts to be taught at the National University (taixue 太學). Apart from this number of 81 official texts of "Celestial revelations", all others were deemed illegal. The official or legal ones among the apocryphal texts were deemed a curriculum of "esoteric [i.e. core] teachings" (neixue 內學), in contrast to the "exoteric [i.e. less important] teachings" (waixue 外學) of the traditional interpretations of the Classics canon.
The bibliographical chapter Yiwen zhi 藝文志 of the official dynastic history Hanshu 漢書 is based on a late Former Han-period catalogue of books in the imperial library. It includes quite a few books of "magic arts" which are separated from the more philosophical and politico-strategical "masters" (zhuzi), with the exception of Yin-Yang masters (yinyangjia 陰陽家) which are found right among the thinkers and strategists. The bibliography includes 21 books on astronomy (tianwen 天文), 18 on calendric issues (lipu 曆譜), 31 on the Five Agents (wuxing 五行), 15 on classical divination by tortoise shells (shigui 蓍龜), 18 texts on various types of divination (zazhan 雜占), 6 books on geomancy and prognostication by the inspection of objects (xingfa 形法) which makes a total of 190 texts of the "numerological skills" (shushu 數術).
The term shushu 術數 or shushu 術數 refers to the "skill of life numbers", meaning that a magician was able to find out or operate with someone's personal number(s) of fate (qishu 氣數) or that of a dynasty. This was believed to be possible with the help of the systematic and skilled use of information like Yin and Yang, and the transformation of the Five Agents. The technique involved professional skills like astrology-astronomy (tianwen 天文), day books (lipu 歷譜), the Five-Agents theory, divination with milfoil and bones (shi gui 蓍龜), various modes of prognostication (zazhan 雜占) or geomancy (xingfa 形法). The bibliographical chapter Yiwen zhi in the Hanshu explains that experts in the various numerological techniques originated in the (sacral?) functionaries of the Bright Hall (Mingtang 明堂), the astrologers (xihe 羲和, see Xi He), the Grand Astrologer (shi 史, i.e. taishi 太史), and the Grand Diviner (bu 卜, i.e. taibu 太卜).
The medical classic Huangdi neijing 黃帝內經 (part Suwen 素問, ch. Shanggu tianzhen lun 上古天真論) says that in ancient times those among the people who "did know the Way" (qi zhi dao zhe 其知道者) made use of Yin and Yang as the standard for their calculations (fa yu yinyang 法于陰陽) and harmonized their techniques to numerological skills (he yu shushu 和于術數). How important numerological or divinatory skills were in the political business can be seen in the ennoblement of magicians like Wu Fan 吳范 (d. 226) or Zhao Da 趙達 during the Three Empires period 三國 (220~280 CE).
A further belief prevalent during the Han period was the so-called Huang-Lao thought 黃老, called so because it asserted to go back to the Yellow Emperor (Huang Di 黃帝) and Laozi 老子, the putative founder of Daoism. Huang-Lao thought was merged with tenets and beliefs of early Buddhism (Buddha as Futu 浮屠) as it came to China. In this form, Huang-Lao belief did not just focus on the healing of illness and disease, but also interpreted "signs and orders" (fuming 符命) of Heaven as expressed in natural disasters or abnormal appearances, and included prayer ceremonies for health, rain and prosperity, or against the retribution of sins. During the reign of Emperor Shun 漢順帝 (r. 125-144), Gong Chong 宮崇 submitted to the emperor a "spiritual scripture" (shenshu 神書) that his teacher Yu Ji 于吉 (d. 200) had discovered, the Taiping qingling shu 太平清領書 "Scripture of the Great Peace with blue-green headings" which was the basis for the Daoist writing Taipingjing 太平經. During the late Eastern Han period, many Daoist scriptures were "discovered" and led to the foundation of Daoist schools and movements, some of them of rebellious nature, as the independent kingdom of Zhang Jiao 張角 (d. 184 CE).
Formerly being part of the imperial court, the magicians had evolved as skilled persons who operated in the broad society. Some of them became the founding fathers of important religious trends, like the Heavenly Masters School (tianshi dao 天師道) or the School of Great Peace (taiping dao 太平道).
During the Three Empires period, many magic skills were in fact part of Daoist methods, as for instance, practiced by Zuo Ci 左慈 (156?-289). The word fangshi therefore was more or less identical to daoshi 道士 "Daoist practitioner". Yet the word might also refer to a physician, as can be seen in the Huangdi neijing (part Suwen, ch. Wuzang bielun 五藏別論). Wang Bing 王冰 comments that a fangshi 方士 was someone who had a deep understanding of methods and skills (ming wu fang shu 明悟方術).
Some of the Later Han-period magicians were students of the Confucian Classics, like Tang Yun 唐枟, who analysed them with regard to statements on abnormal phenomena, or Gong Shamu 公沙穆, who was inspired by the metaphysical interpretation of the Gongyang Commentary 公羊傳 and therefore attracted numerous visitors in his lodge on Mt. Donglai 東萊山, or Dong Fu 董扶, who had studied the apocryphal texts at the National University, but refused to instruct politicians. Guo Yu 郭玉 venerated master Cheng Gao 程高, who knew to heal people with the help of acupuncture and pulse diagnostics and wrote the books Zhenjing 針經 and Zhenmaifa 診脈法.
In the search for "immortality", Daoist masters contributed to the emergence of medicinal and chemical knowledge, for instance, for the preparation of immortality pills with the technique of "outer alchemy" (waidan 外丹), or the analysis and control of flows of vital breath (qi 氣) inside the body as part of "inner alchemy" (neidan 內丹). Magicians analysing the starry sky contributed substantially to astronomy and the development and refining of the Chinese calendar.
The concept of qi is described in late Warring-States period sources like the Daoist book Laozi which explains that "the then thousand being shoulder Yin and embrace Yang; they move the breath/energy to create harmony" (wanwu fu yin re bao yang, chong qi yi wei he 萬物負陰而抱陽，沖氣以為和). With regard to the human body, qi might be translated as vitality. "Moving the vitality" corresponds to the modern expression qigong 氣功 (Chi Gong). It is one of a wide range of Daoist practices to strengthen physical health and prolong life, such as exhaling and inhaling (tuna 吐納), "embryonic breathing" (taixi 胎息), "inner contemplation" (neishi 內視), gymastics (daoyin 導引), nourishing life (xiuyang 修養) and the art of the bedchamber (fangzhong shu 房中術) as disciplines of inner alchemy, and abstention from grains (bigu 辟榖), pharmacology (jin-shi-yao 金石藥), ingestion and diet (fu'er 服餌) as disciplines of outer alchemy.
With regard to qi, the Huangdi neijing (part Suwen) explains that man comes into life by the vitality (qi) of Heaven and Earth, and finds perfection by the rules of the four seasons. The activation of qi is thus seen as a means to get into relationship with Heaven. The book Baopuzi 抱朴子 holds that who is able to circulate qi well will nourish his life inside and dispell evil influences outside. The magical aspect is not just the power given by activating qi, but the non-physical character of it: Exhaling qi does not move a feather put just before the mouth or the nose. This is why the Daoist magicians compared their kind of respiration with that of an embryo, who does not breathe air. In a popular form the activation of qi was (and is) performed by gymnastics and breathing techniques.
Near to all of the official dynastic histories, and many other history books, include collective biographies of magicians: Shiji 史記 (128 Guice zhuan 龜策傳), Houhanshu (82 Fangshu zhuan 方術傳), Sanguozhi 三國志 (29 Fangji zhuan 方技傳), Jinshu 晉書 (95 Yishu zhuan 藝術傳), Weishu 魏書 (91 Yishu zhuan 術藝傳), Beiqishu 北齊書 (49 Fangji zhuan 方伎傳), Zhoushu 周書 (47 Yishu zhuan 藝術傳), Beishi 北史 (89-90 Yishu zhuan 藝術傳), Suishu 隋書 (78 Yishu zhuan 藝術傳), Jiutangshu 舊唐書 (191 Fangji zhuan 方伎傳), Xintangshu 新唐書 (204 Fangji zhuan 方技傳), Songshi 宋史 (461-462 Fangji zhuan 方技傳), Liaoshi 遼史 (108 Fangji zhuan 方技傳), Yuanshi 元史 (203 Fangji zhuan 方技傳), Mingshi 明史 (299 Fangji zhuan 方技傳), Qingshigao 清史稿 (502-505 Yishu zhuan 藝術傳), and Xinyuanshi 新元史 (242 Fangji zhuan 方技傳). Yet the last few among these collective biographies include physicians, artists and technicians rather than "magicians" in the old sense.
An anonymous collective biography of magicians, Fangshizhuan 方士傳, was circulating between the Han and the Tang periods. Only a few quotations survive which show that Zou Yan was one of the central figures in the book.
The word fangshi also denoted an office during the Western Zhou period 西周 (11th cent.-770 BCE). The ritual Classic Zhouli 周禮 (part Qiuguan 秋官, ch. Fangshi 方士) explains that this "master of the regions" was a kind of justiciar in the domains of the royal princes, dukes, ministers and grand masters (du jia 都家).