Objective To investigate the effect of cholecystolithiasis with cholecystitis and cholecystectomy on intestinal flora in patients with colorectal cancer. Methods A total of 168 patients with colorectal cancer who admitted to the Department of Anorectal Surgery in Gansu Provincial Hospital from June 2020 to March 2021 were selected, and 29 patients with colorectal cancer who met the criteria were selected as the research objects, including 10 colorectal cancer patients with gallstones and cholecystitis (cholecystolithiasis with cholecystitis+colorectal cancer group), 10 colorectal cancer patients after cholecystectomy (cholecystectomy+colorectal cancer group), and 9 colorectal cancer patients with normal gallbladder (normal gallbladder+colorectal cancer group). Clinical data of the patients in three groups were collected and compared. The fresh fecal samples of the patients included in the study were collected, and the 16S rDNA high-throughput sequencing method was used to determine and analyze the composition and distribution of the intestinal flora in the obtained samples. Results The interleukin-6 level in the cholecystolithiasis with cholecystitis+colorectal cancer group was statistically higher than that in the normal gallbladder+colorectal cancer group and the cholecystectomy+colorectal cancer group (P<0.05). At the phylum level of the fecal flora in three groups patients: ① In the samples of three groups, the relative abundances of Bacteroidetes, Firmicutes, Proteobacteria, Fusobacteria and Verrucomicrobia phylums were all high, accounting for almost more than 95% of the total intestinal bacteria. ② The relative abundance of Fusobacteria phylum in the cholecystolithiasis with cholecystitis+colorectal cancer group was statistically higher than that in the normal gallbladder+colorectal cancer group (P<0.05). ③ The relative abundance of Verrucomicrobia phylum in the normal gallbladder+colorectal cancer group was statistically higher than that in the cholecystolithiasis with cholecystitis+colorectal cancer group and the cholecystectomy+colorectal cancer group (P<0.05). ④ The relative abundance of Synergistetes phylum in the cholecystectomy+colorectal cancer group was statistically higher than that in the cholecystolithiasis with cholecystitis+colorectal cancer group and the normal gallbladder+colorectal cancer group (P<0.05). At the genus level: ① The relative abundances of Bacteroidetes and Roseburia genus were lower in the gallstone with cholecystitis+colorectal cancer group than those in the cholecystectomy+colorectal cancer group and the normal gallbladder+colorectal cancer group (P<0.05). ② The relative abundance of Shigella genus in the cholecystectomy+colorectal cancer group was higher than that in the cholecystolithiasis with cholecystitis+colorectal cancer group (P<0.05). ③ The relative abundance of the Lachnospira genus in the cholecystolithiasis with cholecystitis+colorectal cancer group was lower than that in the normal gallbladder+colorectal cancer group (P<0.05). ④ The relative abundances of Prevotella and Fusobacteria genus were higher in the cholecystolithiasis with cholecystitis+colorectal cancer group than that in the cholecystectomy+colorectal cancer group and the normal gallbladder+colorectal cancer group (P<0.05). ⑤ The relative abundances of Clostridium and Akkermansia genus were lower in the cholecystolithiasis with cholecystitis+colorectal cancer group and the cholecystectomy+colorectal cancer group than that in the normal gallbladder+colorectal cancer group (P<0.05). ⑥ The relative abundance of Enterococcus genus was higher in the normal gallbladder+colorectal cancer group than that in the cholecystectomy+colorectal cancer group (P<0.05).Conclusions ① Long-term occurrence of cholecystolithiasis with cholecystitis can cause obvious decrease in the abundances of Bacteroides, Roseburia, Lachnospira, etc. ② Cholecystectomy can cause changes in the relative abundances of Clostridium, Enterococcus, Verrucomicrobia, Synergistetes, etc. ③ The relative abundance of Fusobacterium is obviously increased in colorectal cancer patients with gallstones and cholecystitis, then promotes the release of inflammatory cytokines and causes intestinal inflammation, which is conducive to the growth of opportunistic pathogens, thus may affect the occurrence and development of colorectal cancer.