We utilize a rich dataset of manufacturing firms to investigate the heterogeneous effects of ISO 14001 on the financial performance of certified firms. We employ machine learning techniques, specifically causal tree and causal forest, to uncover these effects. Our findings reveal consistently positive average effects of ISO 14001 certification on sales revenue across all categories of firms. However, when it comes to profitability, we observe significant heterogeneity in the impact of ISO 14001 certification. Specifically, ISO 14001 certification spurs profitability gains among more innovative firms with lower debt-to-equity ratios, among firms that are more reliant on exports, and those that operate outside the electronic component industry. Conversely, firms with a large debt-to-equity ratio and those that are privately held experience negative effects of ISO 14001 certification on profitability. Our study contributes to the literature examining how environmental sustainability programs, such as ISO 14001, affect firm financial performance in a heterogeneous manner. By uncovering the nuanced effects of ISO 14001 certification based on firm characteristics, our research provides valuable insights that can assist in optimizing the outcomes of similar environmental programs by tailoring strategies based on specific firm attributes.