How old is a lump of coal?
This sounds like a trick question, but it isn’t. Coal is millions of years old.
Anthracite, the oldest and hardest coal, is 400 million years old. All those years ago, many parts of the earth were covered with wet, marsh-like areas of land, called swamps. Huge trees, giant ferns, mosses, and other plants grew in these swamps. As the trees and plants lost their leaves or died, the leaves and dead material formed into layers of rotting vegetation. In time, pressure from above packed these layers together to form a layer of soft material called peat. Peat is found throughout the world in swamps and marshes. It can be cut, dried and burned as fuel.

Sometimes, mud and sand were washed over the layers of rotting vegetation, pressing them even tighter together. This made a soft, brown kind of coal called lignite. As more mud and sand piled on top, the vegetation was pressed down even deeper. Movement inside the earth’s crust helped to turn the lignite into hard, black coal. Sometimes, if you look closely at a piece of coal, you can see the outlines of a leaf from a fern that was alive millions of years ago.

Oil and gas
Oil was formed in a similar way to coal. Millions of years ago, small plants and animals that lived in the seas sank down to the seabed when they died. They were crushed under layers of mud and gradually turned into oil. As oil formed, it gave off natural gas. The oil and gas seeped upwards until they reached layers of hard rock and became trapped under the rock.

Coal, oil, and natural gas are called fossil fuels. They were formed from the remains of plants and animals that died long ago.
When these plants and animals were alive, they converted energy from the sun into chemical energy. When we burn fossil fuels, we turn this chemical energy back into heat energy and light energy. In other words, we are releasing from these fuels the energy that first came to earth from the sun millions of years ago.