Does the keto diet impact your gut bacteria?

The ketogenic, or keto, diet was first used more than 100 years ago to help treat children with epilepsy. Today, a less strict version of the diet has become popular more widely.

Scientists continue to investigate its potential uses in treating or preventing various medical conditions, including a range of neurological disorders, cancer, and glucose management in type 2 diabetes.

More commonly, though, people use the keto diet to lose weight

In this article, we’ll focus on how the keto diet might influence your gut microbiome — the collection of bacteria and other microbes that live in your gut. 

ZOE is at the forefront of gut microbiome research, and we’ve identified links between the types of bacteria you host and markers of good and bad health. So, understanding how food choices influence these microbes is important.

First, let’s briefly explain the keto diet.

What is the keto diet?

The keto diet is a high-fat, very low-carb diet. Meals are 70–80% fat and around 5-10% carbs. Usually, your body breaks carbohydrates down into glucose in your body, which provides energy. 

If you don’t eat many carbs, your body switches to burning ketones, which are made from fat. This is called ketosis.

Because the keto diet forces your body to burn fat rather than glucose, it can help you lose weight. However, because it’s a tough diet to stick to, the weight may not stay off for long. 

Importantly, there’s little information on the long-term effects of following the keto diet — partly because it's difficult to maintain.

At ZOE, we know that losing weight can be incredibly hard, and strict diets are often not sustainable. That’s why ZOE’s personalized nutrition advice allows you to choose the best foods for your body without restricting your choices.

The keto diet and gut bugs

Because the food we eat influences the composition of our gut microbiome, it’s perhaps no surprise that a strict diet might affect our resident bacteria.

And although research into the effects of the keto diet on gut bacteria is pretty limited, existing studies do shed some light.

A study published in 2020 took a multipronged approach to this question. The authors recruited 17 men who spent 2 months in a facility where they could closely monitor their diet and exercise levels.

All participants had overweight or obesity but did not have type 2 diabetes. Participants either ate a keto or “standard” diet for 4 weeks. Then, for the final 4 weeks, they swapped to the other diet so that all participants tried both.

The scientists found that switching between the two diets caused shifts in Actinobacteria, Bacteroidetes, and Firmicutes.

In particular, beneficial Bifidobacteria species decreased the most in humans following the keto diet. 

This decrease in Bifidobacteria species was in response to reductions in carbohydrates rather than reduced fat intake. It may be that consuming less fiber, which fuels gut bacteria, causes this change.

The scientists moved to a mouse model to understand what the changes might mean. They found that, in mice, reducing levels of Bifidobacteria species reduced the number of Th17 immune cells

Th17 immune cells are a type of T cell that helps fight infections but also promotes inflammation in autoimmune diseases.

Further experiments showed that the ketone bodies produced during a keto diet promoted these shifts in the gut microbiome.

The authors believe that the changes to the microbiome could help explain how the keto diet aids weight loss and improves blood sugar control.

However, they also write that the changes in Bifidobacteria and Th17 immune cells might have good or bad effects on the body, depending on the context. 

They also point out that they didn’t explore the impact of other changes to the microbiome. For instance, they explain that both Fusobacteria and Escherichia were boosted on the keto diet, which are associated with increased colorectal cancer risk.

Keto and epilepsy

Although doctors first used the keto diet to treat epilepsy in the 1920s, scientists are still not sure why it works. Could its effects be due to changes in the microbiome? 

An intriguing study, although in mice, provides some hints.

The researchers used mice that had been reared in a special way so that they had no gut bacteria. The team found that the keto diet did not protect these “germ-free” mice against electrically induced seizures.

When the scientists colonized the germ-free mice with species of bacteria associated with following the keto diet, it protected the mice against seizures.

So, changes in the gut bacteria related to the keto diet seem to be important in producing the anti-seizure benefits.

In another part of their study, they transplanted the gut microbiome of a mouse that ate a keto diet into a mouse on a standard diet. Again, this influx of gut bacteria provided the second mouse protection against seizures.  

Keto, epilepsy, and gut bacteria

Epilepsy is a complex condition, but there is growing evidence that the microbiome might play a part. Keto’s ability to influence gut bacteria might be at least one of the reasons why it is so effective at reducing seizures in some individuals.

One study unearthed some extra complexity. 

Some people’s seizures respond well to the keto diet, but it doesn’t help others. In this study, the scientists compared responders and non-responders. They recruited 20 children with epilepsy who followed the keto diet for 6 months. 

They found that, before starting the keto diet, there were no significant differences between the gut microbiomes of these two groups.

And after 6 months, the microbial diversity had declined in both groups — a sign of a less healthy gut microbiome.

However, there were differences between the groups: Non-responders had higher levels of some species than responders, including Clostridia. 

Scientists consider Clostridia important for gut health, but there’s also evidence that they might contribute to gut microbiome imbalance, which experts call dysbiosis.

So again, although the researchers identified changes, it’s unclear what they might mean for long-term gut health.

Interestingly, the authors of a study on toddlers with epilepsy found distinct differences in gut bacteria between children with and without epilepsy (before trying the keto diet).

After only 1 week of following the keto diet, the children with epilepsy had gut bacteria that were more similar to those of kids without epilepsy, and most had a dramatic reduction in seizures.

The researchers concluded that the keto diet might help “correct” their initial gut bacteria imbalance. 

Other microbiome changes

One issue with the available evidence is that much of the research focuses on people with epilepsy.

And because the microbiome of people with epilepsy might be different to start with, it’s difficult to know whether any changes in gut bacteria during the study are relevant to people without epilepsy.

A few studies have recruited people without epilepsy. For instance, one looked at elite athletes. Among other changes, the scientists found that athletes on a keto diet had lower levels of Faecalibacterium

These bacteria are common in the gut microbiome and are associated with reduced markers of inflammation. Some studies have also linked reduced levels of these bacteria to a higher risk of obesity and type 2 diabetes.

Once again, though, the gut microbiome of elite athletes differs from that of less active folk, so it’s difficult to know whether the findings relate to the population at large.

Sometimes the results are mixed — a small Italian study found that the keto diet didn’t significantly alter levels of Firmicutes and Bacteroidetes — two major players in a healthy gut microbiome. 

But they did show that the keto diet was associated with increased numbers of Desulfovibrio, which is linked to inflammatory bowel disease (IBD). 

What does it all mean?

In a nutshell, it seems that the keto diet does influence gut bacteria, but it’s less clear what these changes mean for health. 

Some changes may be beneficial if you use the diet to treat epilepsy. Some changes may also help if you are trying to lose weight or control blood sugar. 

However, at this stage, scientists don’t know the long-term effects of these gut microbiome changes.

Understanding the complex web of interactions between food, gut bacteria, and the rest of the body will take some picking apart.

With interest in both the keto diet and the microbiome at a high level, researchers are sure to continue chipping away at this intriguing topic.

ZOE’s research has shown that everyone responds differently to food, so no single diet plan can suit everyone. 

Personalization is key. With the ZOE plan, you can learn how your blood sugar and blood fat levels respond to different foods — these responses are different for everyone.

We also analyze your gut microbiome using the most advanced gut microbiome test available.

Using all this data, we can provide nutrition advice tailored to you. By eating right for your unique body, we can help you move toward your long-term health goals.


Altered gut microbiome composition in children with refractory epilepsy after ketogenic diet. Epilepsy Research. (2018).  

Commensal Clostridia: leading players in the maintenance of gut homeostasis. BMC. (2013). 

Desulfovibrio bacterial species are increased in ulcerative colitis. Diseases of the Colon and Rectum. (2010). 

History of the ketogenic diet. Epilepsia. (2008). 

Implementing a low-carbohydrate, ketogenic diet to manage type 2 diabetes mellitus. Expert Review of Endocrinology & Metabolism. (2018). 

Ketogenic diets for adult neurological disorders. Neurotherapeutics. (2018). 

Ketogenic diet in the treatment of cancer - Where do we stand? Molecular Metabolism. (2019). 

Ketogenic diet poses a significant effect on imbalanced gut microbiota in infants with refractory epilepsy. World Journal of Gastroenterology. (2017). 

Ketogenic Diets Alter the Gut Microbiome Resulting in Decreased Intestinal Th17 Cells. EBioMedicine. (2020).

Low-carbohydrate ketogenic diets in body weight control: A recurrent plaguing issue of fad diets? Obesity Reviews. (2021). 

Short-term impact of a classical ketogenic diet on gut microbiota in GLUT1 Deficiency Syndrome: A 3-month prospective observational study. Clinical Nutrition ESPEN. (2017). 

Th17 cells. (n.d.). 

The effects of dietary pattern during intensified training on stool microbiota of elite race walkers. MDPI. (2018). 

The gut microbiome and epilepsy. EBioMedicine. (2019). 

The gut microbiota mediates the anti-seizure effects of the ketogenic diet. Cell. (2018). 

The microbiome of professional athletes differs from that of more sedentary subjects in composition and particularly at the functional metabolic level. Gut. (2017).