Gunpowder was invented by Taoist alchemists in China during the Tang Dynasty. While the name of the actual inventor is unknown, an alchemist named Wei Boyang wrote a book detailing the experiments. The alchemists first mixed saltpeter and sulfur with charcoal to creating gunpowder in the eighth century C.E.
Other sources give a slightly different time line, stating that gunpowder was invented by the alchemists during the ninth century, instead of the eighth. The earliest known written formula for gunpowder dates back to the Song Dynasty during the 1000s. During the 1200s, the Mongol conquests spread knowledge of gunpowder throughout Eurasia, and its use as a weapon began to take root.