Are you wondering does food affect sleep? Research shows that your eating habits definitely affects your sleep.

About 1 in 3 Americans say they’re sleep deprived, and these deficits are linked to serious illnesses like heart disease, stroke, diabetes, cancer, and depression. Certain patterns of eating could lead to more nightly rest, translating into healthier, more satisfying lives.

Does Food Affect Sleep?

Here are some ways to change your eating habits to get better sleep.

Have tryptophan the right way

Key to improving nighttime rest is picking an eating regimen with plenty of compounds that promote sleep. This doesn’t come down to any one food or ingredient. “It’s more of a holistic profile with various helpful components,” St-Onge says.

One of those is tryptophan, a building block of protein. The body doesn’t make any of it. Rather, we get tryptophan from food: yes, turkey, but also fish, eggs, yogurt, and nuts like walnuts, among other examples. Once eaten, tryptophan passes from the blood into the brain and becomes melatonin, the hormone that triggers sleepiness for nighttime shuteye.

“We need tryptophan in combination with carbohydrate-rich foods,” says Arman Arab, a postdoctoral fellow at Harvard Medical School who specializes in nutrition.

The Mediterranean diet is one regimen loaded with both tryptophan and healthy carbs—those with plenty of fiber. Like carbs, nutrients such as zinc, B vitamins, and magnesium play key roles in converting tryptophan into melatonin for better sleep, and the Mediterranean diet delivers each of these components. Spinach, barley, and whole wheat are great mates for tryptophan-rich foods. Arab recently found that people who follow the Mediterranean diet have better sleep quality and less insomnia. St-Onge has researched similar associations.

Avoid foods that cause inflammation

An ideal diet leaves out foods with substances that could spoil your slumber. They include less healthy carbs like low-fiber, high-sugar cereals, bagels, and fruit juices. People who eat unhealthy carbs tend to wake up more frequently overnight, according to St-Onge’s research.

When frequently consumed, foods high in saturated fats (for instance, beef and chicken with the skin) also contribute to sleep problems.

A common denominator between unhealthy carbs and saturated fats is that they both produce inflammation across the body, an issue linked to lower sleep quality and duration, Arab says. A diet packed with these foods may also lead to excess weight gain, which can cause sleep apnea and pressure on the diaphragm, further disrupting sleep.

Having a wide variety of fruits and vegetables is optimal, says Erica Jansen, an assistant professor of nutritional epidemiology at the University of Michigan. The diversity can “spread out exposure to any one toxicant” such as pesticides or heavy metals—which may disrupt sleep—and it ensures plenty of polyphenols and micronutrients that support sleep partly by lowering inflammation. Jansen found that when women increased their daily fruit and vegetable consumption by three servings, they dramatically improved their sleep quality and insomnia symptoms.

Try other approaches with sleep “superfoods”

Although the Mediterranean regimen is backed by the most research, other approaches could be just as beneficial if they offer the same sleep-promoting nutrients and compounds. Aim for diets with many vegetables, lower-sugar fruits, plant-based proteins, and unsaturated fats. “Such patterns probably influence sleep in the same way” as the Mediterranean approach, St-Onge says.

These strategies include the USDA’s Healthy Eating Index and the Dietary Approaches to Stop Hypertension diet, or DASH. Arab didn’t find a strong link between DASH and having fewer insomnia symptoms, but some other research suggests it’s helpful. The Chinese Healthy Eating Index, another eating pattern with many sleep-supportive ingredients, is also associated with good sleep.

Many ingredients high in fiber can also be found beyond the Mediterranean diet. These sleep-promoting foods include black beans, split peas, sweet potatoes, chia seeds, and flaxseeds.

Start eating early, stop eating early

Like most things in life, timing matters. Research shows that having meals too close to bedtime can hinder sleep. It’s important to wrap up eating for the day a few hours before turning in for the night.

This final meal could feature a plant-based protein such as tofu—which is filling, contains tryptophan, and keeps inflammation low—and a healthy carb like chickpeas to support tryptophan’s passage into the brain. Time it 2-4 hours before bed; that’s how long it takes for tryptophan levels in the body to peak.

Foods that are heavy or have too much sugar or spice, when eaten before bed, are especially likely to cause bloating, blood sugar spikes, and a night of tossing and turning, Jansen says.

Sleep is also disturbed at the other extreme: being really hungry at bedtime. To avoid this scenario, get a headstart on nutrition in the morning. “Wherever we look, individuals who have breakfast, sleep better,” St-Onge says. Keep the same timing each day as much as possible, Jansen adds. “Maintaining a consistent pattern is really important for sleep.”

Be consistent

Does food affect sleep? We know that it does and consistency is the key. People who follow these dietary patterns regularly have better sleep outcomes than those who merely dabble in them, several studies show. Whichever sleep-promoting diet you choose, stick with it. For the biggest improvements in sleep, “make sure you have a healthy diet day in, day out,” St-Onge says. “Give it a week or two” before expecting to see benefits.

Have a vegetable before breakfast

The relationship between food and sleep goes both ways. Just as a healthy diet with sleep-promoting compounds leads to better sleep, better sleep leads to healthier food choices. By the same token, less sleep changes hunger hormones for worse decisions. “After sleeping poorly, you should be extra vigilant about a healthy diet to get back on track,” St-Onge says.

Jansen is a good example. With her one-year-old interrupting sleep, “I keep in mind that, because I was up all night, I’ll crave more energy-dense foods,” she says. “So I try not to give in to that.”

She also has a healthy breakfast to “get off on a good nutritional foot.” A related strategy when sleep-deprived is to begin the day with a veggie starter. When people have a salad or other vegetable before a carb-heavy breakfast, their appetites and blood sugar tend to be more stable the rest of the day. This could prevent a cycle of several nights of bad sleep and poor nutrition. “You can break the cycle,” St-Onge says.

Click here to read more about does food affect sleep.