This experiment was aimed at comparing the intestinal microbial community composition in pigs fed hulled common barley supplemented with isolated barley mixed-linked beta-glucan, four hulless barley varieties and breeding lines with mixed-linked beta-glucan contents ranging from 41 to 84 g kg(-1) and different amylose/amylopectin ratios as well as two oat varieties. Seventy-two weaned piglets were allocated to one of nine diets composed of 81.5% cereal, 6% whey, 9% soy protein isolate and 3.5% minerals. After 15 days, pigs were sacrificed and ileum and colon contents were collected for quantitative real-time PCR (qPCR) and denaturing gradient gel electrophoresis to evaluate microbial communities. Shifts in intestinal microbial communities were observed with the hulless barley cultivars with a normal to high beta-glucan content and from normal starch toward either high-amylopectin or high-amylose starch. These hulless barleys had the lowest (P<0.05) microbial diversity, whereas oats had intermediate diversity compared with low-beta-glucan hulless cultivars and hulled varieties. Furthermore, hulless varieties favoured xylan- and beta-glucan-degrading bacteria whereas mixed-linked beta-glucan-supplemented hulled barley favoured lactobacilli. Numbers of lactobacilli decreased in the ileum of pigs fed hulless/high mixed-linked beta-glucan barley-based diets. Thus, cultivar differences in both the form and the quantity of carbohydrates affect gut microbiota in pigs, which provides information for future feeding strategies.