Field experiments across aquatic and terrestrial ecosystems show that biodiversity positively affects carbon and nitrogen cycling in leaf litter decomposition, indicating that reduced decomposition caused by biodiversity loss would modify the global carbon cycle and limit the nitrogen supply to the organisms at the base of the food chain. It is well established that biodiversity has a positive effect on ecosystem functions such as primary production, but its effects on the diversity of plant litter and of the organisms that break it down are less clear cut. Stephan Hättenschwiler and colleagues examined litter diversity in parallel manipulative experiments at five sites ranging from subarctic to tropical, and including both aquatic and terrestrial ecosystems. Across all of the studied ecosystems, they show that reducing the diversity of litter or of detritivores (the invertebrates and microorganisms that break litter down) slows litter carbon and nitrogen cycling and the rate of decomposition. A reduction in decomposition caused by biodiversity loss would, for example, limit the nitrogen supply to primary producers. Although positive overall, the effects were weaker than commonly reported for primary production, thus challenging current thinking on the generality of relationships between biodiversity and ecosystem processes that are based on assessments of plant productivity. The decomposition of dead organic matter is a major determinant of carbon and nutrient cycling in ecosystems, and of carbon fluxes between the biosphere and the atmosphere1,2,3. Decomposition is driven by a vast diversity of organisms that are structured in complex food webs2,4. Identifying the mechanisms underlying the effects of biodiversity on decomposition is critical4,5,6 given the rapid loss of species worldwide and the effects of this loss on human well-being7,8,9. Yet despite comprehensive syntheses of studies on how biodiversity affects litter decomposition4,5,6,10, key questions remain, including when, where and how biodiversity has a role and whether general patterns and mechanisms occur across ecosystems and different functional types of organism4,9,10,11,12. Here, in field experiments across five terrestrial and aquatic locations, ranging from the subarctic to the tropics, we show that reducing the functional diversity of decomposer organisms and plant litter types slowed the cycling of litter carbon and nitrogen. Moreover, we found evidence of nitrogen transfer from the litter of nitrogen-fixing plants to that of rapidly decomposing plants, but not between other plant functional types, highlighting that specific interactions in litter mixtures control carbon and nitrogen cycling during decomposition. The emergence of this general mechanism and the coherence of patterns across contrasting terrestrial and aquatic ecosystems suggest that biodiversity loss has consistent consequences for litter decomposition and the cycling of major elements on broad spatial scales.