Microsporidiosis, a disease caused by microsporidia, affects many animals, with symptoms ranging from diarrhea to death, especially in immunocompromised individuals. Current treatments, such as the drugs albendazole and fumagillin, are limited in efficacy. To address this problem, we utilized Caenorhabditis elegans infected with its naturally occurring microsporidian parasite Nematocida parisii to evaluate 4,080 structurally diverse compounds from the Boston University Center for Molecular Discovery (BU-CMD) chemical library. From this screen, we identified 34 compounds that restored the reproductive capacity of C. elegans. We chose 17 compounds for additional validation experiments and all of them prevented N. parisii infection in C. elegans, with 10 of these capable of suppressing microsporidia invasion by inactivating mature spores. Additionally, five of the identified compounds were effective against Pancytospora epiphaga, a species related to human-infecting microsporidia. Together this work identifies and characterizes compounds that inhibit microsporidia infection.