Multiple sclerosis (MS) is an autoimmune disease characterized by inflammatory demyelination occurring in the central nervous system (CNS). Inulin is a common prebiotic that can improve metabolic disorders by modulating the gut microbiota. However, its capacity to affect CNS autoimmunity is poorly recognized. Experimental autoimmune encephalomyelitis (EAE) is a classical mouse model of MS. Herein, we found that oral administration of inulin ameliorated the severity EAE in mice, accompanied by reductions in inflammatory cell infiltration and demyelination in the CNS. These reductions were associated with decreased proportion and numbers of Th17 cells in brain and spleen. Consistent with the findings, the serum concentrations of IL-17, IL-6, and TNF-α were reduced in inulin treated EAE mice. Moreover, the proliferation of auto-reactive lymphocytes, against MOG 35-55 antigen, was attenuated ex vivo. Mechanistically, inulin treatment altered the composition of gut microbiota. It increased Lactobacillus and Dubosiella whereas decreased g_ Prevotellaceae_NK3B31_group at the genus level, alongside with elevated concentration of butyric acid in fecal content and serum. In vitro, butyrate, but not inulin, could inhibit the activation of MOG 35-55 stimulated lymphocytes. Furthermore, fecal microbiota transplantation assay confirmed that fecal contents of inulin-treated normal mice had an ameliorative effect on EAE mice. In contrast, antibiotic cocktail (ABX) treatment diminished the therapeutic effect of inulin in EAE mice as well as the reduction of Th17 cells, while supplementation with Lactobacillus reuteri restored the amelioration effect. These results confirmed that the attenuation of inulin on Th17 cells and inflammatory demyelination in EAE mice was dependent on its modulation on gut microbiota and metabolites. Our findings provide a potential therapeutic regimen for prebiotic inulin supplementation in patients with multiple sclerosis.