China is committed to building a new development paradigm to realize Chinese modernization. Therefore, it is of great significance to delve into, from the standpoint of new quality productive forces (NQPF), how digital finance affects foreign investment. This study utilizes data from 31 Chinese provinces from 2011 to 2023 to ascertain the impact of digital finance on foreign investment. The findings indicate that digital finance exerts a significant and positive effect on foreign investment, with this effect being stronger in the central and western regions. With regard to transmission mechanism, digital finance can enhance foreign investment by improving regional NQPF, which has significant characteristics of regional heterogeneity. Further research makes a discovery that the outward foreign investment’s level in the central and western regions, is positively associated with the strength of digital finance’s effect on foreign investment, while the outward foreign investment’s level in the eastern regions, is negatively associated with the strength of digital finance’s effect on foreign investment. This research provides evidence for deepening digital finance’s development to promote foreign investment.