Your gut talks to your brain, and the other way around
Imagine that deep down in your stomach there lives a whole little society of microbes. They do not only help you digest food, they also send chemical messages that can reach your brain along several routes. It sounds like science fiction, but it is exactly what researchers are now mapping out.
Gut and brain are connected by a kind of two-way phone line. The messages run both ways: from the stomach up to the brain and from the brain down to the stomach. That is why the state of your gut can affect your mood, how you handle stress and how clearly you think. And your state of mind can affect your stomach in turn. Most people have felt it as "butterflies in the stomach" when they are nervous.
In short: Your gut and your brain talk to each other all the time. The gut and its bacteria make many of the same signaling chemicals the brain uses to steer mood and calm, and people with depression and anxiety often have different gut flora from other people. Whether that is a cause or a consequence is not yet known, and most of what is known about the mechanisms comes from animal studies. Diet is one of the things that matter most for which bacteria thrive.
Four channels the gut uses to talk to the brain
What does the research say?
In a large review in the journal Molecular Neurobiology (2025), Nikdasti and colleagues went through the dietary tools that can affect the connection between gut and brain, from a ketogenic diet to caring for the gut's bacteria directly. They describe how the bacteria affect the brain along several routes at once, and how diet can be used as a tool for better mental health.
One key point is that you repeatedly find an imbalance in the gut flora in people with depression, anxiety and other mental health conditions. And even more interesting: some trials find that mental symptoms improve as gut balance is restored, but the results are still mixed, and it is unclear what is cause and what is effect.
The gut makes many of the same signaling chemicals as the brain
One of the most surprising findings is that the gut makes many of the same signaling chemicals the brain uses to steer mood and thinking. Around 95 percent of the body's serotonin, often called one of the body's "happiness chemicals", is made by special cells in the gut wall and not in the brain, and in a mouse study (Cell, 2015), certain gut bacteria made those cells produce more. This gut serotonin does not cross into the brain, but it acts on the gut's own nerves and the signals that travel up the vagus nerve.
As described in a review in Advances in Nutrition (2021) by Berding and colleagues, animal studies show that certain bacteria can also make GABA (the brain's main "brake", which calms anxiety and stress), dopamine (the chemical behind motivation and pleasure) and building blocks for memory and learning in the gut; how much this affects the human brain is still being studied.
Berding and colleagues highlight diet as one of the factors that matter most for which bacteria thrive in the gut, alongside genetics, mode of birth, exercise and medication use, and therefore which signaling chemicals they make. A diet with many different plant fibers, fermented foods and colorful plant compounds (found in berries, tea, coffee and dark chocolate) helps exactly the bacteria that make the beneficial signaling chemicals.
Short-chain fatty acids: the gut's gift to the brain
When the bacteria break down fiber, they make short-chain fatty acids (SCFAs), mainly butyrate, propionate and acetate. They are not only fuel for the gut's cells. In animal studies, they also affect the brain.
In animal studies, butyrate appears to strengthen the blood-brain barrier (the filter that keeps harmful substances in the blood out of the brain), calm inflammation in the brain, and switch on BDNF, a substance that works like fertilizer for brain cells and is important for memory and learning.
In animal studies, short-chain fatty acids also affect the body's stress system, which controls the stress hormone cortisol. In a randomized trial of 66 healthy men (Neuropsychopharmacology, 2020), short-chain fatty acids released in the colon for a week dampened the cortisol response to a stress test more than a placebo (a dummy treatment) did, but mood did not change.
Keto and the gut's bacteria: a mixed picture
Nikdasti and colleagues describe how a ketogenic diet affects the gut's bacteria in a complex way. The diet has possible benefits for mental health along several routes, but it also affects the bacteria in ways worth watching.
On the good side, during ketosis the body makes BHB (the main ketone body), which can reach the brain and be used as fuel there. In animal studies, BHB can turn down a specific inflammation switch in the immune system (the NLRP3 inflammasome). Whether the same happens in people with depression, and whether it shows in symptoms, is not yet settled.
On the other hand, a strict keto diet can make the gut flora less varied. Because many fiber-rich foods like whole grains, legumes and most fruit are limited on keto, there can be fewer of the fiber-eating bacteria like Bifidobacterium. And those are exactly the ones that make the beneficial short-chain fatty acids.
One small trial has compared keto with a Mediterranean diet, rich in vegetables, fish and olive oil, and measured both mood and gut flora. The Spanish randomized trial (Brain, Behavior, and Immunity, 2026) enrolled 64 adults with obesity who were not selected for depression but had mild depressive symptoms at the start. Only 37 completed the three months, including 14 of the 32 on keto, all of them women, and only those 37 were analyzed. Among them, the Mediterranean diet improved depressive symptoms more than keto, while impulsivity fell more on keto, and Bifidobacterium in the gut decreased in the keto group. When the researchers transferred stool from the participants to mice (9 per group), the mice from the keto group showed more anxiety-like behavior than the mice from the Mediterranean group.
Bacteria aimed at mood
Psychobiotics are beneficial bacteria that researchers are studying for their effect on mood. In a mouse study (PNAS, 2011), a strain of Lactobacillus rhamnosus reduced anxiety-like behavior and stress hormone levels via the vagus nerve, but in a randomized trial of 29 healthy men (Brain, Behavior, and Immunity, 2017), the same strain worked no better than placebo on stress or mood. Nikdasti and colleagues also review transferring gut flora from a healthy donor as a possible treatment for depression.
What does this mean in practice?
The advice that is good for the gut's bacteria holds, whatever the research ends up showing about mood. Here are the key points, first for everyone and then for those who follow keto.
Good advice for everyone
- Eat fermented foods every day: sauerkraut, kimchi, kefir, yogurt with live cultures and kombucha contain beneficial bacteria that help your gut flora. If you take an MAOI for depression, fermented and aged foods can cause dangerously high blood pressure, so stick to the food list you were given.
- Switch between many kinds of fiber: different fibers feed different bacteria. The more you vary, the more varied your gut flora becomes, and it is exactly this variety that links to better mental health.
- Eat colorful plant foods: berries, green tea, dark chocolate (at least 70 percent cocoa) and olive oil contain plant compounds that act as food for the beneficial bacteria.
Extra advice if you follow keto
- Choose keto-friendly fiber: psyllium husk, chia seeds, flax seeds, avocado and low-carb vegetables (broccoli, cauliflower, spinach) provide fiber without breaking ketosis.
- Eat fiber vegetables that feed the bacteria: garlic, onion, asparagus and leeks contain fibers that especially feed the beneficial Bifidobacterium and Lactobacillus.
- Supplements of beneficial bacteria are rarely necessary: a supplement with several strains of Lactobacillus and Bifidobacterium can be considered, but it has not been shown to make up for the less varied gut flora on keto.
- Avoid heavily processed keto products: keto bars, keto bread and the like often contain additives that can irritate the gut and disturb the bacteria.
In brief
The connection between the gut's bacteria and mental health is one of the most exciting fields in brain research. In animal studies, the bacteria affect mood, stress and thinking through signaling chemicals, fatty acids and the immune system. In humans the link has been seen, but it has not been shown that the bacteria are the cause. If you follow keto, it is a good idea to make up for the diet's limits with fiber and fermented foods.
Who is this for?
The gut flora's role in mental health is relevant for most people, but especially if you:
- Have depression or anxiety: beneficial bacteria and fiber can be one piece of a bigger plan, not a replacement for therapy or medication. Talk to your psychiatrist or doctor before you change your diet, and never stop medication on your own. If you have thoughts of self-harm or suicide, call or text 988, which is open 24/7, or call 911 right away.
- Take SSRI or SNRI antidepressants: they can cause too little sodium (salt) in the blood, especially in older people and people with low body weight, and the salt loss at the start of keto pulls the same way. Headache and nausea can be signs of it, so have your sodium checked, and contact your doctor the same day if you become confused.
- Take an MAOI (an older type of antidepressant): aged cheeses, salami, fermented foods such as sauerkraut and kimchi, and soy and fish sauce can contain tyramine, a substance that together with the medication can cause dangerously high blood pressure. Stick to the food list you were given.
- Notice signs of mania: if you sleep much less than usual without feeling tired, have unusually high energy, or your thoughts race during your first months of keto, contact your doctor or psychiatrist the same day. This is called hypomania, or mania in its more severe form. It applies even if you have never had bipolar disorder.
- Take lithium (a mood-stabilizing medication for bipolar disorder): your kidneys get rid of lithium along with salt, so the salt loss in the first weeks of keto can change your lithium level. Start only with your psychiatrist's agreement, and have the level checked.
- Take antipsychotic medication (such as olanzapine, clozapine or quetiapine): it often raises blood sugar and cholesterol. Keto can lower blood sugar but raise LDL cholesterol, the type of cholesterol that can build up in your arteries, so have your doctor follow both with blood tests. If you take clozapine, contact your doctor about constipation, which both the medication and keto can cause.
- Have IBS, inflammatory bowel disease (IBD) or another bowel disease: bacteria and fiber must be chosen individually. Certain strains or fibers can make symptoms worse.
- Have just taken antibiotics: the gut flora may be knocked off course. Build it back up slowly with fermented foods and many kinds of plant fiber.
- Are pregnant or breastfeeding: beneficial bacteria are generally considered safe, but the dose and strain should be agreed with your OB-GYN or doctor.
- Have a weakened immune system: certain bacterial strains can be risky. Seek guidance from a specialist.
- Have or have had an eating disorder: a focus on gut health can take over and turn into an unhealthy obsession with "clean" food. Be careful.
Related Reading
The gut flora is linked to the brain, the immune system and metabolism. These articles explore the connections:
- Fasting and brain neuroplasticity covers fasting and the brain chemical BDNF, where most findings come from animal studies.
- Artificial sweeteners disturb the connection between gut and brain covers how certain sweeteners, mostly in animal studies, can disturb the same connection.
- Keto reshapes the gut flora and calms inflammation covers how keto changes the gut flora, and how in mouse studies this dampened inflammatory cells in the gut.
