Improving energy efficiency is crucial for achieving the carbon peaking and carbon neutrality goals. The digital economy, which is characterized by big data, artificial intelligence, the internet of things, and a new generation of mobile Internet, has quietly penetrated all aspects of the economy and society, profoundly changing the means of production and lives of human beings. Digital technologies have great potential to improve the global energy system's security, productivity, efficiency, and sustainability. Based on the panel data of 30 provinces in mainland China from 2006 to 2021, this study divided energy efficiency into total and single factor energy efficiency. The two-way fixed-effect model and the Driscol-Kraay method were used to adjust the standard error test in order to examine the impact of digital technology represented by industrial robots on energy efficiency and its path mechanism. Studies have shown that digital technology can significantly improve total factor energy efficiency and reduce energy intensity per unit of GDP. This conclusion was found to be still valid after the robustness test using feasible generalized least squares, time-varying difference in difference and fixed effect space Durbin model. The results of the mechanism test show that digital technology can improve energy efficiency by increasing the degree of industrial virtual agglomeration and the channels of foreign direct investment. This paper provides a valuable discussion on how information technology advances can improve energy efficiency in the era of the digital economy. The conclusions will help relevant market players to formulate policies and measures and corporate strategies to improve energy efficiency. At the same time, it also deepens the theoretical understanding and mechanism path of digital technology's impact on energy consumption.