Digital transformation in the energy sector is an essential tool for promoting the construction of a clean energy system in the post-COVID-19 era. Under the background of digital China strategy and sustainable energy transformation in the post-COVID-19 era, it is meaningful to investigate the relationship between the digital economy and green total factor energy efficiency (GTFEE) to better drive the development of the digital economy and improve GTFEE. For this purpose, this study estimates deeply the impact of the digital economy on GTFEE by applying ordinary least squares (OLS), panel vector autoregression (PVAR), panel threshold, and mediation effect models based on panel data of 30 Chinese provinces from 2006 to 2018. The statistical results indicate that digital economy is conducive to improving GTFEE. Digital economy can significantly contribute to GTFEE by improving economic growth level, urbanization level, R&D investment, and human capital. The most interesting finding was that there is also a non-linear relationship between digital economy and GTFEE. The effect of digital economy on GTFEE is shown to be first promoted and then inhibited as digital economy level continues to increase. Further, the positive impact of the digital economy on GTFEE is strengthened with increasing levels of economic growth, urbanization, R&D input, and human capital. Finally, A positive correlation was found between digital economy and GTFEE in the eastern and central regions, but insignificantly in other regions.