Aim Tropical forests store 25% of global carbon and harbour 96% of the world's tree species, but it is not clear whether this high biodiversity matters for carbon storage. Few studies have teased apart the relative importance of forest attributes and environmental drivers for ecosystem functioning, and no such study exists for the tropics. Location Neotropics. Methods We relate aboveground biomass (AGB) to forest attributes (diversity and structure) and environmental drivers (annual rainfall and soil fertility) using data from 144,000 trees, 2050 forest plots and 59 forest sites. The sites span the complete latitudinal and climatic gradients in the lowland Neotropics, with rainfall ranging from 750 to 4350¿mm¿year-1. Relationships were analysed within forest sites at scales of 0.1 and 1 ha and across forest sites along large-scale environmental gradients. We used a structural equation model to test the hypothesis that species richness, forest structural attributes and environmental drivers have independent, positive effects on AGB. Results Across sites, AGB was most strongly driven by rainfall, followed by average tree stem diameter and rarefied species richness, which all had positive effects on AGB. Our indicator of soil fertility (cation exchange capacity) had a negligible effect on AGB, perhaps because we used a global soil database. Taxonomic forest attributes (i.e. species richness, rarefied richness and Shannon diversity) had the strongest relationships with AGB at small spatial scales, where an additional species can still make a difference in terms of niche complementarity, while structural forest attributes (i.e. tree density and tree size) had strong relationships with AGB at all spatial scales. Main conclusions Biodiversity has an independent, positive effect on AGB and ecosystem functioning, not only in relatively simple temperate systems but also in structurally complex hyperdiverse tropical forests. Biodiversity conservation should therefore be a key component of the UN Reducing Emissions from Deforestation and Degradation strategy.