The strategic adoption of digital technologies has increasingly been recognized as a crucial driver of cost reduction and operational efficiency in enterprises. It optimizes production processes and promotes sustainable growth. In this context, understanding the specific impact of digital transformation on enterprises’ environmental, social, and governance (ESG) performance holds significant practical value for promoting sustainable development in China’s economy and society. This study focused on Chinese A-share listed enterprises from 2010 to 2022, specifically exploring the role of digital transformation in enhancing ESG performance from the perspective of human capital. Our findings reveal that digital transformation significantly augments their ESG performance. Notably, the improvements are more pronounced in non-state-owned enterprises compared to state-owned ones. Specifically, digital transformation initiatives contribute to ESG performance enhancement by increasing the extent of high-quality labor and elevating the skill levels of the existing workforce. Furthermore, environmental regulation moderates the positive impact of corporate digital transformation on the quantity and skill level of labor, thus influencing firm-level ESG performance. The study sheds light on the transformative role of digital transformation and its implications for ESG performance improvement by elucidating the mechanisms through which digital transformation affects human capital and interacts with regulatory environments.