Endometriosis (EMT) has a significant impact on women’s physical and mental health. In this study, high-throughput sequencing technology was employed to detect differences in gut microbiota between EMT patients and healthy individuals (CTL). Additionally, Spearman correlation analysis was utilized to analyze the correlation between different bacterial genera and EMT biomarkers (CA125 and CA199). The results demonstrated that at the phylum level, the relative abundances of Proteobacteria and Desulfobacterota_G_459546 in the EMT group were significantly higher than those in the CTL group, while the relative abundances of Bacteroidota and Firmicutes_A in the EMT group were significantly lower than those in the CTL group. At the genus level, the relative abundances of Burkholderiales and Sphingomonadales in the EMT group were significantly higher than those in the CTL group, while the relative abundances of Bacteroidales and Roseburia in the EMT group were significantly lower than those in the CTL group. The correlation analysis results show that CA125 and CA199 are significantly positively correlated with Burkholderiales and Sphingomonadales, and significantly negatively correlated with Bacteroidales, Oscillospirales, and Roseburia. The PICRUSt2 results show that the relative abundance in the cell motility and xenobiotics biodegradation and metabolism pathways in the EMT group was higher than that in the CTL group, while the relative abundance in the translation, replication and repair, folding, sorting and degradation, metabolism of terpenoids and polyketides and metabolism of cofactors and vitamins pathways in the EMT group was lower than that in the CTL group. In brief, there is a close correlation between the imbalance of gut microbiota and the onset of EMT. The intestinal microbiota has great significance broad prospects for the prevention, diagnosis and treatment of EMT.