In current years, global climate risks have intensified significantly, causing profound impacts on corporate operations and regulatory environments. This paper takes China's heavy-polluting listed firms from 2010 to 2022 as a sample, establishes a firm-level climate risk index, and studies the impact of corporate climate risk on digital transformation. The empirical research based on a dual fixed effects model indicates that for every one standard deviation's increase in climate risk, the level of digital transformation will increase by 0.0314 standard deviations. This effect is achieved by reducing corporate fixed asset investment as well as increasing diversification. Furthermore, among the eight major energy-consuming industries, non-state-owned enterprises, and enterprises facing significant financing constraints, the promotion of the digital transformation in heavy-polluting enterprises is obvious due to climate risks. This study suggests that digital transformation is likely to be a conscious selection for enterprises to adapt themselves to climate change, implying that there exist enormous digital business opportunities in the current business practice of climate adaption. In addition, this study provides a brand-new perspective for understanding the relationship between digitization and greening, which has strategic significance for policy makers to jointly promote the coordinated transformation and development of digitization and greening.