Diet and Sleep: How to Eat for Better Rest

What to eat, and when to stop caffeine and alcohol, for better sleep, plus the foods with research behind them.

  • Free Shipping on Every Meal PlanFree Shipping
  • Up to 20% Off 30-Meal PlansUp to 20% Off
  • Chef Cooked, Dietitian BuiltDietitian Built
  • Heat & Eat in MinutesHeat & Eat
Romaine Rusnak, RD, LDN
Romaine Rusnak, RD, LDNRegistered Dietitian · Dec 31, 2025
Diet and Sleep: How to Eat for Better Rest
Listen to this article14 min

The verdict: Eat a balanced dinner 2 to 3 hours before bed, stop caffeine about 6 hours before, and skip the nightcap. In one study, 400 mg of caffeine taken 6 hours before bed still cut sleep by 41 minutes. Tryptophan, magnesium, fatty fish, kiwi and tart cherries have small studies behind them. A Mediterranean-style pattern is linked to better sleep overall.

Sleep is one of the most important parts of your day. A good night is when your body and your brain restore themselves, and a short one shows up in your mood, your appetite and your workouts the next day.

The connection between diet and sleep runs both ways. What you eat affects how you sleep, and how you sleep affects what you eat. Getting quality rest can be hard, and what is on your plate in the evening may be part of the problem.

This guide covers how food acts on sleep, seven steps for an evening that works with it, the foods with real studies behind them and the ones worth cutting off. For the bigger picture on why sleep matters for your health, fitness and weight, see our complete guide on the importance of sleep for overall health and well-being.

Food supplies the raw materials

The foods you eat influence the hormones and brain chemicals that run your sleep-wake cycle. Food is more than fuel here. Some nutrients are the building blocks for the very chemicals that tell your body it's night.

Tryptophan, an amino acid found in many protein-rich foods, is the best known. Your body turns tryptophan into serotonin, and serotonin into melatonin, the hormone that signals your brain it's time to sleep. A 2018 review by USDA researcher Mendel Friedman lists sleep among the areas where tryptophan and its products may help, which is why tryptophan foods show up in so many evening routines.

Minerals matter too. Magnesium, calcium and potassium all play roles in muscle relaxation and nervous system function. The best-known trial is small: 46 older adults with insomnia took 500 mg of magnesium or a placebo every day for 8 weeks. The magnesium group fell asleep faster and scored better on sleep efficiency and insomnia severity. That was a supplement in people who already slept badly, so treat it as a reason to eat magnesium-rich food, not as proof that more is better.

Beyond single nutrients, your overall pattern counts. In a review of diet and sleep research by Marie-Pierre St-Onge and colleagues at Columbia, a small sleep-lab study found that days with more fiber went with more deep, slow-wave sleep, while more saturated fat went with less of it and more sugar went with more wake-ups during the night. The Mediterranean diet, in particular, has been linked to better sleep in several studies.

Food doesn't knock you out. It sets the conditions for the night.

Seven steps, from dinner to lights out

Changing your diet to sleep better doesn't have to be complicated. Most of it is timing, and most of the timing happens after lunch. The steps run in the order your day does.

Before bed Cutoff Why
Caffeine 6 hours 400 mg taken 6 hours out still cut sleep by 41 minutes
Large or rich meal 2 to 3 hr Digestion and heartburn when you lie down
Alcohol Skip it Disrupts the second half of the night and cuts REM sleep
Small snack 1 hour Fine if you are hungry, keep it light

The cutoffs that matter most before bed

Set a caffeine cutoff

Stop about 6 hours before bed

Caffeine blocks adenosine, a chemical that builds up through the day and makes you feel sleepy. It also lingers. In a study by Christopher Drake and colleagues, adults took 400 mg of caffeine at bedtime, 3 hours before or 6 hours before. Even at 6 hours, measured sleep dropped by 41 minutes, and the authors concluded you should avoid substantial caffeine for at least 6 hours before bed.

400 mg is a big dose, about two to three 12-ounce cups of coffee by the FDA's estimate, and it is the most the FDA cites for a whole day. A smaller afternoon cup does less, but people vary a lot in how fast they clear caffeine. If you go to bed at 10, that is a 4 p.m. cutoff at the latest, and earlier if you are sensitive.

Remember the quiet sources: tea, chocolate, energy drinks and some sodas.

Build a balanced dinner

Protein, complex carbs & vegetables

Start with dinner. Make the evening meal balanced: a lean protein, a complex carbohydrate and plenty of vegetables. Grilled salmon with quinoa and roasted vegetables, for example, brings tryptophan, magnesium, omega-3s and fiber in one plate.

The carbohydrate earns its place. In a study of 9 adults at MIT, a carb-rich breakfast raised the blood ratio that controls how much tryptophan reaches the brain by a median of 54% compared with a protein-rich one. It was a small study of breakfast, not bedtime, but it is why dietitians pair tryptophan foods with a complex carb rather than eating them alone.

Finish large meals 2 to 3 hours before bed

Give digestion a head start

Eating a large meal close to bedtime keeps your digestive system working when it should be winding down. Give yourself at least 2 to 3 hours between your last substantial meal and sleep.

That gap helps prevent discomfort and heartburn, which get worse when you lie flat. Rich, fatty food takes longer to digest, and spicy food is a common heartburn trigger, so those are the dinners to eat earlier.

Swap the nightcap for chamomile or tart cherry juice

Change the evening drink

Replace the after-dinner coffee or the glass of wine with chamomile tea or tart cherry juice. This simple switch removes a sleep disruptor and adds a drink with at least some evidence behind it.

Alcohol makes you drowsy, which is why it feels like a sleep aid. The section on foods to avoid below explains why it is the opposite by morning.

Keep a consistent meal schedule

Regular meals, regular nights

When you eat matters almost as much as what you eat. Your meal schedule feeds into your circadian rhythm, the internal clock that runs sleep and wakefulness.

Eating at regular times each day helps reinforce that clock. Irregular eating, especially late-night eating, can shift it and make it harder to fall asleep at the bedtime you want.

Plan a small bedtime snack if you are hungry

Light carbs plus a little protein

Going to bed hungry is its own sleep problem. If you are truly hungry, a light snack that combines a complex carb with a small amount of protein can help.

  • A banana with a tablespoon of almond butter.
  • A small bowl of whole-grain cereal with milk.
  • A few whole-grain crackers with cheese.
  • Two kiwis, the snack from the sleep study below.

Keep it to a snack. A second dinner at 10 p.m. puts you right back in step three.

Prep sleep-friendly snacks & meals ahead

Make the easy choice the right one

Keep healthy options on hand for when late-night hunger strikes. Pre-portioned almonds, individual yogurt cups or ready-to-eat kiwis make it easy to choose a sleep-friendly option over packaged snacks.

The same goes for dinner. When a balanced meal is ready to go, you are less likely to order takeout at 9 p.m. or graze on whatever is in the pantry, which is how a late, heavy, sugary evening usually starts.

What the studies support, & how strongly

If you want to improve your sleep through diet, these are the foods and nutrients with evidence behind them. The studies are mostly small, so the table below says how small.

Food People What the study found
Tart cherry juice 8 84 more minutes of sleep over 2 weeks, 8 oz twice a day, adults over 50 with insomnia
Kiwi 24 Fell asleep 35% faster and slept 13% longer after 4 weeks of 2 kiwis an hour before bed, no control group
Fatty fish 95 Salmon 3 times a week over winter, better daily functioning than a meat control group
Magnesium 46 500 mg supplement for 8 weeks, better sleep onset and efficiency in older adults with insomnia
Chamomile 12 trials Better sleep quality in a meta-analysis, no effect on insomnia in the one trial that tested it

Sleep foods & the size of the evidence

Tryptophan-rich foods

Since tryptophan is a precursor to sleep-regulating hormones, foods containing it can support better rest. Good sources include turkey, chicken, eggs, dairy (milk, cheese, yogurt), nuts and seeds, and fish.

Pair them with complex carbohydrates. As the MIT study above showed, carbs help more tryptophan reach your brain, which is why a small snack with some carbs before bed can work better than protein alone.

Magnesium-rich foods

Magnesium helps activate the parasympathetic nervous system, the system responsible for helping you calm down and relax. Foods high in it include almonds and other nuts, spinach and leafy greens, bananas, avocados, legumes and whole grains. Adding more of these magnesium-rich foods to your diet may help your sleep over time.

Food is the place to start. Talk with your doctor before you add a magnesium supplement, especially if you have kidney disease or take other medicines.

Natural melatonin sources

Some foods contain melatonin naturally, and tart cherries and tart cherry juice are among the best dietary sources. In a pilot study at Louisiana State University, adults over 50 with insomnia drank 8 ounces of Montmorency tart cherry juice twice a day for two weeks. Measured in a sleep lab, they slept 84 minutes longer than on placebo. Only 8 people finished the study, so it is a promising signal, not a settled answer.

Kiwifruit is another standout. In a Taiwanese study, 24 adults with sleep problems ate two kiwis an hour before bed for four weeks. They fell asleep 35% faster, slept 13% longer and slept more efficiently. There was no control group, so some of that may be the routine itself.

Fatty fish

Salmon, mackerel, sardines and other fatty fish provide omega-3 fatty acids and vitamin D, both linked to better sleep regulation.

In a six-month trial, 95 men were served Atlantic salmon three times a week from September to February, while a control group got chicken, pork or beef. The control group took longer to fall asleep by the end of the winter, and the fish group reported better daily functioning. The authors tied the effect to vitamin D status and heart rate variability. The FDA's fish advice is at least 8 ounces of seafood a week for adults, about two servings.

Complex carbohydrates

Whole grains, oatmeal, sweet potatoes and other complex carbohydrates can help when they are part of your evening meal. They make more tryptophan available to the brain and provide steady energy without the sharp blood sugar swings of refined sugar.

A small portion of whole-grain toast or a bowl of oatmeal can make a good pre-bed snack.

Herbal teas

Chamomile tea has been used for centuries as a sleep aid. It contains apigenin, a plant compound that binds to benzodiazepine receptors in the brain, the same receptors some sleep medicines act on.

The human evidence is modest. A 2019 meta-analysis of 12 trials found chamomile improved sleep quality, but the one trial that looked at insomnia found no change. Valerian root and passionflower teas are other calming options people use. As a caffeine-free evening ritual, any of them beats coffee.

Four things that cost you sleep

Just as some foods promote sleep, others actively disrupt it. Being mindful of these, especially in the hours before bed, can make a real difference.

Caffeine

Caffeine's effects can last 6 hours or more, so the afternoon coffee may still be working at bedtime. Sources include coffee, tea, chocolate, energy drinks and some sodas. If you are sensitive to caffeine, cut it off by early afternoon.

Alcohol

Alcohol helps you fall asleep, and that is the trap. A review of every known study in healthy volunteers found that at all doses, alcohol shortens the time it takes to fall asleep, then disrupts sleep in the second half of the night. At moderate and high doses it reduces REM sleep, the dreaming stage, over the whole night.

It also affects breathing. A meta-analysis of 21 studies found that higher alcohol intake raised the risk of sleep apnea by 25%. Even moderate drinking in the evening can fragment your sleep.

Heavy, fatty or spicy meals

A large meal close to bedtime keeps your digestion busy when it should be slowing down. Fatty foods take longer to digest and can cause discomfort. Spicy foods may trigger heartburn or indigestion, especially when you lie down. Aim to finish large meals at least 2 to 3 hours before bed.

High-sugar foods

Sugary snacks, desserts and refined carbohydrates can spike your blood sugar. In the sleep-lab study in the St-Onge review, more sugar went with more wake-ups during the night. If you want something sweet before bed, have a small portion of fruit instead.

The pattern beats any single food

One of the most consistent findings in diet and sleep research is the benefit of Mediterranean-style eating. It emphasizes fruits, vegetables, whole grains, legumes, nuts, olive oil and fish, and limits red meat, highly processed foods and added sugars.

In a 2020 study of 172 middle-aged Italian adults, good sleepers stuck closer to the Mediterranean diet than poor sleepers, and they had a lower BMI and waist size. The authors found the pattern as a whole predicted sleep quality better than any single food. It was a snapshot, not a trial, so it shows a link rather than cause. The St-Onge review adds that the diet was tied to fewer insomnia symptoms in older women, though not in men.

The benefits likely come from the combination of fiber, antioxidants, healthy fats and anti-inflammatory compounds. That is also why no single sleep food above should carry the whole plan.

You don't need to overhaul your diet overnight. Add more vegetables to your meals, choose whole grains over refined, have fatty fish a few times a week and cook with olive oil. For more on eating patterns that support your health goals, see our guide to the best foods for weight loss.

What quietly undoes a good evening

  • Treating alcohol as a sleep aid. It shortens the time to fall asleep and costs you the second half of the night.
  • Counting only coffee. Tea, dark chocolate, energy drinks and some sodas carry caffeine too.
  • Eating dinner late, then going straight to bed. Move the big meal earlier and keep a light snack for later if you need one.
  • Dieting so hard you go to bed hungry. A very low-calorie day can leave you awake and hungry at midnight. A small, balanced snack is part of the plan, not a failure of it.
  • Expecting one food to fix it. Tart cherries and kiwis have small studies behind them. A regular schedule, an earlier dinner and a caffeine cutoff do more.

If you snore loudly, stop breathing in your sleep, or still can't sleep after a few weeks of better habits, talk with your doctor. Insomnia and sleep apnea are medical problems, and diet alone won't treat them.

Where our meals fit

Most of the steps above are easy to know and hard to do on a Tuesday. The friction is usually dinner: it gets late, nothing is ready, and the evening ends with takeout or the pantry.

That is a workload problem, and workload problems have different solutions than knowledge problems. Our Clean Eatz Kitchen meal plans are chef-cooked, portion-controlled and flash-frozen, so a balanced dinner with protein, a starch and vegetables heats in a few minutes and can be on the table early enough to leave that 2 to 3 hour gap. Every meal's calories, protein, carbs, fat and fiber are listed on our Nutrition Info page.

If you want to pick dinners one at a time, salmon nights included, Build A Meal Plan lets you choose meal by meal. There is no subscription, meals keep up to 12 months in the freezer, and meal plan orders ship free to the contiguous 48 states. We won't promise a meal will fix your sleep. It can make the earlier, balanced dinner the easy option.

Quick answers

What foods help you sleep better?

Foods with tryptophan (turkey, eggs, dairy, nuts), magnesium (almonds, spinach, bananas) and natural melatonin (tart cherries, kiwi). Complex carbs like whole grains and oatmeal help more tryptophan reach the brain. Fatty fish such as salmon brings vitamin D and omega-3s. The studies behind each food are small, so think of them as helpers next to good timing, not cures.

What foods should you avoid before bed?

Avoid caffeine (coffee, tea, chocolate, energy drinks) for at least 6 hours before bed. Skip alcohol, which disrupts the second half of the night even though it makes you drowsy. Heavy, fatty or spicy meals close to bedtime can cause heartburn and discomfort, and high-sugar foods are linked to more wake-ups during the night.

Can dieting cause sleep problems?

It can. Going to bed hungry makes it harder to fall asleep, and very low-calorie days make that more likely. Research on low-carb diets and sleep is mixed, with studies showing changes in deep and REM sleep in both directions. The safer approach is balanced eating: enough calories, protein and carbohydrates, plus a small snack if hunger hits late.

How long before bed should you stop eating?

Aim to finish large meals 2 to 3 hours before bedtime so digestion is mostly done. A small snack within an hour of bed, like a banana with almond butter or two kiwis, is fine and may help some people sleep. The key is avoiding heavy, spicy or high-fat food close to bedtime.

Does the Mediterranean diet help with sleep?

It is linked to better sleep. In a 2020 study of 172 Italian adults, good sleepers followed the Mediterranean diet more closely than poor sleepers, and a review tied it to fewer insomnia symptoms in older women. Those were observational studies, so they show a link rather than proof, but the pattern is healthy for other reasons too.

Does a heavy dinner affect sleep?

It can. A large, rich or spicy meal right before bed keeps digestion busy and raises the chance of heartburn when you lie down. Eat the bigger meal earlier in the evening, at least 2 to 3 hours before sleep, and save a light snack for later if you need one.

Small changes, better nights

Diet and sleep are closely linked. What you eat supplies the raw materials for sleep-regulating hormones, shapes your circadian rhythm and affects how well your body rests overnight. Eat sleep-friendly foods like fatty fish, leafy greens, tart cherries and whole grains, and avoid caffeine, alcohol and heavy late-night meals, and you set yourself up for better rest.

Small changes add up over time. Pair them with other good sleep habits, a consistent sleep schedule and a dark, quiet bedroom. For more evidence-based ways to improve your sleep and overall health, see our guide to sleep and health.

Keep reading

Sources

  1. Friedman M. Analysis, nutrition, and health benefits of tryptophan. Int J Tryptophan Res 2018 (PubMed)
  2. Abbasi B et al. The effect of magnesium supplementation on primary insomnia in elderly. J Res Med Sci 2012 (PMC)
  3. St-Onge MP, Mikic A, Pietrolungo CE. Effects of diet on sleep quality. Adv Nutr 2016 (PMC)
  4. Wurtman RJ et al. Effects of normal meals rich in carbohydrates or proteins on plasma tryptophan and tyrosine ratios. Am J Clin Nutr 2003 (PubMed)
  5. Losso JN et al. Pilot study of the tart cherry juice for the treatment of insomnia. Am J Ther 2018 (PubMed)
  6. Lin HH et al. Effect of kiwifruit consumption on sleep quality in adults with sleep problems. Asia Pac J Clin Nutr 2011 (PubMed)
  7. Hansen AL et al. Fish consumption, sleep, daily functioning, and heart rate variability. J Clin Sleep Med 2014 (PubMed)
  8. Muscogiuri G et al. Sleep quality in obesity: does adherence to the Mediterranean diet matter? Nutrients 2020 (PubMed)
  9. Drake C et al. Caffeine effects on sleep taken 0, 3, or 6 hours before going to bed. J Clin Sleep Med 2013 (PMC)
  10. U.S. FDA: Spilling the beans, how much caffeine is too much?
  11. Ebrahim IO et al. Alcohol and sleep I: effects on normal sleep. Alcohol Clin Exp Res 2013 (PubMed)
  12. Simou E et al. Alcohol and the risk of sleep apnoea: a systematic review and meta-analysis. Sleep Med 2018 (PubMed)
  13. Hieu TH et al. Chamomile for anxiety, insomnia and sleep quality: a systematic review and meta-analysis. Phytother Res 2019 (PubMed)
  14. Srivastava JK et al. Chamomile: a herbal medicine of the past with bright future. Mol Med Rep 2010 (PMC)
  15. U.S. FDA: Advice about eating fish
  16. Healthline: How tryptophan boosts your sleep quality and mood
  17. healthdirect Australia: Foods high in magnesium

Tap a meal count to add

30 meals work out to $7.56 a meal

View plan details

Tap a meal count to add

30 meals work out to $9.16 a meal

View plan details