Abstract In this paper, China A-share listed companies from 2011 to 2021 are selected as research samples, and ESG (Environment, Society and Corporate Governance) rating is used to measure the ESG performance of enterprises. On this basis, a panel data model is constructed to empirically study the impact of ESG performance on total factor productivity and its mechanism, and further study the heterogeneity of this impact. The results show that good ESG performance can promote the improvement of total factor productivity, and this conclusion is still valid after a series of robustness tests, such as replacing the measurement method of explanatory variables, using instrumental variables to alleviate possible endogenous problems, and Heckman two-stage method to overcome sample selection errors. The research on the mechanism of action indicates that the good ESG performance of enterprises mainly improves the total factor productivity of enterprises by alleviate financing constraints and increase R&D investment. The results of heterogeneity analysis show that the effect of good ESG performance on total factor productivity is more significant in large-scale enterprises and state-owned enterprises. The research conclusion has important reference significance for enterprises to strengthen ESG construction, strengthen ESG information disclosure, ease financing constraints and increase R&D investment, improve enterprise total factor productivity, and then promote high-quality economic development.