You probably already know that how you eat before bed affects your sleep. Maybe you’ve found yourself still lying awake at 2 am after enjoying a cup of coffee with dessert. But did you know that your eating choices throughout the day may also affect your sleep at night?

In fact, more and more evidence shows that overall dietary patterns can affect sleep quality and contribute to insomnia.

I am a nutritional epidemiologist, and I’m trained to look at diets at the population level and how they affect health.

In the US, a large percentage of the population suffers from poor sleep quality and sleep disorders like insomnia and obstructive sleep apnea, a condition in which the upper airway becomes blocked and breathing stops during sleep. At the same time, most Americans eat far too much fatty and processed food, too little fiber and too few fruits and vegetables.

Although it is difficult to determine whether these two trends are causally linked to one another, more and more research points to linkages between sleep and diet and offers hints at the biological underpinnings of these relationships.

Diet and sleep quality

My colleagues and I wanted to get a deeper understanding of the possible link between sleep and diet in Americans who are 18 and older. So we analysed whether people who follow the government’s Dietary Guidelines for Americans get more hours of sleep.

Using a nationally representative dataset of surveys collected from 2011 to 2016, we found that people who did not adhere to dietary recommendations such as consuming enough servings of fruits, vegetables, legumes and whole grains had shorter sleep duration.

In a separate study, we followed more than 1,000 young adults ages 21 to 30 who were enrolled in a web-based dietary intervention study designed to help them increase their daily servings of fruits and vegetables. We found that those who increased their fruit and vegetable consumption over a three-month period reported better sleep quality and reductions in insomnia symptoms.

Research conducted outside the US by my group and others also shows that healthier overall dietary patterns are associated with better sleep quality and fewer insomnia symptoms. These include the Mediterranean diet – a diet rich in plant foods, olive oil and seafood, and low in red meat and added sugar – and anti-inflammatory diets. These are similar to the Mediterranean diet but include additional emphasis on certain components in the diet like flavonoids, a group of compounds found in plants, which are shown to lower inflammatory biomakers in the blood.

Parsing the food and nutrients

Within overall healthy diet patterns, there are numerous individual foods and nutrients that may be linked to quality of sleep, with varying degrees of evidence.

For example, studies have linked consumption of fatty fish, dairy, kiwi fruit, tart cherries and other berries such as strawberries and blueberries with better sleep. One of the common pathways through which these foods may affect sleep is by providing melatonin, an important modulator of sleep and wake cycles in the brain.

Play

Fiber-rich foods like beans and oatmeal and certain protein sources – especially those that are high in the amino acid tryptophan, such as poultry – are also associated with higher-quality sleep. Individual nutrients that may be beneficial include magnesium, vitamin D, iron, omega-3 fatty acids and manganese. Some foods like salmon are sources of multiple nutrients.

Untangling the complexity

One important caveat with a lot of the research on individual foods, as well as diet patterns, is that most studies cannot easily disentangle the direction of the relationships.

In other words, it’s hard to know whether the association is a result of diet affecting sleep, or sleep affecting diet. The reality is that it is likely a cyclical relationship, where a healthy diet promotes good sleep quality, which in turn helps to reinforce good dietary habits.

With observational studies, there are also possible confounding factors, such as age and economic status, that may have important correlations with both sleep and diet.

Foods to avoid for sleep health

Aiming for higher intake of sleep-promoting foods isn’t necessarily enough to get better sleep. It’s also important to avoid certain foods that could be bad for sleep. Here are some of the main culprits:

Interestingly, our group has recently shown that toxicants in food or food packaging, like pesticides, mercury and phthalates – chemicals used to manufacture plastics – can affect sleep. Since toxicants can be found in both healthy and unhealthy foods, this research suggests that some foods can contain a mix of components that are both beneficial and harmful for sleep.

Timing of meals, gender factors

The timing and consistency of eating, known as “chrononutrition” in the sleep research field, also very likely help to explain associations between healthy diets and good sleep.

In the US, eating at conventional meal times as opposed to random snacking has been associated with better sleep. In addition, late-night eating is typically associated with unhealthier food intake – such as processed snacks – and could cause more fragmented sleep.

A final and very interesting piece of this puzzle is that associations between diet and sleep often differ by gender. For example, it appears that the associations between healthy diet patterns and insomnia symptoms could be stronger among women. One reason for this could be gender differences in sleep. In particular, women are more likely than men to suffer from insomnia.

A good night’s sleep

Overall, there is not one magic food or drink that will improve your sleep. It’s better to focus on overall healthy dietary patterns throughout the day, with a higher proportion of calories consumed earlier in the day.

And, in addition to avoiding caffeine, alcohol and heavy meals in the two to three hours before bed, the last few hours of the day should include other good sleep hygiene practices.

These include disengaging from technology, reducing light exposure and creating a comfortable and relaxing environment for sleep. Moreover, allowing enough time to sleep and maintaining a consistent bedtime and wake time is essential.

Erica Jansen is Assistant Professor of Nutritional Sciences, University of Michigan.

This article was first published on The Conversation.