Coal is a black or brownish-black, combustible sedimentary rock composed primarily of carbon, formed from ancient plant remains subjected to heat and pressure over millions of years. It is a nonrenewable fossil fuel used globally to generate electricity and for various industrial purposes. Coal is classified by its "rank" based on carbon content and energy potential, ranging from lignite (lowest rank) to anthracite (highest rank).