Urban digital infrastructure is the cornerstone of optimizing resource allocation and promoting sustainable economic development in the era of digital economy, and it will also affect corporate ESG performance. Based on the data of Chinese A-share listed companies from 2011 to 2021, an asymptotic difference-in-difference model is used to investigate the impact of urban digital infrastructure on corporate ESG performance based on the “broadband China” strategy and its underlying mechanism. This paper finds that urban digital infrastructure can promote corporate ESG performance. Further, urban digital infrastructure can contribute to corporate ESG performance by increasing research and development (R&D) investment, improving corporate governance, and increasing information transparency. Through heterogeneity analysis, the results show urban digital infrastructure contributes more significantly to the ESG performance of state-owned, small and medium, growth-stage, and low-profit companies and is more pronounced in non-heavy polluting companies and companies in the central and western regions. This paper has enhanced the theoretical framework of urban digital infrastructure and corporate ESG (environmental, social, and governance) performance, paving the way for a new approach to the collaborative development of cities and enterprises in pursuit of green and sustainable growth.