This study investigates the impact of digital capability on green innovation and its moderating mechanism. The results show that a firm's digital capability has a significant inverted U-shaped effect on its green innovation, thereby confirming the existence of non-linear changes in the green innovation process. Moreover, organizational slack and executive education can moderate the relationship between digital capability and green innovation, with available slack, recoverable slack or executive education having a positive effect, and potential slack having a negative effect. Further study shows that digital capability of private firms, foreign firms or firms in the eastern region has a greater impact on green innovation than that of state-owned firms, local firms or firms in the central and western regions. Additionally, digital capability contributes to the economic value transformation of green innovation, but environmental performance improved by green innovation does not significantly depend on digital capability. Based on these findings, policy implications of improving green innovation are discussed.