Abstract:China’s economic development has shifted from high-speed growth to high-quality development, and improving total factor productivity is the key to achieving high-quality economic development. As the microentities of economic operation, enterprises need to enhance their total factor productivity, which is an inevitable requirement for high-quality economic development. This paper takes A-share listed companies from 2012 to 2022 as samples to analyze the relationship between digital transformation and total factor productivity and the effect of ESG performance in this relationship. The results show that digital transformation significantly improves total factor productivity, and ESG performance plays a mediating role, especially in the environmental and social dimensions. Further research finds that for state-owned enterprises and enterprises in the western, central, and northeastern regions, the effect of digital transformation on improving total factor productivity is more obvious. Based on this, the paper points out that enterprises should take digital transformation as an innovation driving force, with state-owned enterprises leading the way, and enterprises in the western, central, and northeastern regions catching up. Regulatory authorities should introduce incentive policies and evaluation methods to promote enterprises’ digital transformation and optimize their ESG performance. Stakeholders, represented by investors, should make efforts to promote enterprises’ digital transformation to jointly drive the high-quality development of enterprises and the overall economy.