Ants live in nearly every land habitat on Earth, from tropical rainforest canopies to scorching desert surfaces, suburban sidewalks, and coastal mudflats. With roughly 20 quadrillion individuals alive at any given time and more than 14,000 described species, ants have colonized a wider range of environments than almost any other insect group. The true number of species may be two to three times higher than what scientists have formally identified.
Underground Nests
Soil is the most common ant habitat worldwide. Most species excavate nests below ground, creating networks of tunnels and chambers that can extend from just below the surface to several meters deep. The depth depends largely on temperature. Leaf-cutting ants in South America, for example, choose their nesting depth based on soil warmth: workers prefer to dig in soil between 20°C and about 30°C, which is the range that maximizes colony growth. In hotter soils, species tend to build deeper, subterranean nests to stay cool. In cooler soils, they nest closer to the surface where temperatures are more favorable.
This isn’t a fixed rule for each species, either. Some leaf-cutting ants show nesting plasticity, building shallow nests in cold soil and deeper ones in warm soil. Workers actively use soil temperature as an orientation cue, moving to alternative digging spots or stopping entirely when conditions fall outside their preferred range.
Trees and Forest Canopies
A large number of ant species never touch the ground. Arboreal ants build their entire colonies in trees, and weaver ants are the most dramatic example. Asian weaver ants are dominant canopy insects across tropical Australasia, constructing elaborate nests by pulling living leaves together and stitching them with silk produced by their larvae. The location of each nest depends on the tree’s architecture and leaf characteristics, and building and maintaining these structures requires enormous energy. A significant portion of the colony stays immobile at any given time to conserve resources.
Weaver ants aren’t alone in the canopy. Several other genera also use larval silk to bind leaves or debris into aerial nests. Arboreal living gives these species access to honeydew from sap-feeding insects, protection from ground-level predators, and territory over the food resources in their host trees.
Inside Wood
Carpenter ants are the best-known wood-nesting species. They don’t eat wood like termites do. Instead, they excavate galleries through it to create living space. Outdoors, they nest in tree holes, stumps, logs, and standing dead trees. Indoors, they target structural wood, wall voids, hollow doors, window casings, and attic insulation.
The key requirement is moisture. Carpenter ants prefer wood with a moisture content of 15% or higher, which is why infestations in homes are almost always linked to a water problem: a leaky roof, poor drainage around a door frame, or condensation in a wall cavity. Dry, sound wood holds little appeal for them.
Inside Living Plants
Some tropical plants have evolved hollow structures specifically to house ant colonies. These plants, called myrmecophytes, grow swollen branches, thorns, petioles, or leaf pouches known as domatia. The ants move in, and in return they defend the plant against herbivores, competing vegetation, or both.
One well-studied example is Duroia hirsuta, a tree in the northwestern Amazon that partners with specific ant species. The ants living inside it kill surrounding plants by injecting formic acid into their leaves, creating monospecific stands known locally as “devil’s gardens,” clearings in the forest where only the host tree grows. The plant produces its hollow domatia even before ants arrive, typically once the sapling reaches about 1 cm in trunk diameter, essentially building apartments in anticipation of tenants.
Deserts and Extreme Heat
Saharan silver ants forage on desert surfaces that reach 60°C to 70°C. Their bodies can tolerate internal temperatures up to about 53.6°C, which is among the highest thermal limits of any land animal. To survive, they’ve developed a dense coat of uniquely shaped, triangular hairs that work in two ways: they reflect solar radiation in the visible and near-infrared spectrum (giving the ants their silvery look), and they boost the ant’s ability to radiate excess body heat in the mid-infrared range. At a body temperature of 50°C, this radiative cooling lets them dump heat back into the environment even in full sunlight. Their foraging trips are still extremely brief, timed to the narrow window when surface temperatures are high enough to have killed competing scavengers but not yet lethal to the ants themselves.
Intertidal Zones
Perhaps the most surprising ant habitat is the space between tides. The Australian intertidal ant Polyrhachis sokolova nests in mudflats at the base of mangrove trees, a zone that floods with seawater twice a day. These ants forage during low tides, both day and night, which means they cope with an enormous range of light conditions. Their eyes have evolved accordingly: large lenses and wide light-gathering structures make them highly sensitive in darkness, while an extreme pupil-like mechanism constricts their optics during bright daylight to protect the photoreceptors. They also have specialized cells in the upper part of their compound eyes that detect polarized skylight, helping them navigate between nest and food sources across featureless mud.
Urban Environments
Cities are full of ants, and their preferred nesting spots are predictable. A study of ant nests in urban pavements found that the vast majority (about 84%) were located under concrete slabs, with another 15% under natural stone paving. Ants favor spots where the joints between slabs have degraded or are made of flexible material like sand, which gives them easy access to the soil beneath. Cracks in asphalt account for a small fraction of urban nests.
Beyond sidewalks, urban ants colonize wall cavities, the soil in planter boxes, gaps behind building facades, and the edges of parking lots. Pavement ants, a common North American species, build their colonies entirely in the sand layer beneath sidewalks and driveways, pushing up the small mounds of displaced soil that are visible at slab joints in spring and summer.
Where Ants Don’t Live
For all their adaptability, ants have limits. Antarctica has no native ant species, and neither do a handful of remote oceanic islands like Iceland, Greenland, and some sub-Antarctic landmasses. Extreme altitude also thins out ant diversity significantly. In the Australian Wet Tropics, for instance, ant communities have been studied at elevations from 100 to 1,300 meters, with diversity declining at higher sites. Globally, ants become rare above about 3,000 meters, and virtually absent from permanent snowfields and glaciated terrain.
Even with those gaps, the total biomass of ants on Earth is estimated at 12 megatons of dry carbon, roughly 20% of total human biomass. That figure exceeds the combined biomass of all wild birds and mammals. The sheer range of habitats they occupy, from mangrove mud to desert sand to the insides of living plants, is a large part of how they got there.

