Purpose According to reputation theory, enterprises that adopt a proactive approach to corporate social responsibility (CSR) are known to actively invest in corporate innovation. However, this theory does not fully explain the mechanisms through which CSR influences corporate innovation, nor does it address how to effectively amplify CSR’s positive impact on innovation. To overcome these limitations, this research aims to incorporate the theories of innovation investment and dynamic capabilities. Innovation investment theory elucidates how CSR can attract additional financing, which can be directed toward innovation activities. Meanwhile, dynamic capabilities theory highlights how digital transformation in enterprises can enhance the positive effects of CSR on innovation, providing insights from both theoretical and empirical perspectives. Design/methodology/approach To demonstrate the mediating role of debt financing costs and the moderating role of enterprise digital transformation in the mechanism of CSR on corporate innovation, this research conducts fixes effects models by collecting 27,912 data points from 3,775A-share China-listed enterprises, ranging in period from 2010 to 2020. Empirical research once again proves that the theories of innovation investment and dynamic capabilities effectively compensates for the shortcomings of reputation theory. These three theories effectively explain that what is the effect of CSR on enterprise innovation? How does CSR influence corporate innovation? And through what mechanisms can CSR better enhance corporate innovation? Findings According to innovation investment theory, the cost of debt financing mediates the positive relationship between CSR and corporate innovation. This occurs because enterprises with robust CSR practices are more likely to secure external funding, thereby reducing their costs associated with external debt financing. Lower debt financing costs provide a stable source of funds for corporate innovation. Additionally, dynamic capability theory suggests that enterprise digital transformation moderates the positive relationship between CSR and corporate innovation. Building on these insights, it is recommended that enterprises, especially state-owned ones, should prioritize technological innovation to enhance their competitiveness. Research limitations/implications This research aims to address and narrow the knowledge gap regarding the relation between CSR and corporate innovation through theoretical and empirical analyses. With respect to the influence mechanism, this research solely based on innovation investment theory and dynamic capabilities theory, focuses on the influence mechanism of CSR on corporate innovation, with the debt financing costs as the mediating variable and digital transformation as the moderating variable. However, the influence mechanism turns out to be complicated and there is room for further exploring numerous mechanisms. For example, future research can focus on identifying additional channels through which CSR exerts an influence on corporate innovation based on TOE theoretical framework. Practical implications This research presents several strategies to enhance corporate innovation based on its conclusions: First, enterprises should promptly publish social responsibility reports to build a positive industry reputation. Moreover, by actively participating in CSR activities, they can strengthen their networks and enhance their industry standing. Second, the significant mediating role of debt financing costs should not be ignored. Enterprises are encouraged to seek diverse financing channels to reduce financial pressures, address financing challenges and facilitate the coordinated development of CSR and innovation. Third, enterprise digital transformation significantly affects the impact of CSR on innovation. Therefore, enterprises should advance digital transformation initiatives that incorporate technological innovation, organizational improvements and integration with supply chain partners. Finally, it has been noted that state-owned enterprises are often less responsive to technological innovation than their non-state counterparts. SOEs could redefine the scope and priorities of their social responsibilities to prevent excessive resource consumption that could hinder innovation. For instance, integrating some of their social responsibilities with innovation projects could promote both social and technological innovation objectives. Additionally, the government could ensure fair resource distribution among different types of enterprises and provide an equitable financing platform to mitigate financial challenges for both state-owned and non-state-owned enterprises. Originality/value Reputation theory does not fully elucidate the mechanisms by which CSR influences corporate innovation or how to effectively enhance CSR’s positive impact on innovation. This research integrates the theories of innovation investment and dynamic capabilities to address these gaps. According to innovation investment theory, debt financing costs mediate the positive relationship between CSR and corporate innovation. Meanwhile, dynamic capabilities theory posits that enterprise digital transformation moderates this positive relationship, further strengthening the impact of CSR on innovation.