Opuntia ficus-indica is rich in a variety of active substances, such as anthocyanins, flavonoids, and polysaccharides. Some studies have shown that anthocyanins extracted from natural plants can regulate intestinal flora. The fruit was used as raw material, and anthocyanins were extracted from it. In vivo experiments were used to study the effect of Opuntia ficus-indica anthocyanins on the mouse intestine by 16S rRNA high-throughput sequencing (NovaSeq 6000 platform) and gas chromatography (hydrogen flame ionization detector (FID)) methods. Microbiota and effects of short-chain fatty acids (SCFAs). The results showed that after feeding anthocyanins, the diversity of intestinal microorganisms in mice was significantly increased (p < 0.05), the ratio of Firmicutes/Bacteroidetes (F/B value) was significantly decreased (p < 0.05), the relative abundances of beneficial bacteria Lactobacillus, Bifidobacterium, Prevotella, and Akkermansia in the intestinal tract of mice were significantly increased (p < 0.05), and the relative abundance of pathogenic bacteria Escherichia-Shigella and Desulfovibrio decreased significantly (p < 0.05). Furthermore, anthocyanins significantly increased the content of short-chain fatty acids in the cecum of mice, among which the content of acetic acid, propionic acid, and butyric acid increased the most. Opuntia ficus-indica anthocyanins can change the microbial diversity and flora composition of the mouse gut and promote the production of short-chain fatty acids. The findings provide a theoretical basis for the use of Opuntia ficus-indica anthocyanins as dietary supplements to regulate human intestinal flora.