They’re not just Carbon in different states. They’re different collections of organic (Carbon-based) molecules. Pretty much any organic chemical can be burned to produce (mostly) CO2 and water. However, the amount of energy you get out per amount of CO2 generated depends on the structure of the molecule that was burned. Methane (i.e, natural gas) produces about 50% less CO2 per unit of energy produced compared with coal.
Not relevant to CO2 emissions, but coal also tends to contain lots of other stuff in it like Sulfur compounds that are extremely bad environmental pollutants.
Latest Answers