Estimating the exact number of species of bacteria is impossible with today's technology. To really move close to having an objective number, people would need a machine that could process soil, water, and rock in large amounts, isolate the bacteria from their habitat, then sequence the genomes of as many bacteria as possible within the sample.
Today, given that sequencing a bacterial genome costs half a million US dollars and takes a few months, this is infeasible. Even if costs fall by a factor of a trillion, there are so many microbes in soil that categorizing them in this way would be prohibitively expensive.
Instead of sequencing entire genomes, bacterial surveys use snippets to distinguish between different species. This is more cost-effective than whole genome sequencing. One survey found 20,000 species of bacteria in 1 quart (about 1 liter) of seawater.
Another approach to determining the quantity of bacteria in a sample is to use a technique called DNA reassociation. In DNA reassociation, scientists use chemicals to "unzip" the two strands of the double-helix in bacterial DNA, then mix them up. Compatible DNA strands will re-link up with one another. The longer the reassociation process takes, the more species are present in the sample. These measurements of time can be used to estimate bacterial biodiversity in the ocean or soil.
When this technique was applied to a soil sample in the late 1990s, a 16,000 species were found. This technique included the assumption that the populations of different species of bacteria were approximately similar, however, which is now known to be false. An updated survey by Jason Gans found there to be about a million bacterial species per 0.035 ounces (1 gram) of soil. While only a few bacterial species dominate the soil, there is a huge number of low-abundance species.
Another approach is to use mathematical models of species diversity curves to extrapolate the total number of species in a given sample from information about the abundance of a few top species. A 2002 paper by Curtis, Sloan, and Scannel, "Estimating Prokaryotic Biodiversity and Its Limits," estimated the number of oceanic bacteria taxa at lower than 2 million, the number of soil taxa at least 4 million, and the number of atmospheric taxa at least 4 million. This study assumed that the bacterial diversity in a gram of soil was only 6,400 to 38,000 per gram, much less than found in the DNA reassociation study.
Currently, estimates of the total number of species range from about 10 million to a billion, but these estimates are tentative, and may be off by many orders of magnitude. By comparison, there are probably between 10 and 30 million species of animals, the vast majority of them insects. The number of scientifically recognized species of animals is about 1,250,000. There are almost 300,000 recognized species of plants.