Skip to content
nutritionintermediate

Keto and Your Gut Microbiome: The Complete Guide

Keto doesn't destroy your gut, quite the opposite. Learn how BHB feeds your gut cells, which fibres to choose, and how to build a healthier gut than before keto.

15 min

The myth of the missing fiber

One of the most common criticisms of keto is that it "ruins your gut flora" because you drop rye bread, oatmeal and whole grains. It sounds logical: fiber is good for the gut, and grains contain fiber. But the research paints a more nuanced picture: your gut bacteria do not care whether the fiber comes from a slice of rye bread or a bowl of broccoli. What counts is the amount and variety of plant fiber, not the source.

Something does happen to the gut flora when the carbs disappear. It is simply less dramatic than the critics claim, and with the right habits the gut can end up in better shape than it was before keto.

The research behind it is covered in detail in these articles:

Fiber is food for your gut bacteria, and that is a good thing

Fiber is technically a carbohydrate that your body cannot digest. It passes through the stomach and small intestine without being absorbed, and ends up in the colon, where your gut bacteria are waiting for it. When the bacteria break the fiber down, they produce gases (yes, that is why fiber can give you a bit of extra wind) and, far more important, short-chain fatty acids (SCFA), including acetate, propionate and butyrate.

These SCFAs are not just waste products. They are crucial for your health:

  • Butyrate is the primary fuel for the cells in your colon wall. It keeps the gut barrier tight and strong.
  • Propionate is transported to the liver, where it helps regulate cholesterol production and gluconeogenesis.
  • Acetate is used as an energy source in peripheral tissue and can influence appetite regulation via the brain.

The point is: fiber matters on keto. But you do not need grains to get it.

What happens to your gut flora when you start keto?

The first 2-4 weeks: The adaptation period

When you switch from a carb-rich diet to keto, your gut flora goes through a marked change. That is completely normal, and temporary. For years your gut bacteria have lived off the fiber and starch you have eaten. When those suddenly disappear, the gut flora reacts.

Research shows that the first weeks on keto typically bring:

  • A drop in Bifidobacterium: These bacteria live mainly off carbohydrates and fiber from grains. The 2022 systematic review singles this drop out as the most worrying change, because low levels are linked to obesity, type 2 diabetes and depression. The drop is driven by the ketone BHB itself, not only by the missing grain fiber, so it does not necessarily go away because you eat more vegetables. Prebiotic fiber (inulin from onion, garlic and leek) and fermented foods are the best countermeasures, but the evidence that they restore the level on keto is thin.
  • A shift toward more Bacteroidetes: Unlike an ordinary high-fat diet, which typically raises Firmicutes, keto does the opposite: the Firmicutes/Bacteroidetes ratio falls. It is one of the changes that separates ketosis from simply eating fat.
  • A temporary reduction in SCFA production: Because the bacteria have to adjust, butyrate production can dip briefly.

The key thing: How quickly SCFA production recovers is not known. The 2022 review gives no time frame, and the one clinical trial that added fiber and probiotics on top of keto found no extra effect on gut flora diversity. The dip in diversity that one of two studies saw was gone again after six months.

After the adaptation: A new balance

Once your gut flora has adapted, the picture looks different. Ang and colleagues showed in 2020 in the journal Cell that mice on a keto diet had fewer Th17 cells (inflammatory immune cells) in the gut lining than mice on an ordinary high-fat diet. In humans, only the change in gut flora has been shown so far. The Th17 effect has not been measured in the human gut, and protection against autoimmune disease is a hypothesis, not a finding. In other words: your gut may be more "calm" on keto than on a standard Western diet.

BHB and butyrate: The ketone that feeds your gut from within

Here comes the really interesting part, and this is where keto critics most often go wrong.

Your gut cells (colonocytes) normally live off butyrate, which the bacteria produce by breaking down fiber. But there is another source of energy for the gut cells: beta-hydroxybutyrate (BHB), the ketone your liver produces when you are in ketosis.

BHB and butyrate resemble each other chemically. Both are short-chain fatty acids, and both can be used as fuel by the gut cells. But they are not interchangeable, and there is no evidence that BHB makes the bacteria produce more butyrate. On the contrary, butyrate production typically falls on keto while BHB rises.

Read more about BHB's anti-inflammatory effects: BHB blocks the NLRP3 inflammasome: How ketones suppress chronic inflammation

What does this mean in practice?

  • Even in periods of lower fiber intake, your gut cells still get energy from BHB via the blood.
  • In animal and cell studies BHB strengthens the gut barrier and calms inflammation, and animals with gut inflammation make less BHB of their own in the colon lining. Whether that means more BHB from the diet helps people with IBD has not been shown.
  • Whether that extra energy source benefits people with IBS or inflammatory bowel disease is unsettled. Some improve, some get worse, and in one mouse study a keto diet made experimental colitis worse through BHB itself. If you have one of those diagnoses, the diet change belongs with your gastroenterologist, not in a guide.

This does not mean you can drop fiber entirely. But it does mean that keto does not "starve" your gut. On the contrary, you have an extra energy source that people on a standard diet do not have.

Diversity without whole grains

Diversity in the gut flora is one of the strongest markers of good gut health. The more different bacterial strains you have, the better your immune system, your metabolic regulation and your resilience against disease.

The good news: diversity comes from plant variety, not from grains specifically. In the American Gut project, a large observational study, participants who ate more than 30 different plant sources a week had greater gut diversity than those who ate fewer than 10. That is an association, not proof of cause.

On keto you can easily hit this target:

  • Vegetables: Broccoli, cauliflower, spinach, kale, asparagus, celery, cucumber, zucchini, avocado, bell pepper
  • Herbs: Parsley, dill, cilantro, basil, rosemary, thyme, oregano, they all count!
  • Nuts and seeds: Walnuts, almonds, pecans, macadamias, sunflower seeds, flaxseed, chia seeds, hemp seeds
  • Fermented foods: Sauerkraut, kimchi, kefir (sugar-free), kombucha (in limited amounts)

The goal: Aim for 30 different plant sources a week. It sounds like a lot, but once you count herbs, seeds and vegetables, it is surprisingly easy to reach.

See our guide for more on keto-friendly foods: What can you eat on keto, and what should you avoid?

The three pillars of a healthy keto gut

1. Prebiotic vegetables: Food for the good bacteria

Prebiotics are specific types of fiber that your good gut bacteria live off. The most important ones on keto are:

  • Inulin-rich sources: Artichokes, asparagus, garlic, onion and leeks. Inulin is one of the best documented prebiotics for raising Bifidobacterium, while the effect on butyrate is more mixed. If you have IBS or an inflammatory bowel disease, these particular foods are high in FODMAPs and can worsen symptoms, so start small or skip them.
  • Fructooligosaccharides (FOS): Found in banana (in very small amounts), garlic and onion. Although bananas are too carb-rich for keto, you get FOS from garlic and onion, which you use in cooking anyway.
  • Resistant fiber: Flaxseed and chia seeds contain fiber that passes straight to the colon and feeds your bacteria.

Practical tip: Use garlic and onion in your cooking daily. It is one of the simplest ways to support your gut flora. If you have IBS, SIBO or an inflammatory bowel disease, a daily intake can instead mean more gas and pain, so try small amounts first.

2. Fermented foods: Live bacteria straight to the gut

While prebiotics feed your existing bacteria, fermented foods deliver new, live bacteria straight into your system. It is a "refill" of the gut flora.

  • Sauerkraut: Rich in Lactobacillus bacteria. Choose unpasteurized sauerkraut from the refrigerated section. The pasteurized version on the shelves has killed off the live bacteria.
  • Kimchi: Korean fermented cabbage with chili. Contains a wide range of probiotic strains and is naturally low in carbs.
  • Kefir (sugar-free): Kefir grains typically hold 20-60 species of bacteria and yeast combined, more than yogurt. Commercial kefir usually contains fewer. Choose a variety without added sugar, or make it yourself with kefir grains.
  • Kombucha: In limited amounts (100-150 ml). Check the label for sugar content, since many commercial varieties contain too much residual sugar. If you have IBS, SIBO or reflux, even 100-150 ml can trigger symptoms, so start with a smaller amount.

Goal: At least one fermented source daily. It does not have to be much. A tablespoon of sauerkraut with your lunch is enough to make a difference.

3. Resistant starch: The keto hack most people do not know

Resistant starch (RS) is starch that resists digestion in the small intestine and instead ends up in the colon, where the bacteria ferment it into butyrate. It is technically a carbohydrate, but because it is not absorbed as sugar, it does not count toward your net carbs.

The best trick: boiled and cooled potatoes. When you boil potatoes and then cool them for 12-24 hours in the fridge, the starch changes structure and turns into resistant starch type 3 (RS3). Resistant starch is fermented into butyrate, but how much varies a great deal from person to person, and no trial crowns one RS source as the best.

Amounts to aim for:

  • 50 g boiled and cooled potato = about 8 g net carbs. Boiled potato holds 20 g of carbohydrate and 1.8 g of fiber per 100 g according to the USDA food database, and only about 1 g of the 50 g turns into resistant starch on cooling. That is a large slice of a keto carb budget for a modest amount of RS, so use it deliberately or skip it. If you take insulin or a sulfonylurea such as glimepiride, count the potato in your carbs and agree the doses with your doctor.
  • 1 tbsp potato starch (raw, dissolved in cold water) = about 8 g RS out of 10 g total carbs

Important detail: Resistant starch is destroyed by heat. If you reheat the cold potatoes, some of the RS turns back into regular starch. Eat them cold, in a salad, for example.

The gut-brain axis: Why your gut affects your mood

Around 90% of the body's serotonin is produced in the gut, not in the brain. Serotonin is one of the most important signaling molecules for mood, sleep and well-being. Gut serotonin does not cross into the brain, but it acts on the gut's own nerves and on the signals that travel up the vagus nerve, and that is the route by which gut health can affect how you feel mentally.

Research shows that keto can influence the gut-brain axis positively in several ways:

  • Reduced inflammation: Chronic gut inflammation disrupts serotonin production. BHB's anti-inflammatory effect can protect this process.
  • A better gut barrier: A leaky gut lets bacterial toxins slip into the bloodstream, which can cause brain fog, anxiety and low mood. BHB and butyrate both strengthen the gut barrier.
  • A changed bacterial makeup: Certain bacterial strains produce neurotransmitters directly. A diverse gut flora with enough butyrate production supports this process.

Read more about the gut-brain connection: Gut bacteria and mental health: How your gut affects your brain

And about collagen and gut health: Collagen and gut health during fasting: Can collagen peptides protect your gut barrier?

Omega-3 and gut inflammation

Fatty fish is a cornerstone of a well-formulated keto diet, and your gut bacteria love it. EPA and DHA (the active omega-3 fatty acids in fish) reduce inflammation in the gut and can increase the diversity of beneficial bacterial strains.

Whether the combination of keto and omega-3 helps people with IBS (irritable bowel syndrome) or inflammatory bowel disease such as Crohn's disease has not been shown in clinical trials. The response is highly individual, and some people get worse. If you have one of those diagnoses, talk to the doctor treating you before you change your diet, and keep taking your medication as prescribed.

Practical: Aim for fatty fish at least 2-3 times a week. Salmon, mackerel, sardines and herring are the best sources. If you cannot eat fish regularly, an omega-3 supplement (EPA/DHA) may be relevant. See our guide to supplements on keto.

Artificial sweeteners and the gut flora

Many people on keto use artificial sweeteners as a substitute for sugar. But not all sweeteners are equally gentle on your gut flora.

Research shows that certain sweeteners can disrupt the gut-brain axis and affect the bacterial makeup negatively:

  • Sucralose: Studies suggest that sucralose can reduce the number of beneficial bacteria and affect appetite regulation in the brain. Use in moderation.
  • Maltitol and sorbitol: Sugar alcohols that often cause stomach trouble (bloating, cramps, diarrhea) because they ferment heavily in the colon. Avoid large amounts.
  • Erythritol: The most gut-friendly sugar alcohol. Most of it is absorbed in the small intestine and never reaches the colon, so it does not disturb the gut flora to any meaningful degree. There is, however, a cardiovascular question mark over it: a 2024 trial found increased platelet reactivity after a single serving of erythritol in healthy volunteers. It is not settled, but it argues for moderate amounts rather than unlimited use.
  • Stevia and monk fruit: Plant-based and the mildest of the group for the gut flora, but the 2025 review counts stevia among the sweeteners that can disrupt the gut-brain axis. Use them as an occasional shortcut, not as a daily fixture.

Read more about sweeteners and the gut-brain axis: Artificial sweeteners disrupt the gut-brain axis: Research reveals hidden mechanisms

And about sucralose specifically: Sucralose and appetite: What happens in the brain?

What about constipation?

Constipation is one of the most common complaints early on keto. But it rarely comes down to a lack of fiber from grains. It is almost always about two other things:

1. A lack of salt

Your gut needs sodium to draw water into the colon. On keto you excrete more sodium via the kidneys (because of lower insulin levels), and if you do not compensate, the stool becomes dry and hard. The solution is simple: add more salt to your food, or drink a cup of broth daily.

2. A lack of magnesium

Magnesium citrate draws water into the intestines and works as a natural, mild laxative. It is your best friend during the transition to keto. Start with 200-400 mg magnesium citrate in the evening, and adjust as needed.

Important: If you take blood pressure medication (for example ACE inhibitors or ARBs), talk to your doctor about your salt and mineral intake, since these types of medication affect the electrolyte balance. If your kidney function is reduced, do not take magnesium supplements without your doctor's approval: the kidneys clear the excess magnesium, and when they work poorly it can build up.

For dosages and more on electrolytes, see our electrolyte guide.

Other tips against constipation

  • Drink enough water: At least 2-3 liters daily. Dehydration is a frequent cause of constipation.
  • Move: Physical activity stimulates the gut's peristalsis (movement). Even a 20-minute walk daily can make a difference.
  • Flaxseed: 1-2 tbsp ground flaxseed daily provides both fiber and omega-3. Mix it into your breakfast or smoothie.

Your daily gut checklist

Here is a simple daily checklist for keeping your gut flora healthy on keto:

GoalWhatWhy
5+ different vegetablesVary daily, switch between cabbage types, leafy greens, onion, garlicIncreases diversity in the gut flora
1 fermented sourceSauerkraut, kimchi, kefir or kombuchaAdds live probiotic bacteria
Salt to tasteUnrefined salt in food + broth if neededMaintains the gut's water balance and prevents constipation
Magnesium in the evening200-400 mg magnesium citrateNatural laxative + supports sleep
Fatty fish 2-3x/weekSalmon, mackerel, sardines, herringOmega-3 reduces gut inflammation
Nuts or seeds dailyWalnuts, flaxseed, chia seeds, almondsFiber + prebiotics + healthy fats
2-3 liters of waterPlain water, tea, coffee (counts too)Hydration is crucial for gut function
A daily checklist for a healthy gut flora on keto.

In short: Your gut is doing better than you think

The myth that keto "kills" your gut flora does not hold up when you look at the research. Yes, changes happen, especially in the first weeks. But a well-formulated keto diet with plenty of vegetables, fermented foods and healthy fats can give you a gut flora that is at least as diverse and healthy as on a standard diet.

What makes keto different for gut health is BHB, the ketone that feeds your gut cells from within, including in periods when fiber intake is low. It is an evolutionary trick that your body already knows, and one that activates automatically when you are in ketosis.

Remember: Keto and gut flora is not about choosing between fiber and fat. It is about choosing the right fiber (vegetables, seeds, fermented foods) and letting ketosis do the rest. Find the vegetables and fermented foods you like, and make them a daily habit.

Three more things about the gut on keto

It is not only the amount of bacteria that changes, but which kinds dominate. The genus Bacteroides, which specializes in fermenting sugar and starch from grains, falls back. In its place grow the bacteria that are good at making butyrate from plant fiber, along with a species called Akkermansia muciniphila, which lives in the gut's mucus layer and maintains it. That mucus layer is the physical defense between the contents of the gut and the gut wall, and you support it best by keeping your vegetable intake up.

Polyphenols are the color and flavor compounds in plants, and only a limited share of them is absorbed in the small intestine. The rest reaches the colon, where the bacteria use them as food. You find them in herbs and spices, dark leafy greens, low-carb berries, olives and olive oil, and dark chocolate with at least 85 % cocoa. Use herbs generously: it is the cheapest way to give your gut bacteria something extra to work with, and it costs no carbs.

Supplements cannot replace food, but a couple of them are worth knowing. Magnesium citrate and fish oil are the best documented, and the doses are listed in the guide to supplements on keto. High-dose probiotic capsules promise more than they deliver, because most strains do not settle in the gut; a tablespoon of sauerkraut usually does more. If you take a prebiotic fiber supplement such as inulin or guar gum, start low and increase slowly, or you will end up bloated.

Who should be careful

Gut health advice does not apply to everyone equally. If you belong to one of the groups below, talk to your doctor before you change your diet or start on supplements.

  • IBS, ulcerative colitis and Crohn's disease: Keto eases symptoms for some people and worsens them for others, and during an active flare a diet change is not the first choice. Changes belong in consultation with the doctor following you, not instead of the treatment.
  • Epilepsy: The ketogenic diet for epilepsy is a treatment run by a physician and a registered dietitian, with blood work and medication monitored throughout. That version is not the same thing as ordinary keto, and it should never be started on your own, in children or in adults.
  • Reduced kidney function: The kidneys clear excess magnesium and salt. If they work poorly, both magnesium supplements and extra salt need to be cleared with your doctor.
  • Blood pressure medication, diuretics and diabetes medication: Salt, fluid and carbs all affect blood pressure and blood sugar, so doses may need adjusting. That is the doctor's job, not yours. Insulin and sulfonylureas such as glimepiride and glipizide can cause low blood sugar once the carbs go, and doses usually have to come down at the same time as the diet change. SGLT2 inhibitors such as empagliflozin and dapagliflozin can trigger ketoacidosis at normal blood sugar and are usually paused before someone enters ketosis. If you have type 1 diabetes, keto belongs only under specialist supervision.
  • Immunosuppressants and biologics: Keto affects immune cells in the gut, and major diet changes can affect how the medication works, so agree the change with the doctor managing your treatment.
  • SIBO and candida protocols: Daily inulin, garlic, onion, kombucha and raw potato starch are exactly what can worsen bacterial overgrowth in the small intestine. If you have SIBO, skip the prebiotic advice here and follow your clinician's plan.
  • Bipolar disorder and psychosis: Major diet changes, including a ketogenic diet, have in rare cases been linked to worsening mania or psychotic symptoms. Talk to your psychiatrist before changing your diet, and never stop medication on your own.
  • Pregnancy and breastfeeding: There is not enough research on keto during pregnancy and breastfeeding. Do not change your diet without talking to your midwife or doctor first.
  • An eating disorder now or in the past: Strict rules about what may be eaten can restart an old pattern. Seek professional help rather than tightening your diet on your own.
  • Children and teenagers: Keto for children belongs under medical supervision, because growth and nutrient needs have to be followed.

Related Reading

The gut connects to the rest of keto: the start, the electrolytes and the supplements.

Gut HealthFiberBHBButyrateProbioticsPrebioticsSCFAFermented Foods
Keto Assistant

Hi! I'm your keto assistant

Ask me about keto diet, fasting, recipes or health. You can also upload a food image and I'll assess whether it's keto-friendly.