BackgroundThe digital economy based on the internet and IT is developing rapidly in China, which makes a profound impact on urban environmental quality and residents’ health activities. Thus, this study introduces environmental pollution as a mediating variable based on Grossman’s health production function to explore the impact of digital economic development on the health of the population and its influence path.MethodsBased on the panel data of 279 prefecture-level cities in China from 2011 to 2017, this paper investigates the acting mechanism of digital economic development on residents’ health by employing a combination of mediating effects model and spatial Durbin model.ResultsThe development of digital economy makes direct improvement on residents’ health condition, which is also obtained indirectly by means of environmental pollution mitigation. Besides, from the perspective of spatial spillover effect, the development of digital economy also has a significant promoting effect on the health of adjacent urban residents, and further analysis reveals that the promoting effect in the central and western regions of China is more pronounced than that in the eastern region.ConclusionsDigital economy can have a direct promoting effect on the health of residents, and environmental pollution has an intermediary effect between digital economy and residents’ health; At the same time, there is also a regional heterogeneity among the three relationships. Therefore, this paper believes that the government should continue to formulate and implement scientific digital economy development policies at the macro and micro levels to narrow the regional digital divide, improve environmental quality and enhance the health level of residents.