Abstract Aim: Recent coarse-scale studies have shown positive relationships between the biodiversity of plants/vertebrates and the human population. Little is known about the generality of the pattern for invertebrates. Moreover, biodiversity and human population might correlate because they both covary with other factors such as energy availability and habitat heterogeneity. Here we test these two non-mutually exclusive mechanisms with ant species-richness data from the Fauna Europaea. Location Forty-three European countries/regions. Methods We derived mixed models of total, native and exotic ant species richness as a function of human population size/density, controlling for country area, plant species richness (as a proxy for habitat heterogeneity), and mean annual temperature and precipitation (variables related to energy availability). Results Ant species richness increased significantly with increasing human population. This result was confirmed when controlling for variations in country area. Both for human population size/density and for ant species richness, there were positive correlations with temperature but not with precipitation. This finding is in agreement with the energy-availability hypothesis. However, we observed a negative latitudinal gradient in ant and plant species richness, although not in human population size/density. Plant species richness was positively correlated with ant species richness but not with human population size/density. Thus, there is evidence that this type of habitat heterogeneity can play a role in the observed latitudinal gradient of ant species richness, but not in the positive correlation between ant species richness and human population. The results were confirmed for the 545 native and the 32 exotic ant species reported, and we observed a good correlation between exotic and native ant species richness. Main conclusions Ant species richness in European countries conforms to six macroecological patterns: (1) a negative latitudinal gradient; and a positive (2) species–energy relationship, (3) species–area relationship, (4) correlation with plant species richness, (5) exotic–native species richness correlation, and (6) species–people correlation. There is some evidence for the energy-availability hypothesis, but little evidence for habitat heterogeneity as an explanation of the large-scale human population–ant biodiversity correlation. This correlation has implications for the conservation of ant diversity in Europe.