The fearsome megalodon was the largest shark that ever lived, possibly growing up to 20 meters (66 feet) in length, with teeth the size of a human hand. New research analyzing teeth from this ancient creature has revealed that the megalodon was the most apex of apex predators.

By studying the levels of nitrogen isotopes present in cells, scientists can figure out where a creature was in the food chain – because of the way the nitrogen is processed and excreted, nitrogen-15 builds up the higher in the food chain you go.

What the enamel on the megalodon (Otodus megalodon) teeth shows is high levels of nitrogen-15 and a place at the very top of that food chain. In fact, the food chain would have had to be several levels higher than it is today to accommodate the megalodon, which lived from around 23 million years ago to around 3.6 million years ago.

"We're used to thinking of the largest species – blue whales, whale sharks, even elephants and diplodocuses – as filter feeders or herbivores, not predators," says biogeochemist Emma Kast, from the University of Cambridge in the UK.

"But megalodon and the other megatooth sharks were genuinely enormous carnivores that ate other predators, and meg went extinct only a few million years ago."

You won't find any megalodon fossils now – shark skeletons are made from cartilage – so their teeth are the only way of trying to build up a picture of these creatures and how they lived. Fortunately for paleontologists, sharks produce thousands of teeth during their lifetimes, as they grow.

Stuck in the enamel of the teeth are very tiny bits of organic matter that give researchers the nitrogen readings. Using dentist drills, cleaning chemicals and microbes to convert the nitrogen into nitrous oxide, measurements can be taken.

The research not only required a custom-made nitrous oxide extraction system, but also a comprehensive review of nitrogen readings taken from modern day marine animals, helping the team put their megalodon findings into some kind of context.

One of the megalodon teeth used in the analysis. (Harry Maisch)

Layers of the food chain are technically known as trophic levels by scientists, and the marine food webs can be more extensive than the basic plant, herbivore, and predator system we're familiar with, especially when the marine ones start with smaller organisms (phytoplankton, rather than large plants).

Based on this teeth analysis of the megalodon and other giant ancient sharks, there were extra trophic levels at the top too.

"If megalodon existed in the modern ocean, it would thoroughly change humans' interaction with the marine environment," says geoscientist Danny Sigman, from Princeton University in New Jersey.

The giant shark would have eaten just about anything it wanted, the researchers suggest: predators, and even predators-of-predators. It's impossible to know for sure, but they most likely fed on whales and even other megalodons.

If you've seen the 2018 movie The Meg, you might have some idea of the sheer size of these sharks. One outstanding question that the research doesn't answer is why such a dominant predator went extinct – the thinking is that maybe another species of shark eventually outcompeted the megalodon.

For this study the team looked at teeth gathered from the ocean floor as well as previously collected samples. Next, the researchers want to turn their chemical analysis system on to teeth from other animals, including mammals and dinosaurs.

"Our tool has the potential to decode ancient food webs," says Kast. "What we need now is samples… we could do the same nitrogen isotope analysis and put together the whole story of an ancient ecosystem."

The research has been published in Science Advances.