To meet the challenge of feeding a growing world population with minimal environmental impact, we need comprehensive and quantitative knowledge of ecological factors affecting crop production. Earthworms are among the most important soil dwelling invertebrates. Their activity affects both biotic and abiotic soil properties, in turn affecting plant growth. Yet, studies on the effect of earthworm presence on crop yields have not been quantitatively synthesized. Here we show, using meta-analysis, that on average earthworm presence in agroecosystems leads to a 25% increase in crop yield and a 23% increase in aboveground biomass. The magnitude of these effects depends on presence of crop residue, earthworm density and type and rate of fertilization. The positive effects of earthworms become larger when more residue is returned to the soil, but disappear when soil nitrogen availability is high. This suggests that earthworms stimulate plant growth predominantly through releasing nitrogen locked away in residue and soil organic matter. Our results therefore imply that earthworms are of crucial importance to decrease the yield gap of farmers who can't -or won't- use nitrogen fertilizer.