Gunpowder is a mixture of potassium nitrate, sulfur, charcoal and saltpeter and has excellent burning properties. Gunpowder is also known for the huge amount of gas and heat it generates when burned.
Chinese were the first to invent and use gun powder. Initially it was used as a medicine and was called the Fire medicine and was later used in warfare. Chinese used gunpowder in explosives, rockets and grenades against the Mongols. There have also been debates that a number of other civilizations might have co invented the gunpowder at the same time or before the Chinese invented it. However due to the lack of clear proof or records the exact source has not been identified. The first documented evidence of gun powder was dated 9th century. References to the use gun powder in the rest of the world are dated 12th century.
Gun powder has been used in fireworks and fire arms due to its properties. Gun powder is a relatively low explosive unlike TNT which is a high explosive. Gun powder is used in weapons like guns where sufficient combustion and pressure should be produced behind the bullet to force it out of the muzzle at great speed and at the same time does not rupture the body of the gun.
It is widely used in firecrackers and fireworks today and has also been used as a delay fuse in explosives like grenades and dynamites.