Coal is primarily composed of carbon. While it may contain other elements such as hydrogen, sulfur, oxygen, and nitrogen, the main component of coal is carbon. When coal is burned, the carbon combines with oxygen in the air to produce heat and carbon dioxide.