This study comprises an empirical analysis of how digital transformation affects environmental performance after constructing a multidimensional evaluation framework to measure environmental performance. It used firm-level panel data of Chinese listed companies in heavy-pollution industries obtained from the China Stock Market & Accounting Research (CSMAR) database from 2010 to 2020. We found that the impact of digital transformation on enterprises’ environmental performance shows a significant U-shaped non-linear feature moderated by environmental disclosure, including the channel and quality. We also found that green innovation has a significant single-threshold effect on non-linear relationships. Furthermore, heterogeneity examination showed that the digital transformation of production and warehousing can promote environmental performance more effectively. Overall, our findings provide implications for exploring the unexplored field of environmental management through digital transformation, concerning both heavy-polluting enterprises and government regulators, to achieve carbon peaking and carbon neutrality goals.