Amid China’s goals to reach peak carbon emissions before 2030 and achieve carbon neutrality by 2060, along with its ecological civilization agenda, the synergy between the digital economy (DE) and environmental quality (EQ) in Chinese cities has become increasingly vital. Using panel data from 285 cities between 2016 and 2021, this study constructs an integrated framework to examine the level of coordinated development between the DE and EQ, measured through the coupling coordination degree (CCD) that captures the strength and harmony of their interaction. It further analyses spatial–temporal heterogeneity and influencing factors. The results reveal: (1) both the DE and EQ have improved steadily, with the CCD rising to a moderate level and showing clear spatial clustering; and (2) economic development, educational investment and industrial upgrading boost the CCD, whereas average years of education and government intervention may hinder it. Additionally, economic development and industrial upgrading have positive spatial spillovers, and a threshold effect of government intervention is observed.