Cholecystectomy, surgical removal of the gallbladder, changes bile flow to the intestine and can therefore alter the bidirectional interactions between bile acids (BAs) and the intestinal microbiota. We quantified and correlated BAs and bacterial community composition in gallstone patients scheduled for cholecystectomy before and after the procedure, using gas-liquid chromatography and 16S rRNA amplicon sequencing, followed by quantitative real-time polymerase chain reaction of the phylum Bacteroidetes. Gallstone patients had higher overall concentrations of faecal BAs and a decreased microbial diversity, accompanied by a reduction in the beneficial genus Roseburia and an enrichment of the uncultivated genus Oscillospira, compared with controls. These two genera may thus serve as biomarkers for symptomatic gallstone formation. Oscillospira was correlated positively with secondary BAs and negatively with primary BAs, while the phylum Bacteroidetes showed an opposite trend. Cholecystectomy resulted in no substantial change in patients' faecal BAs. However, bacterial composition was significantly altered, with a significant increase in the phylum Bacteroidetes. Given that cholecystectomy has been associated with a higher risk of colorectal cancer and that members of the Bacteroidetes are increased in that disease, microbial consequences of cholecystectomy should be further explored.