The elemental composition of plants (i.e., the elementome) relates to their functional traits which has important implications for understanding nutrient cycles and energy flows within ecosystems. Theoretically, elemental diversity (ED) captures functional diversity by comparing the n-dimensional elementome of the present species in a community. However, empirical evidence linking ED with ecosystem functioning is still lacking. We collated an unprecedented volume of data (> 2500 species and 14 analyzed elements from leaves, stems, trunks, and fine roots) across eight biomes from 72 sites to explore the spatial patterns and drivers of ED and its relationship with ecosystem productivity and stability. Our results revealed that interannual variability in temperature is the main factor explaining ED spatial patterns. We provide strong empirical evidence indicating that ecosystems with higher ED show higher productivity and stability. The results provide important insights into how elementome differences among organisms affect ecosystem function across ecosystems and biomes.