The digital economy, which gradually emerged with a new generation of information technologies, has become an unavoidable reality for manufacturing firms in conducting green innovation activities. In this context, using matched panel data at the province and manufacturing firm levels in China during the period 2011-2019 as the sample, this article examines the nonlinear impact of the digital economy on firm green innovation, and further identifies the moderation mechanism of government quality and the heterogeneity of its effects. The two-way fixed-effects model reveals that there is not a simple linear association between the digital economy and firm green innovation as traditionally perceived, but rather an inverted U-shaped relationship that first promotes and then inhibits, which remains robust after applying endogenous and robustness tests. And most provinces have not yet crossed the inflection point; thus, the digital economy overall positively impacts green innovation. Further analysis shows that government quality positively moderates the relationship between the digital economy and firm green innovation, statistically reflecting that the turning point shifts upwards to the right under a higher-quality government. It is worth noting that, when heterogeneity in firm ownership, scale, and region is considered, the inverted U-shaped curve still exists, but the level of the digital economy at the inflection point differs, and the digital economy plays a greater role in promoting green innovation for state-owned, large-scale, or midwestern firms. This research has significant policy implications as it establishes an inverse U-shaped relationship between the digital economy and firm green innovation and indicates that while a firm's green patent output increases with the development of digitalization, it begins to decrease after a limit.