Given the "dual-carbon" goals of China, research has been carried out on the impact of the digital economy on carbon emission intensity. Based on the panel data of the 288 cities in China from 2013 to 2022, a two-way fixed-effects model is employed in this paper to study how the digital economy affects carbon emission intensity at the level of cities and urban agglomerations. The results show that the development of the digital economy reduces the intensity of urban carbon emissions, and there is cross-regional spatial spillover at the level of urban agglomerations. According to the results of the mechanism test, there are two paths for "industry-technology" transmission: At the city level, the digital economy can reduce pollution by improving the structure and upgrades of the industrial system; At the level of urban agglomeration, it can strengthen green-technology innovation capabilities. According to the analysis of heterogeneity, polycentric agglomeration, optimisation-and-upgrading type agglomeration and coastal areas have relatively good carbon reduction effects. Based on the above, personalised regional policies will be formulated to promote the development of the digital economy in line with carbon reduction objectives.