The stability of plant biomass production in the face of environmental change is fundamental for maintaining terrestrial ecosystem functioning, as plant biomass is the ultimate source of energy for nearly all life forms. However, most studies have focused on the stabilising effect of plant diversity, neglecting the effect of soil biodiversity, the largest reservoir of biodiversity on Earth. Here we investigated the effects of plant and soil biodiversity on the temporal stability of biomass production under varying simulated precipitation in grassland microcosms. Soil biodiversity loss reduced temporal stability by suppressing asynchronous responses of plant functional groups. Greater plant diversity, especially in terms of functional diversity, promoted temporal stability, but this effect was independent of soil biodiversity loss. Moreover, multitrophic biodiversity, plant and soil biodiversity combined, was positively associated with temporal stability. Our study highlights the importance of maintaining both plant and soil biodiversity for sustainable biomass production.