Gut microbiota is crucial to primate survival. Data on the gut microbiota of captive and wild animals can provide a physiological and ecological basis for the conservation of rare and endangered species. To study the effect of captivity on the gut microbiota, we examine the difference in the gut microbiota composition between captive and wild Francois' langurs (Trachypithecus francoisi), using 16S rRNA sequencing technology. The results showed that the composition of the gut microbiota of captive and wild langurs was characterized by Firmicutes (51.93 ± 10.07% vs. 76.15 ± 8.37%) and Bacteroidetes (32.43 ± 10.00% vs. 4.82 ± 1.41%) at the phylum level and was characterized by Oscillospiraceae (15.80 ± 5.19% vs. 30.21 ± 4.87%) at the family level. The alpha diversity of gut microbiota in captive langurs was higher than those in wild, such as the Shannon index (4.45 ± 0.33 vs. 3.98 ± 0.19,P< 0.001) andinvSimpson index (35.11 ± 15.63 vs. 19.02 ± 4.87,P< 0.001). Principal coordinates analysis (PCoA) results showed significant differences in the composition of gut microbiota between captive and wild langurs at both the phylum and family levels (weight UniFrac algorithm, phylum level:R2= 0.748,P= 0.001; family level:R2= 0.685,P= 0.001). The relative abundance of Firmicutes (51.93 ± 10.07%) in captive langurs was lower than that of wild langurs (76.15 ± 8.37%), and the relative abundance of Bacteroidetes (32.43 ± 10.00%) in captive langurs was higher than that of wild (4.82 ± 1.41%). Our study concludes that dietary composition could be a crucial determinant in shaping the gut microbiota of langurs because more fiber-rich foods used by the wild langurs could increase the abundance of Firmicutes, and more simple carbohydrate-rich foods consumed by the captive langurs increase the abundance of Bacteroidetes. We highlight the importance of captivity on the gut microbiota and the need to consider the gut microbiota in animal provision.