Sun Xingyan 孫星衍 (1753-1818), courtesy name Yuanhe 淵和, style Boyuan 伯淵, was a mid-Qing period 清 (1644-1911) book collector and bibliographer. He hailed from Yanghu 陽湖 (modern Wujin 武進, Jiangsu), and was a fellow student of Yang Fangcan 楊芳燦 (1753-1815), Hong Liangji 洪亮吉 (1746-1809) and Huang Jingren 黄景仁 (1749-1783).
Sun was admired for his vast knowledge in all fields of scholarliness, so that the writer Yuan Mei 袁枚 (1716-1797) called him "a genius under Heaven" (tianxia qicai 天下奇才). Sun Xingyan earned his jinshi degree in 1787 and became a junior compiler (bianxiu 編修) of the Hanlin Academy 翰林院, as which he took part in the compilation of the Qing supplement of the three Santong 三通 encyclopaedias on statecraft (see Shitong 十通). In 1795 he became a disciple of Cao Jidao 曹濟道 and was soon appointed tax circuit intendant (duliangdao 督粮道) in Shandong, in 1807 he was made administration commissioner (buzhengshi 布政使) of that province. Because of his vast knowledge, Ruan Yuan 阮元 (1764-1849) once invited him to join the Gujing jingshe Academy 詁經精舍 and to teach in the Zhongshan Academy 鍾山書院.
Sun Xingyan was very interested in old texts and traveled a lot to acquire excellent prints, rare texts and books kept secretly (mishu 秘書). He also acquired rubbings of bronze and stone inscriptions and illustrations of ancient bronze vessels. His own books were stored in the Pingjin Library 平津館 where his treasure of literature served for research. He compiled several catalogues, like the Sunshi jiacang shumu 孙氏家藏書目, Lianshiju cang shu mu 廉石居藏書記, Pingjinguan jiancang shuji ji 平津館鑒書籍記, or Citang shumu 詞堂書目.
Sun Xingyan did not only collect books, but also published two important series that include texts based on high-quality Song period 宋 (960-1279) prints. The first is the Dainange congshu 岱南閣叢書 that focuses on critiques to the Confucian Classics, the "masters and philosophers", and books on geography and jurisdictional matters. The second is the Pingjinguan congshu 平津館叢書 that includes many ancient texts on medicine and historiography. For this series, Sun Xingyan selected many books of a high textual quality.
Sun Xingyan was not only a collector but also a scholar who critically studied ancient books and wrote commentaries on them. He wrote the books Shangshu jinguwen zhushu 尚書今古文注疏, Huanyu fangbei lu 寰宇訪碑錄, Zhouyi jijie 周易集解, Kaozhu Chunqiu biedian 考注春秋别典, Erya Guangya xungu yunbian 爾雅廣雅訓詁韻編, Yanzi chunqiu yinyi 晏子春秋音義, Jinshi cuibian 金石萃編, Shiji tianguan shu kaozheng 史記天官書考證, Jianli Fu boshi shimo 建立伏博士始末, Mingtangkao 明堂考, Xu guwenyuan 續古文苑, Pingjinguan wengao 平津館文稿, Fangmao shanren shilu 芳茂山人詩錄, and a critique to the Cangjiepian 倉頡篇.