China is undergoing an urbanization process at an unprecedented scale, and low-carbon urban development is of great significance to the completion of the “dual carbon goals”. At the same time, the digital economy has become an important engine for urban development, and its role in environmental improvement has become increasingly prominent. While the digital economy is booming, can it promote the low-carbon development of cities? Based on the panel data of 278 cities in China from 2011 to 2019, this paper discusses the impact of the digital economy on carbon emissions and the long-term development trend between the digital economy and carbon emissions, the impact of differences in the development level of the digital economy on carbon emissions reduction, and the impact of green energy efficiency in the relationship between the digital economy and carbon emissions. The results show that the digital economy has a significant inhibitory effect on carbon emissions, and with the development of the digital economy, more and more cities show an absolute decoupling of the digital economy and carbon emissions and are turning to low-carbon development. The development level of the digital economy has a heterogeneous impact on carbon emissions. With the improvement of the development level of the digital economy, the effect on emission reduction is more significant. As a threshold variable, green energy efficiency affects the relationship between digital economy and carbon emissions. When green energy efficiency is low, the digital economy promotes carbon emissions, and when green energy efficiency is high, the digital economy reduces carbon emissions.