The Shiji 史记 "Records of the [Grand] Scribe" is a very famous universal history of early China and the first of the official dynastic histories (zhengshi 正史). It is the first history of China written in a biographic-thematic style (jizhuanti 纪传体) in which biographies of different type, treatises and tables are combined. The original name of the book was Taishigong shu 太史公书 "The book of the Master Grand Scribe" or Taishiji 太史记 "Records of the Grand Scribe". These titles are derived from the office the two compilers occupied, namely that of the official dynastic court scribes (taishi 太史) of the Former Han dynasty 前汉 (206 BC- 8 AD), Sima Tan 司马谈 (d. ca. 110 BCE) and his son Sima Qian 司马迁 (145-86 BC). Sima Tan who had access to the imperial library and the official documents stored there planned to write a universal history but was not able to finish his work and entrusted the completion to his son.

The Shiji covers a very long time period, ranging from the mythological "Yellow Emperor" Huangdi 黄帝 (trad. r. 2697-2597 BCE), the Xia 夏 (17th-15th cent. BCE, trad. 2205-1766), Shang 商 (17th-11th cent. BCE, trad. 1766-1122), Zhou 周 (11th cent.-221 BCE, trad. 1122-221) and Qin 秦 (221-206 BC) dynasties down to the contemporary period. It ends in the year 93 BCE. The main focus is on the Warring States period 战国 (5th cent.-221 BCE) and the Qin and the Han dynasties.

According to the postface (130 Taishigong zixu 太史公自序), the autobiography of Sima Qian, the book contains 130 juan "scrolls", of which 12 juan are imperial biographies (本纪 benji), ten juan tables (表 biao), eight juan treatises (书 shu), 30juan biographies of the feudal houses of the Zhou period as well as of eminent persons (世家 shijia), and 70 juan normal and collective biographies (列传 liezhuan).

The imperial biographies are internally arranged like annals where the most important events and edicts are recorded. For the oldest periods of time the dynasties are treated in one juan, while from the First Emperor of Qin 秦始皇 (r. 246/221-210 BCE; 6 Qin Shihuang benji 秦始皇本纪) on each person has his/her own imperial biography. Two surprises catch the reader concerning the imperial biographies. Firstly, after the downfall of the Qin dynasty there were several warlords contesting for emperorship. One of them was Liu Bang 刘邦 (Emperor Han Gaozu 汉高祖, r. 206/02-195 BCE), the eventual founder of the Han dynasty, and another was Xiang Yu 项羽, the "hegemonial king of West-Chu" (Xichu bawang 西楚霸王) who at that time was a superior of Liu Bang. Although eventually becoming the loser of the game Xiang Yu is granted an own imperial biography (7 Xiang Yu benji 项羽本纪). This circumstance shows that historiography can also be truthful, as Xiang Yu was the more or less official ruler of China between 206 and 202 BCE (he appointed the various warlords to their royal fiefs), and not Liu Bang, but it also shows that Sima Qian did probably not favour Liu Bang as a person. Another rebel against the Qin dynasty, Chen She 陈涉, is dealt with in a hereditary biography (48Chen She shijia 陈涉世家). Secondly, Emperor Huidi 汉惠帝 (r. 195-188 BCE) is not granted an own imperial biography but his reign is included into the biography of his mother (9 Lü taihou benji 吕太后本纪), the Empress Dowager Lü 吕太后 who, even after her son's death and the subsequent reign of two infant emperors, never ruled officially but was entrusted with the affairs of government as a regent (linchao shezheng 临朝摄政).

The tables provide a lot of information about the genealogies of the feudal lords during the Warring States period, the war between Liu Bang and Xiang Yu for the empire, as well as the various princes, noblemen and highest officials of the early Han dynasty.

The treatises give an overview of the most important matters of statecraft. Most of them served as models for the later dynastic histories, but the treatise of the offerings for Heaven and Earth (28 Fengshan shu 封禅书) are unique because very few emperors undertook the travel to the summit of Mt. Tai 泰山. It occupies a very important place in the Shiji because Emperor Wu 汉武帝 (r. 141-87 BCE) invested a huge state ceremony for this undertaking.

The shijia hereditary biographies are in first instances the chronicles of the feudal states of the Zhou period. Their titles normally include the founder of the feudal house, in most cases the person enfeoffed with the feudal domain at the beginning of the Zhou period. For the feudal state of Qi 齐 two biographies are presented (32Qi Taigong shijia 齐太公世家 and 46 Tian Jingzhong Wan shijia 田敬仲完世家) because the house of Tian usurped the throne of Qi. The chapters 50-52 and 58-60 are the biographies of imperial princes of the Han dynasty. Another category of persons for which hereditary biographies are written are the high ministers serving the Han dynasty in her founding period. Those were Xiao He 萧何, Cao Shen 曹参, Zhang Liang 张良, Chen Ping 陈平, and Zhou Bo 周勃 (chapters 53-57). Another hereditary biography is dedicated to the empresses and their relatives (49 Waiqi shijia 外戚世家). In this chapter Empress Dowager Lü shows up again. Another very important person whose biography is reported in a hereditary biography, isConfucius (47 Kongzi shijia 孔子世家).

The normal biographies are arranged chronologically and are either dedicated to one single person, as for instance that for the mighty minister of Qin, Sima Rangju(64 Sima Rangju liezhuan 司马穰苴列传), or as collective biographies to a group of persons who belong together, like the generals Bai Qi and Wang Jian (73 Bai Qi Wang Jian liezhuan 白起王翦列传) or Mengzi and Xunzi 荀子, both disciples of Confucius (74 Mengzi Xun Qing liezhuan 孟子荀卿列传). The titles of the chapters do not always refer to all persons included, like chapter 63 Laozi Han Fei liezhuan 老子韩非列传 which does not only deal with Laozi and Han Fei also presents the lifes ofZhuangzi 庄子 and Shen Buhai 申不害. Very typical for the Shiji are nevertheless the collective biographies of otherwise not very famous persons. Many of these have been adopted as a model by later dynastic histories, like the collective biography of benevolent officials (119 Xunli liezhuan 循吏列传), that of cruel officials (122 Kuli liezhuan 酷吏列传), or that of the "Forest of scholars" (121 Rulin liezhuan 儒林列传). Yet there are also many collective biographies uniquely to be found in the Shiji, like the assassins (86 Cike liezhuan 刺客列传), the wandering knights (124 Youxia liezhuan 游侠列传), the flatterers (125 Ningxing liezhuan 佞幸列传), the humorists (126Huaji liezhuan 滑稽列传), or the profiteers (129 Huozhi liezhuan 货殖列传). A last group of "biographies" is to be mentioned. This are the descriptions of foreign peoples and foreign countries, genres imitated by all later dynastic histories. These chapters describe the Xiongnu (110 Xiongnu liezhuan 匈奴列传), the Southern (113Nanyue liezhuan 南越列传) and Eastern Yue (114 Dongyue liezhuan 东越列传), the Yi barbarians in the southwest (116 Xinanyi liezhuan 西南夷列传), and the foreign countries of Korea (115 Chaoxian liezhuan 朝鲜列传) and Dayuan (123 Dayuan liezhuan 大宛列传).

For the compilation of the Shiji father and son Sima made use of a vast treasury of sources. For the Spring and Autumn (770-5th cent. BCE) and the Warring states periods they used sources also otherwise known, like the Chunqiu-Zuozhuan 春秋左传 "Zuo Qiuming's commentary to the Spring and Autumn annals", the Guoyu 国语 "Discourses of the states" and Zhanguoce 战国策 "Stratagems of the Warring States", but also sources long since lost, like the Chu-Han chunqiu 楚汉春秋 or theShiben 世本 "Generational records" which is only transmitted in several reconstructed versions. For the contemporary events archival sources were at their disposal.

From the beginning the Shiji was occupied an eminent position in historiography and was read by dozens of generations and imitated by later historians. After the death of Sima Qian it was his relative Yan Yunzu 杨恽祖 who kept the original and helped distributing it. Nevertheless during the Later Han period there were already 10 juan missing. Zhang Yan 张晏 from the Cao-Wei empire 曹魏 (220-265) identified the missing chapters (the biographies of the emperors Jing 汉景帝 and Wu, the treatises on ritual, on music, and one on military [Bingshu 兵书, missing], a table on generals and prime ministers from the beginning of the Han period [Han xing yilai jiangxiang nianbiao 汉兴以来将相年表, missing], and the biographies of the soothsayers [127 Rizhe liezhuan 日者列传], the diviners [128 Guice liezhuan 龟策列传], the biography of Fu Kuan and Jin She [98 Fu Jin liezhuan 傅靳列传], as well as that of the Three Princes [60 Sanwang liezhuan 三王世家]) and found out that they had been supplemented by the late Former Han period historian Chu Suiliang 褚遂良 (courtesy name Shaosun 少孙) and were not originally written by Sima Qian, at least not a part of the chapters. That a part of the missing chapters has indeed been added is clear from the words "Master Chu says" which are inserted in the respective chapters.

Three important commentaries (sanjia zhu 三家注) have been written to the Shiji. These are the Shijie jijie 史记集解 by Pei Yin 裴骃 from the Liu-Song period 刘宋 (420-479), in 80 juan, the Shiji suoyin 史记索隐 by Sima Zhen 司马贞 from the Tang period唐 (618-907), in 30 juan, and the Shiji zhengyi 史记正义 by the Tang period historian Zhang Shoujie 张守节 in 30 juan. Although originally separately written they are normally inserted into the corresponding chapters of the main text. There are some newer commentaries of which the following shall be mentioned: Shiji zhiyi 史记志疑 by the Qing period 清 (1644-1911) scholar Liang Yusheng 梁玉绳, and Shiji huizhu kaozheng 史记会注考证 by the Japanese scholar Takigawa Sukenobu 泷川资言, with a supplement by Mizusawa Toshitada 水泽利忠.

The oldest surviving print was made by the Southern Song period 南宋 (1127-1279) scholar Huang Shanfu 黄善夫. This excellent print served as the origin for the Bona edition 百衲 of the Shangwu yinshuguan press 商务印书馆. Other good printings are the Nanbeijian 南北监 print of the 21 dynastic histories from the Ming period 明 (1368-1644), the print of the 17 dynastic histories by the Jiguge Library 汲古阁, and the print of the 24 dynastic histories from the Wuying Hall 武英殿, the imperial library of the Qing dynasty. In the 19th century the Jinling press 金陵书局 made another print, based on Zhang Wenhu's 张文虎 composition of different editions of the Shiji, based on Qian Taiji's 钱泰吉 revision. This edition contains many printing errors. The Zhonghua press 中华书局 published a modern edition in 1959.