The Shang dynasty (), also known as the Yin dynasty (), was a Chinese royal dynasty founded by Tang of Shang (Cheng Tang) that ruled in the Yellow River valley in the second millennium BC, traditionally succeeding the Xia dynasty and followed by the Western Zhou dynasty. The classic account of the Shang comes from texts such as the Book of Documents, Bamboo Annals and Records of the Grand Historian. According to the traditional chronology based on calculations made approximately 2,000 years ago by Liu Xin, the Shang ruled from 1766 to 1122 BC, but most recent scholarship has preferred the 16th to 11th centuries BC.
The Shang dynasty is the earliest dynasty of traditional Chinese history firmly supported by archaeological evidence. Excavation at the Ruins of Yin (near modern-day Anyang), which has been identified as the last Shang capital, uncovered eleven major royal tombs and the foundations of palaces and ritual sites, containing weapons of war and remains from both animal and human sacrifices. Tens of thousands of bronze, jade, stone, bone, and ceramic artifacts have been found.
The Anyang site has yielded the earliest known body of Chinese writing, mostly divinations inscribed on oracle bones – turtle shells, ox scapulae, or other bones. More than 20,000 were discovered in the initial scientific excavations during the 1920s and 1930s, and over four times as many have been found since. The inscriptions provide critical insight into many topics from the politics, economy, and religious practices to the art and medicine of this early stage of Chinese civilization.
Many events concerning the Shang dynasty are mentioned in various Chinese classics, including the Book of Documents, the Mencius and the Zuo Zhuan. Working from all the available documents, the Han dynasty historian Sima Qian assembled a sequential account of the Shang dynasty as part of his Records of the Grand Historian. His history describes some events in detail, while in other cases only the name of a king is given.