The United Nations Development Summit in 2015 adopted the “2030 Agenda for Sustainable Development”, establishing a framework for Sustainable Development Goals (SDGs) with the aim of achieving coordinated economic, social, and ecological development worldwide by 2030. The “environmental, social, and governance” (ESG) approach is important within the concept of SDGs and is the subject of increasing attention from scholars. Despite China’s significant contributions to the SDGs, it still faces numerous challenges in terms of environmental and governance development. With the ongoing development of digital technology, many Chinese enterprises aspire to harness the dividends of digital transformation in order to achieve SDGs. In this study, we aim to help companies understand how they can improve their ESG performance through digital transformation. We use a sample of A-share listed companies in China from 2011 to 2020 to construct a digital transformation index by profiling the frequency of digital-related words in companies’ annual reports using textual analysis. Furthermore, we empirically examine the direct effect of digital transformation on companies’ level of ESG disclosure and explore the mediating effect of dynamic capabilities on the impact of digital transformation on ESG performance. Empirical testing reveals that digital transformation indeed has a positive impact on enterprises’ ESG performance, and digital technology innovation can enhance ESG performance through dynamic capabilities such as green innovation, social responsibility, and operational management. The findings indicate that companies need to actively develop and promote digital technologies to obtain the benefits of digital transformation, with company executives including advanced technology in their decision-making and operational processes in an effort to promote innovation and management efficiency, thereby improving their ESG performance.