Background The aim of this study is to investigate the composition of microbiota in biliary tract cancer patients and healthy adults by metagenome analysis and evaluate its potential values as biomarkers for biliary tract cancer. Methods Patients who were diagnosed with biliary tract cancer or benign inflammation were enrolled in this study. The control group consisted of healthy adults who presented with no history of significant medical issues. We isolated bacteria-derived extracellular vesicles in the plasma. The microbiome composition was investigated with 16S rDNA metagenome analysis. We evaluated each microbiome to ensure suitability for the biliary tract cancer prediction model. Results A total of 155 patients were included in this study: 24 patients with diagnosed biliary tract cancers, 43 diagnosed with cholecystitis or cholangitis, and 88 healthy adults. The microbiome composition pattern of the biliary tract cancer differed from the microbiome composition pattern seen in healthy adult group in beta diversity analysis. The percent composition of microbiota was found to be different from the phylum to genus level. Differences in the composition of the Bifidobacteriaceae and Pseudomonaceae families and Corynebacteriaceae Corynebacterium, Oxalobacteraceae Ralstonia and Comamonadaceae Comamonas species may be used to develop predictive models for biliary tract cancer. Conclusion Biliary tract cancer patients have altered microbiome composition, which represents a promising biomarker to differentiate malignant biliary tract disease from normal control group.