The general patterns of increasing biodiversity from the poles to the equator have been well documented for large terrestrial organisms such as plants and vertebrates but are largely unknown for microbiota. In contrast to macrobiota, microbiota have long been assumed to exhibit cosmopolitan, random distributions and a lack of spatial patterns. To evaluate the assumption, we conducted a survey of nematode diversity within the soil, litter and canopy habitats of the humid lowland tropical rainforest of Costa Rica using an ultrasequencing ecometagenetic approach at a species-equivalent taxonomic level. Our data indicate that both richness and diversity of nematode communities in the tropical rainforests of Costa Rica are high and exceed observed values from temperate ecosystems. The majority of nematode species were unknown to science, providing evidence for the presence of highly endemic (not cosmopolitan) species of still completely undiscovered biodiversity. Most importantly, the greater taxonomic resolution used here allowed us to reveal predictable habitat associations for specific taxa and thus gain insights into their nonrandom distribution patterns.