If you have ever had a bad night's sleep and a bad stomach the next day, you have already met the gut-brain axis. It runs in both directions, and it does most of its work while you are asleep.
This is one of those subjects where the science is genuinely interesting and the internet version is mostly nonsense. So this guide stays close to the human data: what the studies measured, how strong the effects were, which habits actually change the bacteria, and how much of this you can see in your own wearable data.
TL;DR: Gut bacteria and sleep influence each other in both directions. In a 2019 study of 26 men wearing actigraphy for a month, higher microbiome diversity tracked with better sleep efficiency and less time awake during the night. A 2023 Mendelian randomization analysis found several bacterial groups with a causal-looking link to insomnia risk, and found that insomnia also changes the microbiome. Diversity is the recurring theme, and the most reliable ways to increase it are plant variety, fermented foods, and regular sleep and meal timing. Probiotic supplements and consumer microbiome tests are much less useful than the marketing suggests. Expect modest effects measured over weeks, not dramatic overnight changes.
YouTube: Related video
The two-way street, in plain terms
Your gut contains trillions of bacteria, along with fungi, viruses and archaea, collectively called the microbiota. They are not passengers. They ferment fibre into short-chain fatty acids, train your immune system, influence how you handle glucose, and produce compounds that reach your brain.
The communication runs both ways, which is why the direction of cause is so hard to pin down:
- Gut to sleep. Bacteria influence inflammation, neurotransmitter precursors, and vagal signalling, all of which touch sleep regulation.
- Sleep to gut. Short sleep and circadian disruption change gut permeability, food choices, stress hormones and body temperature, which in turn reshapes the bacterial community.
This is why studies that only look at one direction tend to produce confusing results. Both loops are running at once.
How the gut talks to the brain at night
You do not need the full biochemistry, but four channels are worth knowing because they explain why sleep and digestion are so tangled.
The vagus nerve. A large share of the fibres in the vagus carry information upward, from gut to brain. This is one reason gut irritation can change mood and alertness within minutes.
Short-chain fatty acids. When bacteria ferment fibre, they produce butyrate, propionate and acetate. These feed the cells lining your gut, support barrier function, and influence systemic inflammation.
Tryptophan and serotonin. The majority of the body's serotonin is produced in the gut, and serotonin is a precursor to melatonin. Gut bacteria influence how much tryptophan is available to that pathway.
Inflammation. This is the channel with the clearest sleep link. Inflammatory signalling molecules such as interleukin-6 both affect sleep and are affected by it, and poor sleep reliably raises them.
The channels overlap, which is exactly why the honest summary is "plausible and partially demonstrated" rather than "proven."
What human studies actually show
The diversity finding
The most cited human study is Smith and colleagues' 2019 paper in PLOS ONE. They took 26 healthy young men, sequenced their gut bacteria, and then tracked their sleep with actigraphy for 30 days.
The result was a clean correlation between diversity and sleep quality:
- Microbiome richness correlated with sleep efficiency (ρ = 0.479).
- Shannon diversity correlated more strongly with sleep efficiency (ρ = 0.643).
- Higher diversity correlated with less time awake after sleep onset (ρ = -0.537 for Shannon diversity).
- Diversity also correlated with total sleep time and with interleukin-6.
Two things to hold onto here. First, these are correlations in a small sample of young men, so the effect size should be read with caution. Second, the direction matters less than the pattern: it is not one "good" bacterium, it is variety.
The genetic evidence
Observational studies cannot tell you whether bad gut bacteria cause bad sleep or the reverse. Mendelian randomization tries to get closer by using genetic variants as a natural experiment.
Yang and colleagues did exactly that in a 2023 Frontiers in Neurology paper, using microbiome data from the MiBioGen consortium and insomnia data from FinnGen. They found:
| Bacterial group | Direction | Effect |
|---|---|---|
| Family Ruminococcaceae | Higher insomnia risk | OR 1.49 |
| Genus Lachnospiraceae | Higher insomnia risk | OR 1.73 |
| Genus Flavonifractor | Protective | OR 0.60 |
| Genus Olsenella | Protective | OR 0.81 |
Then they ran it the other way. Insomnia also appeared to change the composition of the microbiome. That bidirectional result is the most interesting part of the paper, and it is consistent with everything else in this field: the system is a loop.
A caveat worth stating plainly: Mendelian randomization is a statistical technique, not a clinical trial. Odds ratios in the 1.5 range from genetic instruments should not be read as "eat this and fix your sleep."
What the reviews conclude
A 2024 systematic review in Nutrients looked at the microbiota-gut-brain axis across sleep disorders and metabolic syndrome. Its consistent finding is that sleep disturbance is associated with dysbiosis, meaning a less diverse and less stable community, and that the relationship appears bidirectional.
Nobody has yet shown that fixing the microbiome reliably fixes insomnia in a randomized trial with objective sleep outcomes. That is the gap. Everything you read should be read against it.
What actually changes your microbiome
This is where most articles get vague. Specifics, with honest confidence levels:
1. Plant variety beats plant quantity
Different bacteria ferment different fibres, so eating 30 different plants a week is a reasonable target, not because 30 is magic but because variety is what drives diversity. Herbs, spices, legumes, nuts, seeds, whole grains and vegetables all count.
The evidence for fibre increasing diversity is weaker than the marketing suggests. Fibre reliably increases short-chain fatty acid production and improves metabolic markers, but community diversity does not always budge quickly.
2. Fermented foods have the best diversity evidence
In a 17-week randomized study from Stanford published in Cell in 2021, a high-fermented-food diet steadily increased microbiota diversity and decreased inflammatory markers, while a high-fibre diet did not increase diversity over the same period.
That is one of the few dietary interventions with a randomized, human, diversity-level result. Kefir, yoghurt with live cultures, sauerkraut, kimchi and kombucha are the usual starting points. Start small, because a sudden load of fermented food produces gas and bloating in most people.
3. Meal timing matters more than most people think
Your gut bacteria follow a circadian rhythm too. Eating late shifts fermentation into the hours when your body is trying to cool down and consolidate sleep, which is one reason late dinners show up in overnight data. The late night eating and sleep quality guide covers the mechanism and the practical cutoff.
4. Alcohol is the fastest way to change the community
Even a few drinks changes gut permeability and bacterial composition, and the effect on sleep architecture is immediate and measurable. If you want to see how quickly this reverses, the HRV when you stop drinking guide tracks the timeline.
5. Sleep regularity feeds back into the gut
This is the loop again. Irregular bedtimes, shift work and social jetlag disturb the gut's own clock. If you are changing your diet but sleeping at random hours, you are fighting yourself.
What your watch can and cannot tell you
Your wearable cannot measure your microbiome. It can measure the downstream effects, and that is more useful than it sounds:
- Sleep efficiency and time awake. The closest thing you have to a nightly gut-adjacent outcome.
- HRV baseline. A falling baseline over a week often tracks inflammation, alcohol, late meals and poor sleep together.
- Resting heart rate. Rises with inflammation and with poor sleep, and recovering resting heart rate is a decent signal that a change is working.
- Wrist temperature. Useful for spotting illness and cycle effects that confound everything else.
What it cannot do is isolate the gut. If you change your diet, start sleeping better and cut alcohol in the same week, your data will improve and you will learn nothing about which lever did it.
A three-week experiment that actually answers the question
If you want to know whether this matters for you, run it as a single-variable test.
Week 1: baseline. Eat normally, log your sleep and keep your bedtime stable. Record average sleep efficiency, average time awake, and your HRV trend, not a single night.
Weeks 2 and 3: change one thing. The best single change is adding two servings of fermented food per day, because it has the strongest randomized evidence for diversity. Keep everything else, especially alcohol and bedtime, constant.
Compare the same numbers over the full two weeks. Look for a shift in your baseline, not a single good night. A 2 to 3% improvement in sleep efficiency that holds for ten days is more meaningful than one exceptional night after kimchi.
If nothing changes, that is a real result too. It means your gut was not the bottleneck, and you can stop thinking about it. Century makes this comparison easy because it puts sleep, HRV and resting heart rate on one screen, so a two-week shift is visible at a glance instead of buried across three apps.
What does not work as well as advertised
Probiotic supplements. Strains are specific, doses vary, and most consumer products have not been tested for the outcomes they claim. There is reasonable evidence for specific strains in specific conditions, such as antibiotic-associated diarrhoea. There is very little evidence that a generic capsule improves sleep.
Consumer microbiome tests. They can tell you what is in a stool sample today. They cannot yet tell you what to do about it with confidence, and results vary between samples from the same person.
"Leaky gut" protocols. Intestinal permeability is a real phenomenon, but the supplement stacks sold to fix it are mostly unfalsifiable. If you have symptoms, see a gastroenterologist.
Cutting out entire food groups. Elimination diets can help specific conditions like IBS under supervision. As a general gut-health strategy, they usually reduce plant variety, which is the opposite of what the evidence supports.
When to see a doctor
Gut symptoms that wake you at night, bloody stools, unexplained weight loss, persistent diarrhoea, or a sudden change in bowel habit after 45 all warrant a proper workup. So does insomnia that has lasted more than three months, because that is a treatable condition with a first-line therapy that is not a supplement.
Sleep and gut problems often present together, and treating one badly can make the other worse. If you are in that loop, start with the sleep side, since CBT-I has the stronger evidence base.
The bottom line
Your gut and your sleep are connected, the connection runs both ways, and the most robust signal in the human data is diversity. You do not need a test, a capsule, or a protocol to work on that. You need more plant variety, some fermented food, meals that finish earlier, less alcohol, and a bedtime you keep.
Those are unglamorous changes, and they are the ones with actual randomized evidence behind them. Measure the result over weeks, keep one variable at a time, and let your own data decide whether the effort is worth it for you.
Century AI helps you understand your body with a daily health score, recovery score, and sleep insights, using the watch you already wear.
