Gunpowder is an explosive material traditionally made of sulfur, charcoal, and potassium nitrate or saltpeter. It is used in fireworks and was once used as a propellant in firearms, though nowadays, a different kind of gunpowder is more common. Since the original recipe for gunpowder, also called black powder, released a lot of smoke when it exploded, a smokeless powder consisting of nitrocellulose and nitroglycerin is now preferred for use in most firearms.
Gunpowder is an ideal explosive for firearms because it is a low explosive, powerful enough to expel a bullet but not to damage the gun. It was developed in China in the 9th century by Taoist monks or alchemists seeking an elixir of life, and the Chinese soon adapted its use to the first firearms. Europe and the Middle East both acquired gunpowder by the 13th century and began manufacturing cannons. Another important use of gunpowder, fireworks, were developed in China in the 12th century as a means of frightening evil spirits, and by the 17th century, they were a common form of entertainment in Europe.
In the late 14th century, Europeans began "corning" gunpowder by mixing it with liquid and shaping it into small granules or corns. This process improved the consistency of gunpowder, which otherwise tended to separate into its component parts and become unusable, and reduced dust. It also allowed the gunpowder to burn and explode more uniformly, as before corning, gunpowder far from the flame would often be expelled from the gun before it ignited.
Despite the important innovation of corning, traditional gunpowder still presented a problem in that it smoked heavily when ignited, causing visibility problems on the battlefield. The first smokeless powder, called guncotton, was invented in 1846 by Swiss chemist Christian Friedrich Schönbein. This original smokeless powder was unstable and dangerous, however, and viable smokeless powders were not developed until the 1880s.
The first successful smokeless powder was Poudre B, developed in 1884 by Paul Vieille. Poudre B was quickly followed by Ballistite, created in 1887 by Alfred Nobel, and Cordite, modified from Nobel's formula by Frederick Abel and James Dewar. Smokeless powder is now used almost exclusively in firearms, to the point that most references to gunpowder can be taken to refer to the smokeless variety.