Investigating the evolution of land use and its impact on carbon storage is of significant importance for mitigating regional climate change and promoting green low-carbon development. Ningwu County is located in the source region of the Fenhe and Sanggan River, and its ecological status significantly influences the carbon storage (CS) of the watershed ecosystem. In this study, the PLUS-InVEST model was employed to analyze the land use evolution from 1990 to 2020 in Ningwu County, Shanxi Province, as well as their impacts on CS. Additionally, the study simulated and predicted land use changes in Ningwu County by 2040 under four scenarios: natural development (NDS), ecological protection (EPS), cultivated land protection (CLPS), and urban development (UDS), while estimating the corresponding changes in ecosystem CS. Furthermore, the study utilized optimal parameters-based geographical detector to explore the mechanisms underlying the spatial differentiation of CS. The results indicated that the areas of forest land and construction land in the study area consistently increased from 1990 to 2020, whereas the area of cultivated land continuously declined, with grassland, water bodies, and unused land exhibiting a fluctuating increasing trend. The spatial distribution of CS was highest in the northwest, second highest in the southeast, and lowest in the middle region. Over these 3 decades, CS had shown a continuous increase. It is projected that by 2040, the areas of forest and grassland will experience the most significant increase under the EPS; cultivated land only increase under the CLPS; while construction land display the greatest increase under the UDS. Compared to 2020, these four scenarios for 2040 indicate an increase in regional CS, with the EPS showing the largest increment. The primary factors influencing the spatial differentiation of CS in Ningwu County are human activities, followed by topography and climate change; the interactions among these factors exhibit a reinforcing relationship, with the interaction between the distance from construction land and slope having the most substantial impact on the spatial differentiation of CS.