Biochar amendment to soils is regarded as the potential practice to mitigate climate change while also increasing yields. However, geographical differences in the effects of biochar on cereal production and greenhouse gas emissions are not well understood at the global scale. Random forest, a classic machine learning algorithm, was employed to reveal the drivers of geographical differences in the effects of biochar on cereals yield and green-house gas emissions. The potential for yield increases and greenhouse gas emission reduction was predicted in this study. The results indicate that nitrogen fertilizer rate is the most important factor determining the impact of biochar on cereal yield, while biochar application rate strongly affected greenhouse gas emissions. Globally, the maximum increase in cereal crop yields under biochar application was 14.1%. To achieve the largest increment globally, recommended values of biochar application, mineral nitrogen application rate and pyrolysis temper-ature were predicted to be around 36.3 t ha-1, 193.7 kg N ha-1 and 420 degrees C, respectively. The maximum re-ductions of methane and nitrous oxide emissions from paddy fields around the world were 21.6% and 31.0%, and from maize and wheat fields 35.7% and 36.1%, respectively. Although biochar can potentially improve yields while reducing greenhouse gas emissions worldwide under proper management, the performance of biochar showed great heterogeneity.