Coal is a combustible black or brownish-black sedimentary rock, formed as rock strata called coal seams. Coal is mostly carbon with variable amounts of other elements, chiefly hydrogen, sulfur, oxygen, and nitrogen. Coal is formed when dead plant matter decays into peat and is converted into coal by the heat and pressure of deep burial over millions of years. Vast deposits of coal originate in former wetlandsâ??called coal forestsâ??that covered much of the Earth's tropical land areas during the late Carboniferous (Pennsylvanian) and Permian times. However, many significant coal deposits are younger than this and originate from the Mesozoic and Cenozoic eras. Coal is primarily used as a fuel. While coal has been known and used for thousands of years, its usage was limited until the Industrial Revolution. With the invention of the steam engine, coal consumption increased. In 2020 coal supplied about a quarter of the world's primary energy and over a third of its electricity. Some iron and steel making and other industrial processes burn coal.