As a new way of promoting high-quality economic development, whether the digital economy can enhance energy use efficiency by improving resource allocation is of great practical significance to global energy conservation and emission reduction efforts. This research employs principal component analysis and slacks-based measure data envelopment analysis in a case study of 30 provinces in China between 2014 and 2020 to evaluate the digital economy and energy efficiency. The analysis explores how the digital economy impacts energy efficiency, considering direct impacts, mediating effects, and their nonlinear relationship. The findings indicate a declining trend in China’s energy efficiency before it starts to moderate. The digital economy can boost energy efficiency by encouraging industry upgrades and reducing labor mismatches. The threshold regression model reveals that when the capital mismatch level exceeds 0.8871, the digital economy adds considerably to energy efficiency. The study’s findings confirm the linear and nonlinear energy efficiency impact trajectories of the digital economy, offering useful references for sustainable development policymaking.