The Fangyan 方言 is a topolect dictionary of the languages of Han period 漢 (206 BCE-220 CE) China. It was written by the late Former Han period 前漢 (206 BCE-8 CE) scholar Yang Xiong 揚雄. Its full title is Youxuan da shizhe juedai yushi bieguo fangyan 輶軒大使者絕代語釋別國方言. From the title it becomes evident that it was written as a manual for representants of the imperial court to the various regions of the empire to have an easier access to the local languages. It is 13 juan "scrolls" long. The catalogue of the imperial library and Yang Xiong's biography, both included in the official dynastic historyHanshu 漢書, do not mention the Fangyan. Traditional scholars therefore saw the Fangyan as a forgery of later date. It is known yet that there were similar collections on local languages (topolects) during the Qin 秦 (221-206 BCE) and Han periods, a base upon which Yang Xiong could have compiled his dictionary. The Fangyan contains information about the topolects of China's regions, which are called with the traditional names like Qin 秦 (Shaanxi), Jin 晉 (Shanxi), Qi 齊 (Shandong), Song 宋 (Henan), Yan 燕 (Hebei), Chu 楚 (Hebei, Henan) and so on, but also of the Non-Chinese population in the south. The lexemes of the Fangyan are arranged in glossary groups. For each entry it is explained if a word is commonly used throughout the empire (tongyu 通語) or only in certain regions. A special group of words are characterised as "transmitted words" (zhuanyu 轉語) if the original pronunciation of the character has changed by its transmission through time or from one region to the other. The author of the Fangyan does not mention his sources nor is he concerned about the characters by which the word he quotes are written down. The Fangyan is a momentaneous picture of the linguistic situation of China during the mid-Han period.
During the Eastern Jin 東晉 (317-420) period Guo Pu 郭璞 wrote a commentary, the Fangyan zhu 方言注. It is included in the collectaneumSibu congkan 四部叢刊. It is very interesting for scholars of ancient Chinese phonology to see how the sound had changed from the 1st cent. BCE to the 4th century, an observation which already Guo Pu experienced in his study of the Fangyan. Guo Pu renders information if a certain topolect word still existed in his times or had appeared during the past centuries. All recent version are based on Guo Pu's copy which probably differed from Yang Xiong's original (Guo Pu speaks of 15 juan, and his version contains almost 2,000 characters more than the Han period original).
During the Qing period 清 (1644-1911) the scholar Dai Zhen 戴震 wrote the commentary Fangyan shuzheng 方言疏證. It is included in the collectaneum Siku quanshu 四庫全書. Dai Zhen revised the errors that had crept into the various Fangyan manuscripts. He made use of the Ming period 明 (1368-1644) print version included in the encyclopediaYongle dadian 永樂大典 and looked for quotations from the Fangyan and Guo Pu's Fangyan zhu in other sources. Wang Niansun 王念孫 later added and revised some points Dai Zhen had overlooked and published his commentary Fangyan shuzheng bu 方言疏證補. Qian Yi 錢繹 wrote the commentary Fangyan jianshu 方言箋疏. This commentary is a philologically very rich book which quotes a vast amount of contemporary literature. Yet it neglects the fact that the Fangyan is a momentary record of Han period language and not a language grammar of ancient Chinese.
The first print of the was made for the Directorate of Education (guozijian 國子監) during the Northern Song period 北宋 (960-1126). There are also contemporary prints from Sichuan, Jiangxi and Fujian. Only a print from 1200, made in Jiujiang, modern Jiangxi, has survived.

There is a Xu fangyan 續方言 "Continued Fangyan" written by the Qing period scholar Hang Shijun 杭世駿, in 2 juan. It is included in the collectaneum Yihai zuchen 藝海珠塵.