The composition of the gut microbiota is influenced by sex hormones and colorectal cancer (CRC). Previously, we reported that 17β-estradiol (E2) inhibits azoxymethane/dextran sulfate sodium (AOM/DSS)-induced tumorigenesis in male mice. Here, we investigated whether the composition of the gut microbiota is different between male and female, and is regulated by estrogen as a secondary outcome of previous studies. We established four groups of mice based on the sex and estrogen status [ovariectomized (OVX) female and E2-treated male]. Additionally, three groups of males were established by treating them with AOM/DSS, and E2, after subjecting them to AOM/DSS treatment. The mice were sacrificed at 21 weeks old. The composition of the gut microbiota was analyzed using 16S rRNA metagenomics sequencing. We observed a significant increase in the microbial diversity (Chao1 index) in females, males supplemented with E2, and males treated with AOM/DSS/E2 compared with normal males. In normal physiological condition, sex difference and E2 treatment did not affect the ratio of Firmicutes/Bacteroidetes (F/B). However, in AOM/DSS-treated male mice, E2 supplementation showed significantly lower level of the F/B ratio. The ratio of commensal bacteria to opportunistic pathogens was higher in females and E2-treated males compared to normal males and females subjected to OVX. Unexpectedly, this ratio was higher in the AOM/DSS group than that determined in other males and the AOM/DSS/E2 group. Our findings suggest that estrogen alters the gut microbiota in ICR (CrljOri:CD1) mice, particularly AOM/DSS-treated males, by decreasing the F/B ratio and changing Shannon and Simpson index by supply of estrogen. This highlights another possibility that estrogen could cause changes in the gut microbiota, thereby reducing the risk of developing CRC.