The widespread abandonment of croplands poses a severe threat to China’s food security. However, the existing knowledge regarding the potential for recultivating abandoned croplands is limited. Previous studies have generally overestimated this potential due to inadequate assessments of their suitability for recultivation. In the present study, an optimized machine learning approach was introduced to assess, for the first time, the suitability of abandoned croplands for recultivation in China. In 2022, the total abandoned croplands in China covered 31.2 million hectares, of which 82.54% was deemed suitable for recultivation. Recultivating abandoned croplands in China could substantially enhance food security, potentially yielding around 162 million tons annually. Moreover, crop switching can further increase the yield rate by up to 24.95% or energy supply by up to 43.14%. The present study offers valuable insights to policymakers in determining cropping strategies, establishing strategic grain reserves, and managing international food trade.