Most of us know that going to bed on a full stomach can affect our sleep.
Changing what we eat and the time of day we eat certain foods can help us sleep better.
We've all woken up in the morning after a hearty late-night meal feeling exhausted.
The extra energy required to digest large amounts of heavy food can affect our sleep, leading to a disturbed night's sleep.
Fortunately, there are ways we can try to improve our sleep through diet by avoiding certain types of foods and drinks known to keep us awake, such as those containing caffeine.
But can we also eat other foods – especially before going to bed – to further enhance the quality of our sleep?
Food or nutrition
Several studies have narrowed down the choices to a specific type of dinner that can improve our sleep.
Some small tests have shown that tart cherry juice, for example, can help people sleep better, and others have shown that eating kiwi before bed can also be beneficial.
Some research also shows that warm milk can help us sleep better.
It is believed that the high levels of tryptophan - from which the "sleep hormone" melatonin is synthesized in the body - in milk can help us fall asleep more easily.
Melatonin regulates our sleep-wake cycle.
Our bodies produce more of it later in the day, when it starts to get dark.
But we can also get melatonin directly from food, which includes eggs, fish, nuts, and seeds.
Studies have shown that tart cherry juice helps with sleep.
Numerous studies have shown that foods rich in melatonin can improve sleep quality and help us sleep longer.
But there is also research that suggests that just any one food or drink is not enough to improve sleep - but that our overall diet is important.
"You can't eat poorly all day and think that drinking a glass of tart cherry juice before bed is enough," says Marie-Pierre Saint-Onge, a professor of nutritional medicine at the Institute of Human Nutrition at Columbia University in New York.
That's because extracting nutrients from food that the body can use to produce sleep-enhancing neurochemicals doesn't happen within a few hours, she says.
Instead, the quality of our sleep can be improved by what we eat throughout the day.
What type of diet helps sleep the most?
Research shows that the most beneficial diet for sleep is a plant-based one that includes plenty of whole grains, dairy products, and lean proteins like fish, says Erika Jensen, assistant professor of nutritional sciences at the University of Michigan in the US.
In her 2021 study looking at the relationship between sleep and diet, Jensen found that people who started eating more fruits and vegetables every day over a three-month period could dramatically improve their sleep.
Low tryptophan intake was associated with a higher risk of short sleep and a higher risk of insomnia.
More than 1.000 participants were tasked with increasing their daily intake of fruits and vegetables.
This increase was done to disentangle the bidirectional relationship between sleep and diet that complicates research in this area - population studies may show that people who have healthier diets sleep better, but there's always a chance that they make better food choices because they're more rested.
Jensen found that women were more than twice as likely to experience improvement in their insomnia symptoms after eating an additional three servings of fruits and vegetables or more per day.
One reason for this is that fruits and vegetables (along with meat, dairy products, nuts, seeds, whole grains, and legumes) are generally rich in the essential amino acid tryptophan.
In a 2024 study conducted in Spain, more than 11.000 students were surveyed about their sleep and eating habits.
It showed that the quartile that took the least tryptophan daily had significantly worse sleep outcomes.
Researchers conclude that low tryptophan intake is associated with a higher risk of short sleep and a greater risk of insomnia.
Eating foods that contain more tryptophan could improve sleep quality, they suggest.
The reason tryptophan is important, says Jensen, is because it is a precursor to serotonin, which is then converted into melatonin.
“If the body lacks tryptophan or direct sources of melatonin from food, the levels of melatonin produced by the body will be reduced,” she says.
But it's not all as simple as eating tryptophan-rich foods, she adds.
It must be eaten with fiber-rich carbohydrates, such as whole grains or legumes.
This allows it to be properly digested and reach the brain, where it can improve sleep.
There are also many other ways in which a plant-rich diet can improve sleep.
A diet rich in plant foods is known to reduce inflammation in the body, for example, and some research shows that lower levels of inflammation are associated with better sleep quality.
In her research, Saint-Onge found that improved sleep was associated with a diet rich in fiber, which plays a key role in bacterial fermentation in our intestines.
Studies show that there are a number of possible beneficial mechanisms that may explain why a healthy gut can improve sleep, via the gut-brain axis.
Magnesium is another reason why a plant-rich diet could lead to a good night's sleep.
There are also animal studies that show a link between improved sleep and intake of beneficial plant compounds called polyphenols.
However, says Saint-Onge, it is difficult to assess this in human studies because databases showing the polyphenol content of different foods - which would be used to measure how much a person consumes - may not be completely accurate.
This is because the amount of polyphenols in food varies from crop to crop, from year to year, depending on soil type, weather conditions, and farming processes.
The same goes for the amount of melatonin in plant foods, which can also vary depending on how and where they were grown.
- If you like to get up early, this is for you
- How to nap properly
- You want a good night's sleep - this is how you get ready for bed
How useful is magnesium?
Magnesium is another nutrient found in plant-based foods that can lead to a good night's sleep.
This is because it can help reduce the stress hormone cortisol, which calms the nervous system.
It is recommended that most adults over the age of 30 consume about 420 milligrams of magnesium per day.
It can be found in many foods, including green leafy vegetables, such as spinach, as well as legumes, seeds, and whole grains.
However, many people are deficient in this nutrient.
Experts say this is partly due to the Western diet (which is low in plants and high in ultra-processed foods), and partly because intensive farming practices reduce the amount of magnesium in the soil where crops grow.
In her 2024 study, Heather Hausenblas, a science professor at Jacksonville University in Florida, USA, tested the effects of increased magnesium intake on people who complained of poor sleep.
They took a magnesium supplement an hour before bed for two weeks, while taking a placebo pill for the second two-week period.
Their sleep was measured via a body-worn tracker and they also talked about their own impression of how well they slept.
Hausenblas found that participants' deep and REM sleep improved more when they took magnesium, compared to when they took a placebo.
She suspects this effect would last longer than two weeks, but she can't be sure.
However, while she says a quality magnesium supplement can help people sleep better, Hausenblas argues that it is not a universal solution.
One of the most important things to do before bed is to stop eating a few hours before bed, and especially not to consume the majority of your calories before bed – Erika Jensen
"Just taking this before bed won't cure all your sleep problems if you don't get out and exercise, eat a lot of ultra-processed foods, and don't have a consistent sleep-wake cycle," she says.
Another reason why magnesium could improve sleep is because of its potential mental health benefits.
Research has shown that poor sleep and depression, for example, are closely linked.
A 2017 study showed that daily magnesium supplementation led to significant improvements in depression and anxiety, regardless of a person's age, gender, or severity of depression.
Overall, research shows that a diet rich in fruits and vegetables can improve symptoms of depression.
- Can food preparation be dangerous to health?
- Does diet affect infertility?
- Sea moss - superfood or a passing health trend
Can how we eat have an impact?
And while researchers agree that one carefully chosen dinner isn't enough to save us from a night of poor sleep, there may be something we can do about the timing of our meals throughout the day.
"One of the most important things to do before bed is to stop eating a few hours before bed, especially so that you don't consume the largest amount of calories before bed," says Jensen.
When you have a clearer separation between day and night, it's easier for the brain to recognize that it's time to sleep - Erika Jensen.
There is a small body of research showing that eating meals earlier in the day, starting with breakfast, is associated with better sleep quality.
Research shows that eating your last meal closer to bedtime can increase the time it takes you to fall asleep.
This may be partly because it makes it easier for us to associate eating with the day and night with sleep, says Jensen.
"When you have a clearer separation between day and night, it's easier for the brain to recognize that it's time to sleep," she says.
"The brain starts fresh every morning and exposure to light early in the morning is important to reset our body clock."
Some studies suggest that taking melatonin supplements can improve our sleep, but we can also get melatonin from food.
“Eating cues are another good way to tell your body what time it is,” says Jensen.
"The feelings in the body work best when we do the same things on the same good days."
And when you eat that breakfast, keep in mind that one study showed that eating a dairy-rich breakfast in bright daylight may be more beneficial for sleep than eating it in a dimly lit room.
That's because, researchers say, eating in daylight allows our bodies to produce more melatonin, a hormone that helps us sleep at night.
However, says Saint-Onge, scientists have not yet provided any definitive answers as to whether the melatonin we get from plants affects the melatonin our body produces, and how that might affect our sleep.
"Also, is our metabolism affected by what we eat? That could be relevant to sleep. We need to dig deeper into these mechanisms," she says.
Jensen agrees that this is a difficult area to research, with several unanswered questions, including the amount of melatonin we need in our diet for it to have any effect on our sleep.
"It's difficult to study whether light has an effect on melatonin alone from diet, or whether they work together," she says.
Optimizing our sleep diet
A plant-rich diet appears to be most beneficial for sleep, for a number of reasons – and eating at the same time during the day – for those who can – may also be helpful.
But our diet doesn't exist in a vacuum, and researchers point out that our sleep is also affected by how much we move during the day, our mental health, and our exposure to light and darkness.
Also, says Saint-Onge, it is important to distinguish poor sleep from sleep disorders, such as insomnia or apnea.
“If you have a sleep disorder, you need to get tested and treated,” says Saint-Onge.
"Part of the treatment plan could be improving your diet, but some people will need something more than that."
BBC is in Serbian from now on and on YouTube, follow us HERE.
Follow us on Facebook, Twitter, Instagram, YouTube i Viber. If you have a topic proposal for us, contact us at bbcnasrpskom@bbc.co.uk
- Going to bed earlier affects heart health
- When there will be no sleep
- Does getting up early improve health?
Bonus video: