Pituitary adenoma (PA) includes invasive pituitary adenoma (IPA) and noninvasive pituitary adenoma (NIPA), which are associated with the endocrine system. The gut microbiome plays an important role in human metabolism, but the association between the gut microbiome and pituitary adenoma remains unclear. A total of 44 subjects were enrolled in this study. Of these, 29 PA patients were further divided into IPA patients (n = 13) and NIPA patients (n = 16), while 15 healthy age-matched subjects were defined as control subjects. We collected faecal samples and characterized the gut microbial profiles by metagenomic sequencing using the Illumina X-ten platform. PLS-DA showed different microbial clusters among the three groups, and slightly different microbial ecological networks were observed. LEfSe analysis revealed significant alterations in the microbial community among PA patients. In particular, the enrichment of Clostridium innocuum, along with the reduced abundance of Oscillibacter sp. 57_20 and Fusobacterium mortiferum, were observed both in the IPA and NIPA groups compared to the control group. Moreover, PA patients could be effectively classified based on these bacteria using a support vector machine algorithm. In summary, this study demonstrated significant differences in the gut microbiome between PA patients and healthy controls. Future mechanistic experiments are needed to determine whether such alterations are a cause or consequence of pituitary adenoma.