Gut-Brain Connection: How Your Gut Affects Your Mood
The gut-brain connection is a two-way communication system between your digestive tract and your brain, running through nerves such as the vagus nerve, hormones, immune signals and gut microbes. Stress can upset your stomach, and gut problems can affect mood. Diet, sleep, activity and stress care all influence this link.
This guide is for anyone whose stomach acts up when they're anxious, who has a functional gut condition such as irritable bowel syndrome, or who wants to eat in a way that supports both digestion and mental health.
Key takeaways
- The enteric nervous system, sometimes called the "second brain," is two thin layers of more than 100 million nerve cells lining the digestive tract, according to Johns Hopkins Medicine.
- The gut and brain send signals in both directions, so anxiety can trigger gut symptoms and gut irritation may trigger mood changes.
- Traditional Mediterranean and Japanese eating patterns are linked to a 25% to 35% lower risk of depression than a typical Western diet, per Harvard Health.
- Probiotics have good evidence for a few gut conditions, but there is no established evidence that they treat depression or anxiety.
- Psychological treatments such as cognitive behavioral therapy and gut-directed hypnotherapy can improve digestive symptoms.
What is the gut-brain connection?
It's the constant conversation between your brain and your digestive system. Messages travel through nerves, chemical messengers and the immune system, in both directions.
A few terms help here:
- Enteric nervous system (ENS): the network of nerve cells in the gut wall. Johns Hopkins Medicine describes it as two thin layers of more than 100 million nerve cells running from the esophagus to the rectum. It controls swallowing, enzyme release, blood flow and elimination.
- Vagus nerve: a long nerve linking the brainstem to many organs, including the gut. It carries a large share of gut-to-brain messages.
- Gut microbiome: the huge community of bacteria, fungi and other microbes living in your intestines. Our explainer on what your gut microbiome is covers the basics.
- Gut-brain axis: the scientific name for the whole system: nerves, hormones, immune signals and microbes working together.
The ENS doesn't think the way your brain does, but it does talk to it. Johns Hopkins explains that researchers now think irritation in the gut may send signals to the central nervous system that trigger mood changes, not just the other way around.
How do the gut and brain communicate?
Through several channels at once: nerves, immune signals, hormones and chemical messengers, some of them made or influenced by gut microbes.
- Nerve signals. A review in Advances in Experimental Medicine and Biology describes how animal studies suggest gut microbes can activate the vagus nerve, and that vagal signals can have either anxiety-promoting or anxiety-reducing effects depending on the stimulus.
- Immune signals. The same review describes an anti-inflammatory reflex: gut signals travel to the brain, which sends a calming response back to immune cells. Because inflammation can affect mood, this is one proposed route between gut health and mental health.
- Chemical messengers. Harvard Health notes that about 95% of the body's serotonin is produced in the gastrointestinal tract. That doesn't mean your gut directly sets your mood, but it shows how tightly the systems overlap.
- Stress hormones and gut movement. Harvard Health explains that stress and other psychological factors change how the gut moves and contracts, and that people with functional gut disorders often feel gut pain more intensely because the brain responds more strongly to gut signals.
Much of the microbe research is still in animals. Treat bold claims about curing anxiety with a specific bacteria strain with caution.
Can gut problems cause anxiety or depression?
They can contribute, and the reverse is also true. The relationship runs both ways, which is why gut and mood symptoms so often show up together.
Johns Hopkins notes that people with irritable bowel syndrome and functional bowel problems develop depression and anxiety at higher than normal rates, and that up to 30% to 40% of the population has functional bowel problems at some point. Harvard Health makes the same point from the other direction: anxiety, stress and depression can cause stomach and intestinal distress, and stomach distress can cause anxiety.
That doesn't mean symptoms are "all in your head." Harvard Health stresses that stress-related gut changes are real physical changes in how the gut works. It's also why gastroenterologists sometimes prescribe certain antidepressants for IBS: according to Johns Hopkins, they can calm gut symptoms by acting on nerve cells in the gut.
If emotional stress shows up in your body in other ways too, our guide to somatic exercises for anxiety offers body-based calming techniques.
How does diet affect mood and mental health?
Overall eating patterns matter more than any single "superfood." Diets rich in plants, whole grains, fish and fermented foods are linked to lower depression risk, while diets high in refined sugar and processed foods are linked to worse mood.
Harvard Health reports that traditional Mediterranean and Japanese diets are associated with a 25% to 35% lower risk of depression compared with a typical Western diet. These diets are high in vegetables, fruits, unprocessed grains and fish, with modest amounts of lean meat and dairy, and many include fermented foods. The same article links diets high in refined sugar to inflammation, oxidative stress and worse mood symptoms. These are associations, so they show a link, not proof that diet alone causes or cures depression.
| Food pattern | Why it may help or hurt the gut-brain link | Practical swap |
|---|---|---|
| Vegetables, fruit, beans, whole grains | Fiber feeds gut microbes; part of patterns linked to lower depression risk | Add one extra serving of beans or vegetables a day |
| Fish and olive oil | Core of Mediterranean-style eating | Fish twice a week instead of processed meat |
| Fermented foods (yogurt, kefir, kimchi, sauerkraut) | Act as natural sources of live microbes | Plain yogurt instead of a sugary dessert |
| Refined sugar and highly processed foods | Linked to inflammation and worse mood symptoms | Whole fruit instead of sweets; cook simple meals more often |
Fiber is the easiest place to start. Mayo Clinic cites daily targets of 25 grams for women 50 or younger, 21 grams for women over 50, 38 grams for men 50 or younger and 30 grams for men over 50. Add it slowly over a few weeks and drink enough fluids to avoid gas and bloating. Our list of affordable high-fiber foods makes this easier on a budget.
On the other side, it's worth knowing the common foods that can upset your gut and why ultra-processed foods are so easy to overeat. If certain meals leave you foggy, see our piece on foods that drain energy and cause brain fog.
Do probiotics help with mood?
Not in any proven way yet. Probiotics have evidence for specific gut problems, but research on mood is early.
The National Center for Complementary and Integrative Health says that for most conditions it is still unknown which probiotics help, how much to take or who benefits. The strongest evidence is for preventing antibiotic-associated diarrhea. Evidence for IBS and constipation is mixed. NCCIH also notes that some products contain microbes not listed on the label, and that people with weakened immune systems or serious illness face greater risk of harm.
If you want live microbes, fermented foods are a low-risk way to get them as part of a balanced diet. Talk with your doctor before taking supplements, particularly if you have a serious health condition.
Practical ways to support your gut-brain health
Small, steady changes beat a dramatic "gut reset." Use this checklist:
- Build meals around plants. Aim for vegetables, fruit, beans and whole grains most days, following our simple ways to improve gut health.
- Increase fiber gradually toward the Mayo Clinic targets, with plenty of fluids.
- Include fermented foods a few times a week if you tolerate them.
- Cut back on added sugar and highly processed snacks.
- Run a food and mood log. Harvard Health suggests tracking how foods affect your mood and energy, including the next day.
- Manage stress daily with walking, breathing exercises or whatever reliably calms you.
- Protect your sleep and stay active. Both influence gut function and mood.
- Ask about gut-directed therapy. Johns Hopkins lists cognitive behavioral therapy and medical hypnotherapy as mind-body treatments that may help IBS.
Better nutrition is one of the cheaper mental health investments available, a theme explored in our piece on how small nutrition investments pay off.
Common mistakes
- Expecting a probiotic to fix depression. Current evidence doesn't support it. Proven treatments for depression and anxiety come first.
- Going from low to high fiber overnight. That's a fast route to bloating and cramps.
- Cutting out whole food groups without a reason. Restrictive "gut healing" diets can shrink the variety your microbes rely on. Elimination diets for IBS work best with professional guidance.
- Assuming gut symptoms are just stress. Stress can cause real gut symptoms, but other conditions need to be ruled out first.
When to see a doctor
See your doctor promptly if you have:
- Blood in your stool or black, tarry stools
- Unexplained weight loss
- Persistent vomiting or difficulty swallowing
- Gut symptoms that wake you from sleep, or ongoing changes in bowel habits
- A fever with abdominal pain, or severe abdominal pain
- Low mood, anxiety or loss of interest that lasts for weeks or affects work, relationships or daily life
If you are thinking about suicide or self-harm, get help now. In the US, call or text 988 to reach the 988 Suicide and Crisis Lifeline, which is free, confidential and available 24/7. Elsewhere, contact your local emergency number or crisis line.
Frequently asked questions
Why is the gut called the second brain?
Because the enteric nervous system contains more than 100 million nerve cells, according to Johns Hopkins Medicine, and can run digestion largely on its own. It doesn't think or make conscious decisions, but it exchanges constant signals with the brain, which is why stress, emotions and digestion affect each other so strongly.
Can you heal the gut-brain connection?
You can improve it. There's no single cure, but steady habits help: a fiber-rich, mostly whole-food diet, regular activity, good sleep and stress management. For IBS and related conditions, Johns Hopkins notes that cognitive behavioral therapy, gut-directed hypnotherapy and certain medicines can calm symptoms by acting on gut-brain signaling.
What foods are good for the gut-brain axis?
Vegetables, fruit, beans, whole grains, nuts, fish, olive oil and fermented foods such as yogurt and kefir. These make up the Mediterranean and traditional Japanese patterns that Harvard Health links to a 25% to 35% lower depression risk. Limiting refined sugar and highly processed foods matters as much as adding good foods.
How long does it take to notice changes after improving my diet?
It varies. Harvard Health suggests trying a cleaner diet, without processed foods and added sugar, for two to three weeks and then noticing how you feel as you reintroduce foods. Fiber changes should be gradual over a few weeks. Mood is shaped by many factors, so diet is one support, not a replacement for treatment.
What to do next
- Start a two-week food, mood and symptom log to look for patterns.
- Add one high-fiber food and one fermented food to your week, then build from there.
- Pick one daily stress habit, such as a 10-minute walk after dinner, and stick with it.
- Book a doctor's visit if gut symptoms or low mood have lasted for weeks, and ask about both medical and psychological treatment options.
This article is for general information and is not medical advice. Talk with your doctor before changing medicines or starting supplements.
Sources
- Johns Hopkins Medicine: The Brain-Gut Connection
- Harvard Health: The gut-brain connection
- Harvard Health: Nutritional psychiatry, your brain on food
- NCCIH: Probiotics, What You Need To Know
- Vagal pathways for microbiome-brain-gut axis communication (review, 2014)
- Mayo Clinic: Dietary fiber
Last reviewed: October 2026.

Comments
Post a Comment