Peat, and therefore coal, is formed from the remains of plants which lived millions of years ago in tropical wetlands (coal swamps), such as those of the late Carboniferous period (the Pennsylvanian). Also wood heated in an airless space can make charcoal, which is like coal.