How Diet Shapes the Gut Microbiome: Diversity, Fiber, and Fermented Foods
The gut microbiome is the community of roughly 38 trillion bacteria, archaea, viruses, and fungi that live in your intestines. The composition of that community responds rapidly to what you eat, often within 24 to 48 hours. The Sonnenburg Lab at Stanford has spent the last decade showing how dietary fiber, fermented foods, and the absence of both shape the microbiome and the immune system. Tim Spector's twin and population studies at King's College London have made the case that microbiome diversity is one of the strongest single predictors of metabolic and immune health. This guide covers what we actually know about diet and the gut microbiome, what the 2021 Stanford fermented-foods trial showed, and what to do with it.
Why microbiome diversity matters
Microbiome diversity has two components. Alpha diversity is the number and evenness of species within a single person's gut. Beta diversity is how different people's microbiomes are from one another. Both matter. High alpha diversity, meaning many species with relatively even abundance, is consistently associated with better health in observational studies. Low alpha diversity is associated with obesity, type 2 diabetes, inflammatory bowel disease, allergies, and even depression.
The association is not proof of causation. People who eat diverse plant-rich diets, exercise, sleep well, and avoid unnecessary antibiotics also tend to have diverse microbiomes. The microbiome may be a marker of healthy living rather than the cause of it. But mechanistic studies, including fecal transplant experiments in animals, suggest causation runs at least partly through the microbiome itself.
Tim Spector and colleagues at King's College London, working with the British Gut Project and the American Gut Project, have shown that the single strongest predictor of microbiome diversity in large cohorts is the number of different plants a person eats per week. People who eat 30 or more different plant species per week have significantly more diverse microbiomes than those who eat fewer than 10. The relationship is dose-dependent.
The fiber-fueled microbiome
The Sonnenburg Lab at Stanford, led by Justin and Erica Sonnenburg, has shown in mice and humans that dietary fiber is the primary fuel for gut bacteria. Fiber that reaches the colon undigested (oligosaccharides, resistant starch, soluble and insoluble fiber) is fermented by bacteria into short-chain fatty acids (SCFAs): acetate, propionate, and butyrate. These SCFAs have wide-ranging effects: they fuel colon cells, reduce gut inflammation, regulate appetite through GLP-1 and PYY, and improve insulin sensitivity.
The Sonnenburgs have shown that a low-fiber diet produces rapid loss of microbiome diversity in mice, and that this loss can compound across generations. When mice are fed a low-fiber diet for several generations, bacterial species disappear and cannot be fully recovered even with reintroduction of fiber. The implication is that a long-term low-fiber diet, common in modern Western populations, may be eroding microbial diversity in ways that are difficult to reverse.
This work has led to a recommendation that goes beyond fiber grams: vary your fiber sources. Each plant species feeds a different set of bacteria, so eating a wide variety of plants (the 30-per-week target from the American Gut Project) is more effective than eating a single high-fiber food repeatedly.
The 2021 Stanford fermented-foods trial
The Wastyk study, published in Cell in July 2021 by the Sonnenburg Lab, is one of the most influential diet-microbiome trials in recent years. Researchers randomized 36 healthy adults to one of two 10-week dietary interventions: a high-fiber diet (averaging 55 grams of fiber per day from whole plant foods) or a high-fermented-foods diet (averaging 6 servings per day of fermented foods like yogurt, kefir, kimchi, sauerkraut, kombucha, and fermented cottage cheese).
The results were surprising. The fermented-foods group showed a striking and rapid increase in microbiome diversity that persisted throughout the 10 weeks. They also showed decreases in 19 inflammatory markers, including interleukin-6, interleukin-12p70, and C-reactive protein, in blood samples. The high-fiber group showed more modest microbiome changes, and individuals with low baseline microbiome diversity sometimes showed increased inflammation, possibly because their microbiomes lacked the capacity to ferment the additional fiber effectively.
The trial was small (18 participants per arm) and short (10 weeks). But the magnitude of the inflammatory marker reduction was notable, and the diversity increase was consistent across participants. The implication is not that fiber is unimportant, but that fermented foods may have a larger short-term effect on microbiome diversity than high-fiber foods alone, especially in people whose microbiomes are already depleted.
What counts as a fermented food?
There is a meaningful distinction between fermented foods that contain live microbes and those that do not. True fermented foods, where live bacteria or yeast carry out the fermentation and remain in the final product, include:
- Yogurt with live and active cultures (look for the LAC seal)
- Kefir (a fermented milk drink with more diverse cultures than yogurt)
- Raw, unpasteurized sauerkraut and kimchi (pasteurization kills the live cultures)
- Kombucha (fermented tea)
- Tempeh and natto (fermented soy)
- Miso (fermented soy paste)
- Traditionally made sourdough bread (live culture in starter, though baking kills the microbes)
- Aged cheeses with live cultures (cheddar, gouda, brie)
Many products sold as "fermented" are pasteurized after fermentation, which kills the live microbes. Vinegar-brined pickles, sauerkraut in cans, and most commercial pickles are not live fermented foods. Bread and alcoholic beverages like beer and wine are fermented but the microbes are killed (bread) or removed (filtered beer, wine) before consumption.
Polyphenols and the microbiome
Polyphenols are plant compounds that are poorly absorbed in the small intestine and reach the colon, where bacteria metabolize them into bioactive compounds. They are found in berries, dark chocolate, tea, coffee, red wine, olive oil, nuts, and many herbs and spices.
The polyphenol-microbiome relationship is bidirectional. Bacteria transform polyphenols into more bioactive forms, and polyphenols selectively promote the growth of bacteria that metabolize them. This is part of why the Mediterranean diet, which is high in polyphenols from olive oil, vegetables, and red wine, is associated with favorable microbiome profiles.
The strongest evidence for polyphenol-microbiome effects comes from studies of cocoa flavanols, blueberry anthocyanins, and the polyphenols in extra-virgin olive oil. A 2021 randomized trial by Vetrani and colleagues in the American Journal of Clinical Nutrition found that 8 weeks of high-polyphenol extra-virgin olive oil increased beneficial Bifidobacterium and reduced inflammatory markers in adults with metabolic syndrome.
Artificial sweeteners and the microbiome
The story on non-nutritive sweeteners and the microbiome is unsettled but concerning enough to warrant caution. The 2014 study by Suez and colleagues in Nature found that saccharin altered the gut microbiome in mice and humans and impaired glucose tolerance in some people. The effect varied by individual, suggesting that personal microbiome composition determines the response.
A 2022 controlled trial by Suez and colleagues in Cell, this time with saccharin, sucralose, aspartame, and stevia, found that all four sweeteners altered the microbiome and glucose responses in healthy adults in personalized ways. The effect was reproducible within individuals, suggesting real biological activity, but the magnitude and direction varied. Not everyone got worse glucose tolerance, and the changes were modest.
The FDA continues to approve these sweeteners as safe. The evidence is not strong enough to recommend universal avoidance, but it is reasonable to treat non-nutritive sweeteners as an open question rather than a free pass. People who use them heavily may want to test their personal response with a continuous glucose monitor or by simply removing them for a few weeks.
Antibiotics and the microbiome
Antibiotics are the most dramatic short-term disruptor of the gut microbiome. A course of broad-spectrum antibiotics can wipe out a third or more of gut bacterial species within days. Recovery takes weeks to months, and some species may not fully recover, especially after repeated courses.
The clinical implications are real. Antibiotic use in infancy and childhood is associated with higher risk of obesity, asthma, allergies, and inflammatory bowel disease. In adults, repeated antibiotic use is associated with recurrent Clostridioides difficile infection, antibiotic-associated diarrhea, and possibly increased obesity risk.
This does not mean antibiotics should be avoided when they are needed. Untreated bacterial infections are far more dangerous than microbiome disruption. But it does mean antibiotics should be used only when clearly indicated, at the narrowest effective spectrum, for the shortest effective duration. The CDC estimates that at least 30 percent of outpatient antibiotic prescriptions in the United States are unnecessary.
Should you take a probiotic?
The probiotic market is large and the science is mixed. Probiotics are live bacteria taken as supplements or in fortified foods. The strongest evidence supports specific strains for specific conditions:
- Lactobacillus rhamnosus GG and Saccharomyces boulardii: for prevention of antibiotic-associated diarrhea and treatment of infectious diarrhea in children
- Bifidobacterium infantis 35624: for irritable bowel syndrome
- Lactobacillus reuteri and Lactobacillus rhamnosus: for infant colic and prevention of necrotizing enterocolitis in premature infants
- VSL#3 (a multi-strain preparation): for pouchitis after colectomy and possibly for ulcerative colitis
For general health in healthy adults, the evidence is weaker. A 2018 systematic review by the Cochrane Collaboration found that probiotics had modest effects on preventing common acute infections. The effect on microbiome diversity is small and transient, partly because exogenous probiotic strains often do not colonize the gut permanently. They tend to pass through within weeks of stopping.
The general view among microbiome researchers, including the Sonnenburgs, is that fermented foods are preferable to probiotic supplements for general health. Fermented foods deliver a wider range of live microbes in a food matrix that may support survival, and they replace other less-healthy foods in the diet.
Practical guidance for a healthier microbiome
- Eat 30 or more different plant species per week. The American Gut Project showed this is the single strongest predictor of microbiome diversity. Use the Fiber Calculator to track fiber diversity.
- Eat 2 to 6 servings of live fermented foods per day, modeled on the Wastyk trial. Yogurt with live cultures, kefir, kimchi, sauerkraut (raw), kombucha, and tempeh are all good options.
- Aim for 25 to 38 grams of fiber per day from a variety of sources. Beans, lentils, oats, berries, and leafy greens are workhorses.
- Include polyphenol-rich foods: berries, dark chocolate, tea, coffee, extra-virgin olive oil, herbs, and spices.
- Use antibiotics only when clearly needed, and consider fermented foods or a documented probiotic during and after a course.
- Treat non-nutritive sweeteners as an open question. If you use them heavily, consider testing your personal glucose response.
- Limit ultra-processed foods, both for their direct effects and for the diversity they crowd out.
Score your overall dietary pattern with the Mediterranean Diet Score Calculator, which is naturally high in microbiome-friendly foods.
The bottom line
The gut microbiome is shaped by what you eat, often within days. The two strongest dietary levers for diversity are eating a wide variety of plants (30+ species per week) and eating live fermented foods regularly (2+ servings per day). Fiber is the fuel; fermented foods are the seed bank. Antibiotics, ultra-processed foods, and possibly non-nutritive sweeteners reduce diversity. Probiotic supplements have documented uses for specific conditions but are not a substitute for a diverse plant-rich diet and regular fermented foods. The microbiome is one of the few systems in the body where you can produce measurable change in a week. The cost is low and the upside is real.
Discussion
Share your perspective - be constructive and kind. Comments are visible immediately and moderated by our team.