Using a city-level panel data set with 283 cities in China, this study applies a fixed effect model to estimate the effects of the digital economy on carbon emissions, along with the contribution of green technology innovation. It shows that the digital economy can not only directly decrease carbon emissions, but also reduce them through promoting green technology innovation. Moreover, the effects are heterogeneous among cities in different geographic locations and administrative levels, as well as policy shocks. In particular, the carbon reduction effect of the digital economy is greater for cities in the eastern coastal region, cities at higher administrative levels, and cities enjoying the Big Data Pilot Zone policy. The findings that the digital economy can help prompt green technology innovation and reduce carbon emissions have implications for developing countries with similar characteristics to China to promote sustainable development.