Environmental penalties play an important role in global environmental governance and are a major force driving enterprise environmental compliance. This study explores the impact of environmental penalties on enterprise digitalization based on the challenge-threat theory, involving empirical analysis of 2008 - 2020 panel data. The findings indicate an inverted U-shaped nonlinear relationship between environmental penalties and enterprise digitalization. First, the inflection point of environmental penalties is 4.775. When the intensity of environmental penalties is below 4.775, an increase in environmental penalties has a positive effect on enterprise digitalization. Conversely, when the intensity is above 4.775, an increase in environmental penalties has a negative effect on enterprise digitalization. This means that for enterprises with locations with environmental penalties below 4.775, their decision makers can enjoy the positive effects of environmental penalties; for enterprises with locations with environmental penalties above 4.775, their decision makers will need to adopt a hedging mechanism to mitigate the negative effects of environmental penalties. Second, the impact of environmental penalties on enterprise digitalization can be described as a double effect: the facilitating effect lies in the fact that cash flow volatility is detrimental to enterprise digitalization, and environmental penalties reduce enterprise's cash flow volatility, thus facilitating digitalization. The disincentive effect lies in the fact that long-term investment facilitates enterprise digitalization, and environmental penalties reduce long-term investment, thus disincentivizing enterprise digitalization. Third, there is significant heterogeneity in the impact of environmental penalties on enterprise digitalization. In particular, there is a greater inflection point in environmental penalties for enterprises with dual leadership roles and registered in economically developed cities.