The digital economy has become a new type of economic form, which profoundly affects the development of the real economy, presumes changes in the economy, and accelerates the construction of China's new "double-cycle" development pattern. This paper adopts the principal component analysis method to measure the level of digital economy of the host country on five indicators, including fixed telephone coverage, fixed broadband coverage, Internet user ratio, higher education enrolment rate and mobile phone coverage. The measurement results found that the digital economy level of RCEP host countries has a large gap, and the mean value is negative. Based on the panel data of RCEP14 countries from 2003 to 2022, this paper incorporates the comprehensive indicators of digital economy into the gravity model, and concludes that the level of digital economy of RCEP host countries significantly promotes the development of China's OFDI through the bidirectional fixed effect estimation method. The conclusion is of great significance for Chinese enterprises to invest in RCEP countries.