Tongli 通歷 "Comprehensive calendar", also called Tongli 通歷 "Comprehensive history" or Tongji 通紀 "Comprehensive annals", is a history of China written by Ma Zong 馬總 (d. 823, courtesy name Huiyuan 會元) and continued by Sun Guangxian 孫 光憲 (900–968, courtesy name Mengwen 孟文, style Baoguangzi 葆光子). Of a total of 15 juan, the first three are missing.
The first ten juan, corresponding to the original text of Ma Zong, began with a description of the rule of the seventeen lords in highest antiquity (taigu shiqi shi 太古十七氏), the Five Emperors and the Three Kings of "middle antiquity" (zhonggu wudi sanwang 中古五帝三王), and end with the foundation of the Tang dynasty 唐 (618-907). Fascicle 4 sets in in the Western Jin period 西晉 (265-316). The text relies heavily on the official dynastic histories Jinshu 晉書, Nanshi 南史 and Beishi 北史 and important history books like Shiliuguo chunqiu 十六國春秋.
For many rulers, the text only notes their moral qualities (xian fou 賢否 "worthy or not") and presents a short biography. Ma Zong added his own comments, but much more often quotes from Yu Shinan's 虞世南 chronicle Diwang lüelun 帝王略論 (lost except the fragments found in the Tongli). The last five fascicles present a history of the Tang dynasty and correspond to Sun Guangxian's supplement Xu tongli 續通歷 that describes the history of the later Tang and the Five Dynasties 五代 (907-960) periods.
Until the Yuan period 元 (1279-1368) this supplementary text was also 10-juan long, but was later arranged in 5 juan and directly attached to Ma Zong's book. The title Tongji originates in Ruan Yuan's 阮元 (1764– 1849) reconstruction of the text in manuscript shape. It is found in Ruan's collectanea Wanwei biecang 宛委別藏.
During the Daoguang reign 道光 (1821-1850) Xu Song 徐松 (1781–1848) guided a project that critically revised the text. It was first published in 1915 by Ye Dehui 葉德輝, but only with 200 paragraphs.
The text of the Tongli can also be found in the collectanea Xuxiu siku quanshu 續修四庫全書.