The convergence of economic growth and environmental preservation has become a crucial objective for governments worldwide. As the digital economy helps transform industries, its carbon-reducing effect has been continuously validated. Technological innovation, policy support, and the promotion of trade openness are ways to encourage the greening of the digital economy. Currently, China is vigorously building a national e-commerce demonstration zone (EDZ). Hence, the main purpose of this study is to explore how e-commerce, as an important part of the digital economy, can help reduce carbon emissions (CE). Based on the panel data of 276 prefecture-level cities in China from 2007 to 2019, the empirical results obtained under the difference-in-difference model are that the establishment of EDZs can bring 0.0463 units of reduction in CE. The effect of suppressing CE is more significant for some regions located in the west, with larger city sizes and relatively scarce resource endowments. Distinguishing from the common paths of industrial structure, technological innovation, and optimal allocation of resources, this study also reveals the regulating role of economic openness in the mechanism analysis and finds that increasing foreign direct investment can effectively promote EDZs to reduce CE. The findings of this paper emphasize the practical significance of EDZs for energy saving and emission reduction, promoting green and high-quality development, and provide valuable references for managers and policy makers.