Oil and natural gas come from the remains of tiny marine organisms, mainly plankton and algae, that lived in ancient oceans hundreds of millions of years ago. These microscopic creatures died, sank to the seafloor, and were buried under layers of sediment. Over millions of years, heat and pressure transformed that organic material into the fossil fuels we extract today.
Not Dinosaurs, but Plankton
One of the most persistent myths about oil is that it comes from dinosaurs. It doesn’t. Oil is a marine sediment, formed from the remains of algae, plankton, and other microorganisms that lived near the surface of shallow seas. While oil reserves do overlap in age with the dinosaur era, the connection ends there. As BBC Science Focus has put it, saying oil comes from dinosaurs is like saying bread is made from insects just because the odd one falls into a flour mill.
The process started in warm, shallow seas that were teeming with microscopic life near the surface but stagnant and oxygen-poor near the bottom. When plankton and algae died, they drifted down and piled up on the seafloor faster than they could decay. This trapped the organic matter in an oxygen-deprived layer where bacteria couldn’t fully break it down. Over time, fresh sediment buried it deeper and deeper.
Large marine animals like prehistoric reptiles occasionally ended up in the same geological layers, but their contribution was negligible. A five-tonne marine reptile falling to the seafloor would be quickly stripped by scavengers, fish, and worms, just as whale carcasses are consumed on today’s ocean floor. The real raw material was always the countless trillions of microscopic organisms accumulating over millions of years.
Certain species of marine phytoplankton can actually produce hydrocarbon compounds on their own. A species called Dicrateria rotunda, found across the Arctic, Atlantic, and Pacific oceans, synthesizes a range of saturated hydrocarbons that fall into the same chemical categories as petrol, diesel, and fuel oil. This biological capability helps explain why organic-rich marine sediments are such effective petroleum source material.
How Organic Matter Becomes Oil and Gas
The transformation from dead plankton to petroleum takes an enormous amount of time and very specific conditions. As layers of sediment pile up over millions of years, the organic-rich mud at the bottom gets pushed to depths of several kilometers. The increasing heat and pressure trigger a series of chemical changes.
First, during a stage called diagenesis, bacteria and mild heat convert the buried organic matter into a waxy, solid substance called kerogen. Think of kerogen as a halfway point: it’s no longer biological tissue, but it’s not yet oil or gas. It’s locked in the rock, waiting for more heat.
As burial continues and temperatures climb, kerogen enters the “oil window,” a temperature range between roughly 60°C and 120°C (140°F to 250°F). At these temperatures, the large kerogen molecules crack apart into smaller liquid hydrocarbons. This is where crude oil forms. The process, called catagenesis, requires the rock to stay within this temperature range for a geologically long time.
If the source rock sinks even deeper and temperatures rise above 120°C, the remaining kerogen and even existing oil molecules break down further into natural gas. Thermogenic natural gas, the kind produced by heat, forms at temperatures between roughly 157°C and 221°C. At these extremes, the organic molecules have been simplified down to methane, the smallest hydrocarbon.
Natural Gas Has Two Origins
Not all natural gas forms through intense heat. There are two distinct types. Thermogenic gas, described above, forms deep underground at high temperatures within what geologists call the “gas window.” But biogenic gas forms much closer to the surface, at temperatures below 50°C, through the activity of microorganisms called methanogens. These single-celled organisms feed on organic matter in shallow sediments and produce methane as a byproduct, the same basic process that generates swamp gas or the methane in landfills.
Biogenic gas can accumulate in commercial quantities, and some natural gas fields produce primarily this type. The two sources are distinguishable by their chemical signatures, which reflect the very different temperatures at which they formed.
When the World’s Oil Was Made
Most of the oil we use today formed during specific chapters of Earth’s history. About 70% of the world’s current oil deposits formed during the Mesozoic era, between 252 and 66 million years ago. This was the age of dinosaurs, but more importantly for petroleum, it was a time of warm global temperatures, high sea levels, and vast shallow seas rich in marine life. Another 20% formed during the Cenozoic era (the last 65 million years), and only about 10% dates back to the Paleozoic era (541 to 252 million years ago).
From start to finish, the journey from living plankton to extractable oil takes on the order of 100 million years. The organic material must accumulate, be buried under kilometers of sediment, cook at the right temperature for millions of years, and then migrate into a rock formation where it can be trapped and preserved.
How Oil Moves Underground
Oil and gas rarely stay in the rock where they formed. The source rock, typically a fine-grained shale or mudstone, generates hydrocarbons under pressure. That pressure, combined with the buoyancy of oil and gas relative to the surrounding water-saturated rock, forces them to migrate. They seep through tiny pore spaces and fractures, moving laterally and upward through more permeable rock layers.
Eventually, the migrating oil and gas reach a reservoir rock, typically sandstone or limestone with enough pore space to hold large volumes of fluid. But a reservoir alone isn’t enough. There must also be a trap: a geological structure that prevents the hydrocarbons from continuing to migrate upward and escaping at the surface. Common traps include arching rock folds (anticlines) and faults that place an impermeable layer next to the reservoir. Without all three elements, source rock, reservoir rock, and trap, you don’t get a commercially viable oil or gas deposit.
Fractures and fault systems play a key role in directing this migration. Oil often flows into networks of natural fractures near fault planes, and the connectivity of those fault systems controls where oil ultimately accumulates.
Conventional vs. Unconventional Deposits
In a conventional oil or gas field, hydrocarbons have migrated out of their source rock and collected in a porous, permeable reservoir. The pore spaces in the reservoir rock are well connected, so oil or gas flows relatively easily toward a well. A small number of strategically placed wells can drain a large area.
Unconventional deposits are fundamentally different. Shale gas and tight oil are still sitting in or very near the source rock where they originally formed. These shales have extremely low porosity (tiny void spaces between grains) and very low permeability (those spaces are poorly connected). The gas is essentially trapped in the same rock that created it, unable to migrate.
Extracting hydrocarbons from these formations requires artificially increasing the rock’s permeability, which is what hydraulic fracturing does. By injecting fluid at high pressure to create fractures in the shale, producers open pathways for gas to flow toward the well. This is why shale gas development requires far more wells per area than conventional production.
A Minority View: Abiogenic Origins
A small group of scientists, primarily in Russia and Ukraine, have argued over the past 50 years that some petroleum originates not from biological material but from chemical reactions deep in Earth’s mantle, at depths of 70 to 250 kilometers. Under extreme conditions (600°C to 1,500°C and pressures 20,000 to 70,000 times atmospheric pressure), carbon and hydrogen could theoretically combine into hydrocarbon molecules that then migrate upward through deep faults into the crust.
This abiogenic theory remains a minority position. The overwhelming body of evidence, including the chemical fingerprints of biological molecules found in crude oil, the association of oil deposits with organic-rich marine sediments, and the age patterns of global reserves, supports the biological origin of petroleum. Still, the abiogenic hypothesis hasn’t been fully ruled out as a minor contributor, particularly for some deep methane deposits.

