Previous research has yielded varied conclusions regarding the effect of business environment (BE) optimization to improve carbon emission efficiency (CEE). In this study, CEE and BE are assessed using energy consumption and economic growth data from 30 provinces in China. The research employs fixed effects, quantile, and mediation effect models to analyze the direct impact, nonlinear characteristics, mechanism, and heterogeneity of BE on CEE. The research found that. Firstly, the BE optimization enhances CEE, with a 1% increase leading to a 0.095% improvement in CEE. Secondly, the influence of the BE on CEE exhibits marginal diminishing traits that decline as CEE improves. Thirdly, the analysis of mechanisms reveals that the BE primarily impacts CEE through positive mechanisms such as industrial structure optimization and green technology progress, as well as a negative mechanism known as the energy rebound effect. Lastly, the analysis of heterogeneity indicates that the BE exerts a more substantial influence on CEE in regions characterized by robust government governance, younger officials, and highly educated officials. These findings offer valuable insights for local governments seeking to leverage the BE to enhance energy efficiency and foster sustainable development.