Grassland plant diversity has been observed with divergent responses in grazing experiments around the world. However, the dominant role of nitrogen (N) availability in controlling this global variation has not been well explored, impeding our capacity to formulate effective strategies for preserving grassland plant diversity. Here, we synthesized data from 306 grazing experiments that measured plant diversity and soil N content across global grasslands. Overall, grazing reduced plant diversity by 7.63 %, with substantial variations observed across the dataset. Our study revealed that these contrasting effects were best explained by soil N change. Plant diversity under enhanced soil N showed a strong increase in response to grazing. We found that lower grazing intensity and higher background N deposition could collectively enhance soil N, thereby promoting diversity. These results suggest that while avoiding high grazing intensity is crucial in maintaining biodiversity of grazed grasslands, it alone is not sufficient. In regions with lower N deposition (< 500 mg N m−2 yr−1), additional management strategies that target improving soil fertility are needed. Our analysis propounds that local environmental conditions should be incorporated into decision-making of grassland biodiversity conservation, or ignoring this may lead to counterproductive impacts.