This paper explores the impact of Confucian influence on corporate environmental innovation in China. We find a positive association between the degree of Confucian influence and firms' environmental innovation outputs. The incremental effect of Confucianism is more pronounced in firms under a strong Confucian cultural identity. We then show that Confucianism reinforces environmental legitimacy required by local regulators and socially responsible institutional investors, which explains different investment behaviors in environmental innovation of firms with distinct exposure to Confucianism. Further evidence reveals that Confucianism enhances environmental patents' value-added function, and firms under a strong Confucian influence exhibit salient ESG performance. Our empirical findings suggest that Confucianism motivates firms to invest more in environmental innovations to obtain ecological legitimacy.