As ESG (environmental, social, and corporate governance) is consistent with the spirit of sustainable development, it is useful to elevate ESG performance to realize the sustainable development of enterprise and society. Using the data of Chinese A-share listed firms in the period of 2011 to 2019, this paper takes the National Big Data Comprehensive Pilot Zone policy as a quasi-natural experiment and uses the difference-in-differences method to assess the effect of digital economy development on ESG performance. This paper reveals the following: (1) the digital economy can facilitate ESG performance; (2) digitalization of the economy helps enterprises to propel digital transformation, which in turn lifts ESG performance; (3) digital economy development has a deeper impact on private enterprises, especially for those in China’s capital cities; and (4) digital economy development moderates the inhibiting effect of ESG performance on corporate financial constraints. The findings of this paper indicate that digitalization of the economy can help to achieve sustainable development.