The possibility of using the elemental compositions of species as a tool to identify species/genotype niche remains to be tested at a global scale. We investigated relationships between the foliar elemental compositions (elementomes) of trees at a global scale with phylogeny, climate, N deposition and soil traits. We analysed foliar N, P, K, Ca, Mg and S concentrations in 23,962 trees of 227 species. Shared ancestry explained 60–94% of the total variance in foliar nutrient concentrations and ratios whereas current climate, atmospheric N deposition and soil type together explained 1–7%, consistent with the biogeochemical niche hypothesis which predicts that each species will have a specific need for and use of each bio-element. The remaining variance was explained by the avoidance of nutritional competition with other species and natural variability within species. The biogeochemical niche hypothesis is thus able to quantify species-specific tree niches and their shifts in response to environmental changes.