How gut health affects your sleep – and how to improve it

Discover how gut health and sleep are linked – and what to eat for a good night’s rest.

If you’re trying to sleep better, thinking about how to improve your gut health might not be the first thing that comes to mind.

In fact, gut health and sleep are like flowers and bees – one can’t be altered without it affecting the other. In recent years, researchers have learned more about the intricate links between the gut and brain, and in turn, our sleep 

If you don’t sleep as well as you’d like, you’re not alone. Holland and Barrett’s 2023 Wellness Trend Report has highlighted that two in three people experienced poor quality sleep in the last six months. And we know poor sleep can have a knock-on effect on our health

Man in bed clutching his stomachCredit: Shutterstock/wavebreakmedia
Sleep and gut health have intricate links

Research shows that a healthy gut may promote better sleep, and the opposite can also be true – so it’s a win-win.

If you want to get your diet and sleep routine back on track, nurturing both your gut health and sleep could help you do just that. Below we explore how.


1. The gut-brain axis

How your gut connects to your brain

If you’ve ever felt “sick to your stomach” or had “butterflies” in your tummy before something exciting or important, this is evidence of the link between your gut and brain (known as the gut-brain axis).

The gut-brain axis is a two-way communication system; your gut can send signals to your brain and, likewise, your brain can affect the makeup of your gut microbiome – the trillions of microorganisms (bacteria, viruses and fungi) that live in your digestive tract.  

Dr Caitlin Hall, a dietitian who researches the gut microbiome-brain axis, says: “One of the main ways your gut communicates with the brain is via the vagus nerve, which runs directly from the gut to the brain.”

Signals using neurotransmitters (chemical substances) sent from your gut can affect brain processes related to sleep, energy, appetite, mood and stress levels. 

It’s important to understand this connection because the brain uses the body’s 24-hour internal clock called our circadian rhythm. This process tells our bodies when it’s time to sleep and time to wake. 

2. How gut health can affect sleep

Diverse gut bacteria could be the answer to a sound night’s sleep

Could your gut be keeping you awake at night? Quite possibly.

Hall says: “A lot of research shows that specific types of bacteria in your gut microbiome are associated with sleep quality. And how well you sleep is also linked to the diversity of your gut bacteria.” 

In a recent study, researchers analysed samples of people’s gut bacteria. Participants were then asked to wear an activity watch for 30 days to record their sleep behaviour.

Results showed that a more diverse gut microbiome was linked to longer sleep times and better sleep efficiency (the amount of time the participants actually spent sleeping while they were in bed) as well as to fewer sleep disturbances.

Gut bacteria in a magnifying glass with clay example of gut next to itCredit: Shutterstock/FOTOGRIN
How well you sleep and your gut bacteria are linked

Some studies show that gut bacteria are sources of sleep-inducing signals and influence our circadian rhythm. However, Hall says it’s important to note that this is still an early area of research. 

Scientists are also still learning more about our microbiome, but it’s estimated that each person has around 1,000 species of bacteria in their gut. Maintaining gut microbiome diversity becomes even more important as you age, as it tends to reduce in later life. 

Sleep coach Alasdair Graham who advises patients through Sleepstation, agrees more research needs to be done to understand the link between the gut and sleep.

Some evidence suggests that it may be possible to influence sleep through manipulation of the gut microbiome.  

“However, an equal amount of evidence shows that such manipulations wouldn’t have any effect on sleep.

“We’re still at the very early stages of this type of research and further studies are needed for us to understand this relationship further.” 

In the meantime, we already know that looking after your gut microbiome can have other health benefits, and it certainly won’t do your sleep any harm. 

3. How sleep affects gut health

Get enough sleep to help curb sugar cravings

While sleep itself doesn’t directly aid digestion, it can affect our digestive health.

Graham says: “Poor sleep can affect our guts in a variety of ways, including causing changes to our appetite.

“Our digestive system is responsible for releasing the hormones which tell us we’re full.

“When you don’t get enough sleep, how these hormones are released can be affected, meaning you can end up eating more than you would after a good night’s sleep.” 

Lack of sleep could also make us more likely to eat foods with higher sugar and fat content. And worse sleep has also been linked to gastrointestinal diseases,  including gastro-esophageal reflux disease (GERD), ulcers, bowel inflammation, irritable bowel syndrome or disease (IBS/IBD) and bowel cancer. 


4. Circadian rhythms, the gut and sleep

Your gut has a body clock, too

It’s not just our brain which uses a circadian rhythm to understand what time of day it is. The microbes in our gut have their own circadian rhythm too.

Graham says: “In addition to our internal light/dark clock, we also have an internal food-related clock. This means our body clock can be influenced by the timings of meals.” 

These circadian rhythms affect the gut bacteria’s production of serotonin (a messaging chemical which plays an important role in regulating sleep, gut health, mood and other body functions).

They affect production of short-chain fatty acids, produced when gut bacteria ferment dietary fibre, and which have many health benefits throughout the body.

These chemicals affect our body’s circadian rhythm, and in turn our sleep and wake cycles.  

Hall says: “A type of short-chain fatty acid called butyrate, which is produced by our gut bacteria when we feed them with lots of natural fibres, can modulate sleep as well as anxiety and stress.” 

Having a healthy gut is important for creating these substances. This is because around 95% of your serotonin, which is needed to produce the sleep hormone melatonin, is made within your gut.  

“If your gut microbiome isn’t great, then you might not be so efficient at making melatonin,” says registered nutritionist and sleep author Rob Hobson. In turn, this means your sleep cycle might become off track. 


Clock with person in the middleCredit: Shutterstock/kanyanat wongsa
The microbes in our gut have a circadian rhythm

One study in mice found that when gut bacteria had been significantly reduced by antibiotics, this led to lower serotonin levels and in turn led to disrupted sleep cycles. More research is needed to see if this is the case in humans. 

In humans, circadian rhythm disruption has been found to be linked to gastrointestinal diseases such as irritable bowel syndrome. Certain factors, such as diet and meal timing, that affect our gut microbiome affect our circadian rhythm too.  

There is some evidence (at least in mice) that an unhealthy diet can affect your body clock as well as your overall health.

In one study, mice were fed a high-fat, high carb diet consisting of processed foods (to reflect the Westernised diet).

As a result, the mice experienced significant disturbances to their gut microbe circadian rhythms, which affected their body clocks and overall health.

Based on this research, it seems likely that a diet that is higher in plant foods and lower in processed foods can help to normalise gut circadian rhythms, as well as having other health benefits which are already well proven.  

Irregular eating patterns, such as skipping meals and eating late at night, can also disrupt gut microbe circadian rhythms. Meanwhile it seems that certain changes to eating behaviours, such as time-restricted eating (when you only eat during a specific time window each day) can positively affect these gut microbe rhythms. 

5. What to eat for your gut and sleep

Plants and fermented foods look after your gut and brain

Hobson says: “Make sure that your diet contains foods that can help support your microbiome and the bacteria in there to flourish.”

Foods for a healthy gut include: 

  • Fermented foods, which are rich in probiotics, such as kimchi, kefir, sauerkraut and kombucha. Hobson says eating these foods help to maintain the diversity of bacteria in your gut. 
  • Foods that contain fibre, such as onions, garlic, bananas, beans, lentils, barley, oats and rye. The different types of fibre in these foods will help to feed your gut bacteria. 
  • Healthy fats are important for brain health as well as gut health. Foods containing healthy fats include olive oil, oily fish, avocado, and nuts. 
  • Green leafy vegetables, beans, pulses, which are good sources of magnesium. Hobson says this nutrient is important for sleep because it is used to make serotonin. 
  • Foods rich in tryptophan, such as oats, beans, pulses and tofu, says Hobson, as this amino acid makes its way to the brain to also produce serotonin. “Tryptophan has to compete with lots of other amino acids to reach the brain, so I would recommend eating a tryptophan-rich food along with a carbohydrate which will push all of those other amino acids out of the way so that tryptophan can reach the brain more easily.”  
  • Plants – aim to eat 30 different plants per week. This number is suggested because multiple studies have found people who eat at least 30 different plant-based foods per week have more diverse gut microbes. Hall backs this as a way to support your gut health and therefore sleep. Personalised nutrition app ZOE has also found that a diet rich in minimally processed plant-based foods is linked to 15 good gut microbes, emphasising the importance of increasing your gut bacteria diversity. 

6. How to eat before sleep

Don’t eat too much – and watch out for spices

The standard advice is to leave two to three hours between your last meal of the day and going to bed.

Graham explains: “When we sleep, our bodies take that time to rest and recuperate.

“But if we eat a big meal close to bedtime, we’re forcing the body to do work, rather than rest.”

He adds that in order for us to get a good night’s sleep, our body temperature needs to drop by about 1ᵒC.

“As the body works to digest your meal and burn off the calories, temperature loss is harder to achieve. This can result in difficulty getting to sleep and disturbed sleep once you do drift off.” 

Drawing of intestine with food inside itCredit: Shutterstock/POLIGOONE
Our bodies and digestive system continue to work during the night

Meanwhile, Hobson suggests rice with turkey or chicken could be the “perfect sleepy meal”. 

He also advises avoiding spicy foods before bed, as this can trigger heartburn or indigestion. He adds that this is particularly important for women going through the menopause because “eating spicy foods before bed can trigger hot flushes”. 

Sleep is an active process, meaning our bodies — and digestive system — continue to work during the night. This happens more slowly than during the day, says Graham.

“Intestinal activity is more regular during the night than during the day, with movement of digested products through the intestines occurring at a slower pace.” 

While we’re getting our rest, our digestive contractions slow down, says Graham. “The body stops moving matter out of the body while we sleep. This is why we often have a large bowel movement soon after waking, rather than before we go to sleep.” 

Evidence suggests sleeping on the left-hand side of your body can aid digestion and prevent heartburn, as it allows gravity to move waste through your colon. This can also help to encourage a bowel movement the next morning. 

7. How to sleep better

Tips for better sleep

The NHS recommends aiming for between seven to nine hours of sleep per night and you should be waking feeling refreshed and alert.

To help with this, Hobson says to target the three pillars of sleep: behaviour, environment and diet (BED), which comes from his book The Art of Sleeping. The idea is to create a consistent sleep hygiene routine you can follow each night.  

He says: “Make sure you’re not exposing yourself to blue light emitted from electrical equipment before bed, which can prevent the release of melatonin. Instead, taking a hot bath or reading a book can help you to relax.

“Also, make sure you just use your bedroom for sleep – avoid eating or working in there.”

Other sleep tips to help you rest well, include going to bed when you feel sleepy and aiming to naturally wake regularly at the same time each day. 

“Ensure your bedroom is as quiet as possible, wash your bedding regularly and burn your favourite candle to help create an environment that is conducive to sleep,” Hobson adds.

You should also limit caffeine and alcohol before bed as these can interfere with sleep. 

Rebecca Frew

Written by Rebecca Frew she/her


Becky Frew has written various articles for newspapers and magazines focusing on fitness, is a qualified run leader, and a certified sleep talker trainer who loves to help advise people how they can nod off easier. When she is not writing or reading about fitness, she is at hot pod yoga, bounce class, training for an ultra-marathon or booking anything with a medal and free food at the end.

  • instagram