The aim of this study was to evaluate the effects of three different kinds of oligosaccharides (a fructo-oligosaccharide (FOS) formulation consisting of 95% FOS (FOS95); a galacto-oligosaccharide (GOS) formulation consisting of 90% GOS (GOS90) and an isomalto-oligosaccharide (IMO) formulation consisting of 90% IMO (IMO90)) at dosages of 0.8, 4 g per d per kg bw and 8 g per d per kg bw on the composition and activity of the microbiota in the gut of mice with constipation induced by loperamide. Oligosaccharides were intragastrically administered to specific pathogen-free BALB/c mice once per day for 17 days. Feces were collected during a feeding trial and subjected to 16S rDNA amplicon analysis. Constipation indices, changes in gut microbiota and metabolic activity were measured to evaluate the effects of the oligosaccharides. The results show that oligosaccharides treated constipation by increasing both the water content of the feces and the small intestinal transit rate. The dosage required to treat constipation was different for different oligosaccharides. High-dose GOS90 was the most effective in relieving constipation, followed by medium-dose FOS95 and IMO90. The fecal samples were investigated after the oligosaccharide treatment. All three oligosaccharides increased the ratio of acetic acid and decreased the ratio of propionic and butyric acids in the feces. The increase in the ratio of acetic acid and the concentration of butyric acid were found to have relatively larger effects on constipation. After treatment with oligosaccharides, the gut microbiotas of the mice were dominated by Firmicutes, Bacteroidetes and Actinobacteria. At the genus level, oligosaccharide treatment increased the levels of Lactobacillus and Bifidobacterium and decreased the levels of Odoribacter, Alistipes and Bacteroides. In conclusion, our results demonstrate that oligosaccharides administered as a dietary supplement increase the water content of feces, reduce intestinal transit time, modulate the composition of the gut microbiota and increase the concentration of short-chain fatty acids in the feces of mice with constipation.