Rudimentary gunpowder is normally composed of three items: sulfur powder (S), serving as the fuel source, saltpeter (potassium nitrate KNO3,) serving as the oxygen supplier and charcoal powder (C7H4O), serving as the carbon (C) source for additional fuel.

Some more information for you:

Also, it’s worth noting that just mixing these three constituents together is not enough to produce appropriate quality gunpowder, which would pass U.S. governmental regulations. These items must be thoroughly mixed, moistened and ground to produce a reactive mixture. Deviations from the ideal ratio are sometimes used to alter the burning behavior of the mixture that is made. Also, additional small amounts of water to the mixture can be used to extend the burning time of the gunpowder.

More Info: en.wikipedia.org