Gunpowder is a major invention that has been essential for warfare for five or more centuries. It is a chemical mixture which burns extremely rapidly, and was used as a propellant in early small arms and cannons. Experiments to improve the effectiveness and safety were some of the first true chemistry. It is a mixture of charcoal, sulfur, and saltpeter (potassium nitrate), ground together. The optimal mixture is 75% saltpeter, 11.5% sulfur, and 13.5% charcoal. Gunpowder is still used today in weapons, fireworks, and special effects.
Gunpowder is a low explosive because it burns rapidly without outside air. It gives off large volumes of gas. In a confined space (as the barrel of a gun) the gases build up enough pressure to push a bullet or shell out the muzzle at high velocity. In firecrackers it is completely enclosed and the gases will cause a small explosion, but gunpowder does not detonate like high explosives; the first high explosives were TNT and dynamite, invented in the 1860s.
Gunpowder was invented in China by about 1100 A.D., and possibly earlier. It was brought to Europe sometime after 1200. The oldest European account of of a formula is in a letter from Francis Bacon to Pope Clement IV in 1267 A.D. By 1275, Albertus Magnus described a formula of four parts saltpeter to one part charcoal and one part sulfur.
When Europeans ground together charcoal, saltpeter, and sulfur they called it "serpentine powder." It easily absorbed moisture, and decomposed into its three parts when bounced around in long trips. It would not not burn if packed too tightly. By 1500 serpentine powder was replaced by corned gunpowder, which was pressed into pellets and screened to a uniform size.
In terms of civilian uses, the technique of gunpowder blasting for mining was first demonstrated by Caspar Weindel at Schemnitz, Lower Hungary in 1627. A hole was drilled behind a rock and a fuze ignited the gunpowder, which broke up the rock. The technique spread across western Europe by the 1660s, greatly facilitating mining operations. In mining gunpowder was replaced by dynamite, invented in the late 1860s by Swedish chemist Alfred Nobel, who endowed the Nobel prizes.
Gunpowder was used as a propellant for rockets, and to propel shot in cannons and naval guns. During the late 14th and early 15th centuries, Chinese gunpowder technology spread to the whole of Southeast Asia via both the overland and maritime routes, long before the arrival of European firearms. The impact of Chinese firearms revolutionized warfare in India and neighboring areas.
Sieges were the primary form of warfare in the Middle Ages in Europe. During the period 1346-1500 cannon complemented catpults in siege warfare; only after 1480 did technical improvements in gunpowder and metallurgy render catapults obsolete. Cannons shooting lead, iron or stone projectiles could knock down a castle's high walls, hence the castle had to be aqbandoned. New fortifications were invented, such as the star shape, such that each wall sloped away from the attacker, reducing the impact of the cannon. One of the main innovators was Italian architect Francesco Di Giorgio, who woked in southern Italy. 
Few technological developments in the history of warfare have been as portentous as the appearance around the turn of the 16th century of effective heavy gunpowder ordnance on shipboard, which began a new era in sea warfare. Employed on Mediterranean war galleys and Portuguese caravels, the weapons marked the solution of a series of daunting technological problems, beginning with the appearance of gunpowder in Europe about 1300. Unlike developments on land, change was at first gradual, but shortly after 1400 the pace of development sharply accelerated to culminate in what may legitimately be termed a revolution in firepower at sea.
Black powder has gradually been superseded in common use by other propellants which provide higher energy density, lack of smoke, or other desirable properties. In the mid-19th century chemists realized that black-powder smoke wasted fuel, reducing muzzle velocity, while a smokeless powder converted all its fuel, allowing for increased velocity of projectiles. Increased velocity was necessary for rapid-fire shells and in battle against ironclad vessels. In 1884, Frenchman Paul Vieille invented smokeless gunpowder.
To obtain maximum effectiveness from the longer barrel on naval guns, the burning rate of the powder needed to be closely controlled. Much experimentation was performed on the effect of size and shape of powder particles on rate of burning, and larger grains were provided for larger guns. Changes in composition were also experimented with, and in the 1880s brown powder made from under-burnt charcoal was adopted as one means of decreasing the burning rate. A serious drawback of these gunpowders was that only about half of the mixture was converted into gas, the remainder becoming a dense smoke. The French in 1886 adopted smokeless powder made of nitrocellulose (gun-cotton). Four years later, the Royal Navy began using smokeless powder made from a nitroglycerine base. Both these compounds liberated four to five times as much energy as did the black powder used earlier. In addition, these chemically homogeneous powders could be formed readily into grains so shaped as to control the rate of burning. This gave a uniform pressure, permitting a higher projectile velocity without straining the gun.
Black powder continued in use as an igniter for the propellant charge, particularly in the larger guns. With later developments, propellants consisting of either nitrocellulose or nitroglycerine were described as "single-base" powder; others containing both were described as "double-base"; and a third category containing nitrocellulose, nitroglycerine, and other chemicals was called "triple-base" or "multiple-base." At the close of the 19th century, the U.S. Navy followed the lead of the French and adopted a nitrocellulose powder as a propellant charge.
This proved reasonably satisfactory until World War II night engagements, when smokeless powder was objectionable because its flash temporarily blinded the ships' crews. Various flash suppressors were devised and mixed with the powder, which was formed into grains for small guns and into pellets for the larger guns. The British used a multiple-based powder, Cordite N, which was relatively flash-free, but which the U.S. Navy considered to be brittle, unduly sensitive to shock, and hazardous in hot climates. As a result the United States developed other flashless powders and was placing one of them, Albanite, in large scale production at the end of World War II.
Despite the adoption of smokeless powder, black powder still continued in use as a burster charge for projectiles until just before World War I, when more powerful and less sensitive explosives were adopted. In the U.S. Navy, trinitrotoluene (TNT) was adopted for smaller projectiles and Explosive D (ammonium picrate) for the larger ones. These continued in use throughout World War II, although by the end of the war more powerful explosives had come into use, particularly in the smaller antiaircraft projectiles. If the entire spectra of powder uses is considered--torpedoes, mines, aerial bombs, and rockets, as well as large and small projectiles--the trend in explosive development, beginning with the adoption of smokeless powder, was to recognize the special demands of various uses and to formulate specialized compounds tailor-made to particular requirements.
- The phrase: "Put your trust in God and keep your powder dry" - or similar - is attributed to Oliver Cromwell.
- Buchanan, Brenda J. ed. Gunpowder: The History of an International Technology, (1996) 430pp excerpt and text search
- Cocroft, Wayne. Dangerous Energy: The Archaeology of Gunpowder and Military Explosives (2000) 222 pages
- Cook Jr., Weston F. The Hundred Years War for Morocco: Gunpowder and the Military Revolution in the Early Modern Muslim World, (1994) online edition
- DeVries, Kelly. Guns and Men in Medieval Europe, 1200-1500 (2002)
- Guilmartin, John F., Jr. "The Earliest Shipboard Gunpowder Ordnanace: an Analysis of its Technical Parameters and Tactical Capabilities." Journal of Military History 2007 71(3): 649-669. Issn: 0899-3718 Fulltext: Ebsco, focus on 14-16th century naval uses
- Guilmartin, John F., Jr. Gunpowder and Galleys: Changing Technology and Mediterranean Warfare at Sea in the 16th Century (2nd ed. 2003).
- Hall, Bert S. Weapons and Warfare in Renaissance Europe: Gunpowder, Technology, and Tactics (1997) 300pp
- Hall, Bert. "Black Powder in the Fifteenth Century," in Weapons and Warfare in Renaissance Europe (1997).
- Kelly, Jack. Gunpowder: Alchemy, Bombards, and Pyrotechnics: The History of the Explosive that Changed the World. (2004). 288 pp. excerpt and text search
- McNeil, William. "The Gunpowder Revolution." MHQ: the Quarterly Journal of Military History 1990 3(1): 8-17. Issn: 1040-5992
- McNeil, William. The Pursuit of Power: Technology, Armed Forces and Society since 1000 AD (1982), has a great deal on gunpowder's role
- Mauskopf, Seymour H. "Gunpowder and the Chemical Revolution." Osiris 1988 4: 93-118. Issn: 0369-7827 Fulltext: in Jstor
- Mauskopf, Seymour H. "Chemistry and Cannon: J.-L. Proust and Gunpowder Analysis," Technology and Culture, Vol. 31, No. 3 (Jul., 1990), pp. 398-426 in JSTOR
- Needham, Joseph and Ho, Ping-yü. Science and Civilization in China. Vol. 5: Chemistry and Chemical Technology. Part 7: Military Technology: The Gunpowder Epic. (1986). 703 pp.
- Norris, John. Early Gunpowder Artillery: C.1300-1600 (2003) 144 pages
- Partington, J. R. A History of Greek Fire and Gunpowder (1960, reprinted 1999) 420pp; standard history, but weak on Arabic and Chinese uses
- Anderson, William. Sketch of the mode of manufacturing gunpowder at the Ishapore mills (1862) full text online
- Michael S. A. Dechert, "The Military Architecture of Francesco Di Giorgio in Southern Italy." Journal of the Society of Architectural Historians 1990 49(2): 161-180. Issn: 0037-9808 Fulltext: in Jstor]
- Guilmartin, "The Earliest Shipboard Gunpowder Ordnanace" (2007)