Pastures, on which ruminant livestock graze, occupy one third of the earth's surface. Removing livestock from pastures can support climate change mitigation through carbon sequestration in regrowing vegetation and recovering soils, particularly in potentially forested areas. However, this would also decrease food and fiber production, generating a tradeoff with pasture productivity and the ruminant meat production pastures support. We evaluate the magnitude and distribution of this tradeoff globally, called the "carbon opportunity intensity" of pastures, at a 5-arcminute resolution. We find that removing beef-producing cattle from high-carbon intensity pastures could sequester 34 (22 to 43) GtC i.e. 125 (80 to 158) GtCO2 into ecosystems, which is an amount greater than global fossil CO2 emissions from 2021-2023. This would lead to only a minor loss of 13 (9 to 18)% of the global total beef production on pastures, predominantly within high- and upper-middle-income countries. If areas with low-carbon intensity pastures and less efficient beef production simultaneously intensified their beef production to 47% of OECD levels, this could fully counterbalance the global loss of beef production. The carbon opportunity intensity can inform policy approaches to restore ecosystems while minimizing food losses. Future work should aim to provide higher-resolution estimates for use at local and farm scales, and to incorporate a wider set of environmental indicators of outcomes beyond carbon.