Nature benefits people in many ways that rely on how microorganisms and abiotic processes interact with organic matter to influence ecosystem function (EF). Despite many studies evaluating how biodiversity affects EF, most variation in EF remains unexplained. Here, we tested how the variety of organic compounds in the environment, termed chemodiversity, influences EF. Using a laboratory experiment and 101-lake survey spanning Europe, we discovered that chemodiversity, not biodiversity, consistently explained variation in multiple functions related to carbon cycling and ecosystem metabolism. We attributed positive chemodiversity-ecosystem multifunctionality relationships to the accumulation of compounds that could be biochemically transformed in more diverse ways at higher chemodiversity. We estimated chemodiversity will decline by 2100 due to changes in organic matter sources, causing European lakes to emit, on average, 1.6-times more carbon. These findings reframe our understanding of ecosystem functioning and suggest chemodiversity is key to sustain the benefits that nature delivers to people.