Ants play a significant role, dispersing seeds, hosting organisms and serving as either predators or prey.
Some studies have already attempted to estimate the global ant population, but they resulted in a far smaller number than 20 quadrillion, which is 20 million billion.
For this new attempt, published Monday in the journal Proceedings of the National Academy of Sciences (PNAS), researchers analysed 465 studies that measured the number of ants locally in the field.
The hundreds of studies used two standardised techniques, setting traps that captured ants passing by during a certain period of time, or analysing the number of ants on a given patch of leaves on the ground.
While surveys have been carried out on all continents, some major regions had little or no data, including central Africa and Asia.
This is why "the true abundance of ants globally is likely to be considerably higher" than estimated, the study says. "It is of utmost importance that we fill these remaining gaps to achieve a comprehensive picture of insect diversity."
There are more than 15,700 named species and subspecies of ants that are found all over the planet, and probably an equal number that have yet to be described.
But nearly two-thirds of them are found in only two types of ecosystems: tropical forests and savannahs.
Based on the estimated number of ants, their total global biomass is thought to be 12 megatons of dry carbon, more than that of wild birds and mammals combined, and 20 per cent of that of humans.
In the future, researchers plan to study the environmental factors influencing population density of the tiny creatures.