Zanthoxylum schinifolium has been used as spices and traditional medicine in China for hundreds of years. A variety of active substances have been isolated from Zanthoxylum schinifolium using biological and chemical techniques. Among these substances, the effect of schinifoline has gradually attracted much attention. Candida albicans is one of the most common pathogens isolated from the gastrointestinal tract, vagina, and mouth in healthy individuals. In a healthy population, there are various mechanisms in host, such as the microbial flora, the epithelial barriers, and the innate immune system, that can control the presence of Candida albicans. However, when host immunity is compromised, an invasive fungal infection is more likely to occur. In this study, we explored the antifungal activity of schinifoline against Candida albicans in Caenorhabditis elegans. To determine the optimal concentration of schinifoline, we investigated the lifespan, defecation cycle and locomotion behavior of Caenorhabditis elegans after treatment with schinifoline. In addition, we examined colony formation in the intestine of Caenorhabditis elegans after Candida albicans infection. The results indicated that 100 and 200 mg/L of schinifoline could prolonged the lifespan, shorten the defecation cycle and increased the locomotion behavior of Caenorhabditis elegans, with 100 mg/L of schinifoline being the optimal concentration. Moreover, 100 mg/L of schinifoline increased the lifespan of Caenorhabditis elegans after infection and inhibited the colony formation of Candida albicans in Caenorhabditis elegans intestine. Therefore, we concluded that schinifoline exhibits anti-fungal effects and its potential use as natural drugs should be further explored in future studies.