The Loess Plateau is considered one of the world's regions with severe soil erosion. Grasslands are widely distributed on the Loess Plateau, accounting for approximately 40% of the total area. Soil organic carbon (SOC) plays an important role in the terrestrial carbon cycle in this region. We compiled more than 1,000 measurements of plant biomass and SOC content derived from 223 field studies of grasslands on the Loess Plateau. Combined with meteorological factors (precipitation and air temperature) and the photosynthetically active radiation factor, the topsoil SOC contents of grasslands were predicted using the random forest (RF) regression algorithm. Predicted grassland SOC content (1.70-40.34gkg(-1)) decreased from the southeast to the northwest of the Loess Plateau, with approximately 1/5 of the grassland exhibiting values lower than 4gkg(-1). Observed SOC content was positively correlated with observed plant biomass, and for predicted values, this correlation was strong in the desert steppe and the steppe desert of rocky mountains. Air temperature was the most important factor affecting SOC contents in the RF model. Moreover, the residual error of observations and predictions increased as the grazing intensity varied from none to very severe in the temperate desert steppe, and this RF model may not perform well in plains. The use of the RF model for SOC prediction in Loess Plateau grasslands provides a reference for C storage studies in arid and semi-arid regions, and aboveground biomass and temperature should receive more attention due to increasing C sequestration.