The digital economy enhances economic efficiency and improves economic structure, driving economic growth through transformations in efficiency, momentum, and quality. It has become a new driving force for advancing common prosperity. This study uses SDM, SDID, and SPSTR models to explore the impact of digital economy on common prosperity, which constructs the index system to evaluate the common prosperity from process index and outcome index. According to the panel data of 76 cities in the Yellow River Basin from 2011 to 2021, and the findings are as follows: (1) The digital economy exhibits a development pattern characterized by high activity downstream and lower activity upstream, and the development trend is stable. The development pattern of common prosperity has changed from sporadic distribution to regional agglomeration, and the level of common prosperity in most cities has improved. (2) The digital economy has a significant positive spatial effect on common prosperity. And the findings are robust after introducing the “Big Data” exogenous policy impact, dynamic SDM model, and other methods. Moreover, spatial heterogeneity exists. The promotion effect in the upper and lower reaches is stronger, while the middle reaches are weakly affected by the digital economy. (3) The spatial spillover effect of the digital economy on common prosperity has a boundary, and the positive spillover reaches a maximum value at 600–650 KM. (4) Nonlinear analysis confirms that the digital economy provides momentum for common prosperity industrial structure optimization that can effectively stimulate the “endogenous” growth mechanism, strengthen the marginal increasing effect of the digital economy driving common prosperity and enhance the effect of “making a bigger pie”. The digital economy makes effective use of digital resources and technologies, promotes the equalization of public services, exerts a positive impact on the realization of common prosperity, and consolidates the effect of “dividing a better cake”.