Background Dietary fibers are widely considered to be beneficial for health by producing nutrients by gut microbial fermentation while helping with weight management and gut health. So far, the gene expression profiles of CAZymes responsing to different type of fibers (raw potato starch, RPS; inulin, INU; pectin, PEC) in the gut microbes of pigs are not well understood. Therefore, we investigate the functional response of colonic microbiota to different dietary fibers in pigs based on metatranscriptomic analysis. Results Results showed that the microbial composition and carbohydrate active enzymes (CAZymes) structure of three experimental groups changed significantly compared to the control group (CON). As determined by comparative analysis with the control diet, RPS increased the abundances of Parabacteroides, Ruminococcus, Faecalibacterium and Alloprevotella, and decreased Sutterella. INU increased the relative abundance of Fusobacterium and Rhodococcus, while decreased Bacillus. And pectin treatment increased the relative abundance of Streptococcus and Bacteroidetes group, while decreased the relative abundance of Clostridium, Clostridioides, Intestinibacter, Gemmiger, Muribaculum, and Vibrio. The gene expression of CAZymes GH8, GH14, GH24, GH38, GT14, GT31, GT77 and GT91 downregulated while GH77, GH97, GT3, GT10 and GT27 upregulated in the RPS diet group; AA4, AA7, GH14, GH15, GH24, GH26, GH27, GH38, GH101, GT26, GT27 and GT38 downregulated in the INU group; as to the PEC group, the gene expression of PL4, AA1, GT32, GH18, GH37, GH101, and GH112 downregulated while CE14, AA3, AA12, GH5, GH102 and GH103 upregulated. Compared to RPS and INU groups, the composition of colonic microbiota in the PEC group had more diverse changes with the variation of carbohydrate active enzymes and Streptococcus as the main contributor to CBM61, which promoted the digestion of pectin greatly. Conclusions The results of this exploratory study displayed a comprehensive overview on the effects of different fibers on gut microbiota and CAZymes in pig colons, which will provide new insights into the impacts of the use of dietary fibers on animal or human health.