E-commerce and other digital economies are emerging drivers for high-quality development in the Chinese economy. Based on the e-commerce plan in rural China, this paper investigates the effect of e-commerce development on the economic resilience of family farms, using data from 110,574 family farms in China from 2013 to 2021 and applying the staggered DID method. The results show that e-commerce development significantly enhances the resilience of family farms. Mechanism tests reveal that e-commerce policy substantially reduces the financing constraints of family farms and curbs underinvestment, thereby boosting their resilience. However, the effect on family farms with overinvestment is not significant. Additionally, the analysis of heterogeneity indicates that e-commerce has a greater impact on the resilience of family farms in areas with better institutional quality. Regarding the development status of the farm, the impact of e-commerce on resilience is greater in large-scale and capital-intensive family farms. Overall, this study sheds light on the actual impact of rural e-commerce in China on the economic resilience of family farms and offers valuable empirical insights for the revitalization of rural areas in developing countries.