We tested the hypothesis that species of a diverse leaf-litter ant community are separated by the temperature preferences of their broods along a thermal gradient. Therefore, temperature preferences of brood-tending workers from 41 ant species co-occurring in four types (alluvial, limestone, kerangas and dipterocarp forest) of primary rain forest in Sarawak, Malaysia were measured in an experimental set-up. Preferred temperatures of species ranged from 16.0 °C to 31.7 °C, with the median at 25.8 °C. The ten commonest species (n ≥ 4) showed significantly different temperature preferences. In particular, species of the genus Pheidole differed clearly in their preferences over a broad range of temperatures. Temperature preferences varied significantly among ant assemblages from different forest types and nest sites. Experimentally obtained temperature preferences of species correlated significantly with vegetation density in the plots inhabited by the respective species, but not with plot canopy cover. When we tested the temperature preferences of all ant species with null models for niche overlap, we found a significant niche separation only among the tested species from the kerangas. Our results suggest that nest temperature is an important ecological factor for leaf-litter ants in rain forests on Borneo, but other factors may override its influence during community assembly.