Objective: The gut microecosystem is the largest microecosystem in the human body and has been proven to be linked to neurological diseases. The main objective of this study was to characterize the fecal microbiome, investigate the differences between epilepsy patients and healthy controls, and evaluate the potential efficacy of the fecal microbiome as a diagnostic tool for epilepsy.Design: We collected 74 fecal samples from epilepsy patients (Eps, n = 24) and healthy controls (HCs, n = 50) in the First Affiliated Hospital of Zhengzhou University and subjected the samples to 16S rRNA MiSeq sequencing and analysis. We set up a train set and a test set, identified the optimal microbial markers for epilepsy after characterizing the gut microbiome in the former and built a diagnostic model, then validated it in the validation group.Results: There were significant differences in microbial communities between the two groups. The α-diversity of the HCs was higher than that of the epilepsy group, but the Venn diagram showed that there were more unique operational taxonomic unit (OTU) in the epilepsy group. At the phylum level, Proteobacteria and Actinobacteriota increased significantly in Eps, while the relative abundance of Bacteroidota increased in HCs. Compared with HCs, Eps were enriched in 23 genera, including Faecalibacterium, Escherichia-Shigella, Subdoligranulum and Enterobacteriaceae-unclassified. In contrast, 59 genera including Bacteroides, Megamonas, Prevotella, Lachnospiraceae-unclassified and Blautia increased in the HCs. In Spearman correlation analysis, age, WBC, RBC, PLT, ALB, CREA, TBIL, Hb and Urea were positively correlated with most of the different OTUs. Seizure-type, course and frequency are negatively correlated with most of the different OTUs. In addition, twenty-two optimal microbial markers were identified by a fivefold cross-validation of the random forest model. In the established train set and test set, the area under the curve was 0.9771 and 0.993, respectively.Conclusion: Our study was the first to characterize the gut microbiome of Eps and HCs in central China and demonstrate the potential efficacy of microbial markers as a noninvasive biological diagnostic tool for epilepsy.