Under the background of "dual carbon", the impact of the implementation of the Grain for Green project on the carbon storage of the ecosystem in the Yellow River Basin must be explored, which can serve as an important reference for improving the policy implementation of the new round of the Grain for Green project and improving the carbon sink capacity of the ecosystem in the Yellow River Basin. In this study, 1990, before the implementation of the project, was selected as the starting year of the research period, and 2020, after the implementation of the two rounds of the project, was selected as the end year of the research period. Based on the ecosystem type data from 1990 to 2020, the InVEST model was used to calculate the soil carbon pool, underground carbon pool, below carbon pool, dead organic matter carbon pool, and total carbon storage of ecosystems in the Yellow River Basin and the area where the project was implemented from 1990 to 2020. The results showed that: ① From 1990 to 2020, the area of forest ecosystem in the Yellow River Basin expanded by 26 610.06 km2, and the area of farmland decreased by 46 849.06 km2 after the implementation of two rounds of the project. Spatially, the upper reaches of the Yellow River were dominated by grassland and other ecosystems; the middle reaches of the Yellow River were dominated by farmland, forest, and grassland ecosystems; and the lower reaches of the Yellow River were dominated by farmland ecosystems. ② From 1990 to 2020, the carbon storage in the project implementation area showed a fluctuating and increasing trend, and the total carbon storage reached a peak (219.47×108 t) in 2009 and decreased to 218.59×108 t in 2020 due to the decrease of grassland ecosystem from 2010 to 2020. Spatially, the high-value areas of carbon storage were distributed in Aba Tibetan and Qiang Autonomous Prefecture of Sichuan Province and the southern tip of Gansu Province in the upper reaches of the forest and grass accumulation and in the whole of Shanxi Province and the central and southern parts of Shaanxi Province in the middle reaches. Shangluo City in Shaanxi Province and Alxa League in Inner Mongolia Autonomous Region were prefecture-level cities with the highest and lowest average carbon density. ③ In 2035, the carbon storage loss of the natural development scenario was predicted to be 0.83×108 t, and the other three scenarios would increase this loss. Under the moderate farmland return scenario, the Yellow River Basin ecosystem had the strongest carbon sequestration capacity, and the predicted carbon storage would increase by 2.72×108 t compared with that in 2020, and the deep farmland return scenario was the comprehensive optimal scenario. Therefore, in the future, the Yellow River Basin could refer to the deep farmland return scenario to optimize and adjust the implementation plan of the Grain for Green project, and the predicted value of carbon storage can provide some data support for achieving the dual carbon goal.