The Art of War is traditionally attributed to a military general from the late 6th century BC known as Master Sun (Sunzi or Sun-tzu), though its earliest parts probably date to at least 100 years later. Sima Qian's 1st century BC work Records of the Grand Historian (Shiji), the first of China's 24 dynastic histories, records an early Chinese tradition stating that a text on military matters was written by a Sun Wu from the State of Qi, and that this text had been read and studied by King Helü of Wu (r. 514–495 BC). This text was traditionally identified with the received Master Sun's Art of War. The conventional view, which is still widely held in China, was that Sun Wu was a military theorist from the end of the Spring and Autumn period (776–471 BC) who fled his home state of Qi to the southeastern kingdom of Wu, where he is said to have impressed the king with his ability to train even dainty palace ladies in warfare and to have made Wu's armies powerful enough to challenge their western rivals in the state of Chu.
The prominent strategist, poet, and warlord Cao Cao in the early 3rd century AD authored the earliest known commentary to the Art of War. Cao's preface makes clear that he edited the text and removed certain passages, but the extent of his changes were unclear historically. The Art of War appears throughout the bibliographical catalogs of the Chinese dynastic histories, but listings of its divisions and size varied widely. In the early 20th century, the Chinese writer and reformer Liang Qichao, theorized that the text was actually written in the 4th century BC by Sunzi's purported descendant Sun Bin, as a number of historical sources mention a military treatise he wrote.