How your food affects your sleep
If you've ever tossed and turned after a late, heavy dinner, you already know sleep and food are connected. The research backs that up, and the link runs both ways.
Sleep and nutrition have a two-way relationship: Poor sleep can affect appetite and food choices.
And what you eat can shape the night that follows.
Your overall pattern matters more than one food
Eating with plenty of fiber, fruits and vegetables is linked to better sleep quality [1]. Diets high in saturated fat (the fat that's solid at room temperature, like butter) and added sugar may contribute to poorer sleep [1].
A 2016 study by St-Onge and colleagues, published in the Journal of Clinical Sleep Medicine, found that low fiber and high saturated fat and sugar were linked to lighter, less restorative sleep with more brief wake-ups [2].
These studies show links, not proof that one food causes better or worse sleep. Still, they point to an easy place to start: what's on your plate most days.

Sleep-friendly nutrients in everyday food
A few nutrients come up again and again in sleep research. Tryptophan, magnesium, melatonin and complex carbohydrates may support healthy sleep [1].


Four nutrients linked to sleep
Where each one shows up in food, and why it matters for your night.
Magnesium
A mineral that supports muscle relaxation and a healthy nervous system. You'll find it in leafy greens, beans, nuts, seeds and whole grains.
Tryptophan
An amino acid, one of the building blocks of protein.
- Role
- A building block for melatonin
Melatonin
The hormone that tells your body it's night. Tart cherries have above-average amounts of it.
- Food example
- Tart cherries
Complex carbohydrates
Slower-digesting carbs found in foods like whole grains and beans. They're on the list of nutrients that may support sleep.
- Food examples
- Oats, whole grains, beans
Foods with fiber generally bring magnesium too [5]. So one swap covers two habits linked to better sleep.

Foods and drinks that help you sleep: what research found
You may have seen long lists of foods to eat before bed. Only a few foods have been studied on their own, and the studies so far are small.


| Food or drink | What a study found | How strong |
|---|---|---|
| Kiwi | Two kiwis an hour before bed: fell asleep faster, slept more, better sleep quality | One small study |
| Tart cherry juice | More total sleep time in a small pilot group with insomnia | One small pilot study |
What to eat to sleep instantly
No food works instantly, so think of food as one part of your wind-down.
A systematic review of tart cherry says the evidence is still limited, and the studies so far differ from each other [4]. If you enjoy it, it's a simple thing to try.
Worst foods for sleep, and what to choose instead
None of these are off limits. It's mostly about when you have them and how your body responds.
Caffeine in less obvious places
Caffeine isn't only in coffee. It's also in tea, soda, energy drinks and chocolate [1], so an evening square still counts toward your cutoff.
Alcohol in the evening
A drink may help you fall asleep faster, but it's linked to lower-quality sleep and more waking overnight [1]. It can also shorten REM sleep, the dreaming stage [3].
Spicy food and sleep
Spicy foods can trigger heartburn, indigestion and reflux, and they raise your body temperature [3]. If you love heat, try enjoying it at lunch.
High-fat, fried and sugary foods
Fried, high-fat and junk foods in the evening can make reflux more likely [1].
Late sweets are a bigger topic of their own, so we cover them in why sugar may be keeping you up at night.

How long before bed should you stop eating?
Not eating in the two hours before bed may help you avoid reflux at night [1]. If heartburn is something you know well, MedlinePlus suggests a bigger gap of 3 to 4 hours [6].
Here's why, step by step. It comes down to a valve at the bottom of your esophagus, the tube that carries food to your stomach [6].
What is a normal eating schedule?
There's no single right schedule. What research points to is regularity: when you eat can affect your circadian rhythm, your body's 24-hour clock [1].
A sample sleep-friendly evening
Here's one way to space out your evening, with each step timed back from your bedtime.
A sleep-friendly evening of eating
- 6 hours before bed
Last caffeine
Your caffeine cutoff from above.
- 3 hours before bed
Dinner on the table
Vegetables, beans or whole grains on your plate. If you get heartburn, eat a bit earlier.
- 2 hours before bed
Big meals are done
This gives dinner time to settle before you lie down.
- 1 hour before bed
A small snack, only if you're hungry
Something light, like a kiwi, if reflux isn't a problem for you.
- 30 minutes before bed
A warm, caffeine-free drink
A calm cue that the day is done. Skip the nightcap.
- Bedtime
Lights out
Your evening did the groundwork.
For more on that last hour, see how winding down helps you fall asleep.

Does eating less affect sleep?
It can. Not eating enough fat, carbohydrates or protein has been linked to less sleep or worse-quality sleep [1].
So if you're cutting back, notice how your nights feel.
Low-carb diet and sleep problems
We didn't find strong research on low-carb eating and sleep on its own. The links above, on eating too little and on complex carbs, are the closest guide we have.
Is fruit at night bad for sleep?
We didn't find good evidence that fruit at night harms your sleep.
If fruit late in the evening bothers you, enjoy it earlier.
What to eat before bed to lose weight
No snack is a shortcut to weight loss. If you'd like something before bed, keep it small and light.

When food isn't enough: magnesium and tryptophan
Sometimes you eat well and still lie awake. Some supplements use the same sleep-linked nutrients, so here's what the research on them shows.
Magnesium
A review of 3 studies with 151 older participants with insomnia suggested magnesium may help them fall asleep faster [7].
Those studies were small and low quality, and a larger review of 9 studies with 7,582 people had conflicting findings [7]. The research is early, and larger trials lasting more than 12 weeks are still needed [7].
L-tryptophan
As a supplement, L-tryptophan has been studied for sleep. How it works for sleep is still unclear, and the data so far is very limited [8].

Frequently asked questions
What is the 3:2:1 rule for sleeping?
You may have seen it online, but we didn't find it in the medical sources we trust. The caffeine and meal timing earlier in this article is what they do support.
Safety notes and when to see a doctor
Food changes are worth trying, but some sleep trouble has a medical cause. Here's when to bring in a professional.
References
- Nutrition and Sleep: How Diet Affects Sleep Quality. Sleep Foundation.↩
- Read the 10 most-viewed sleep research papers published in JCSM in 2016. American Academy of Sleep Medicine.↩
- Foods That Help You Sleep. Sleep Foundation.↩
- The Effect of Tart Cherry on Sleep Quality and Sleep Disorders: A Systematic Review. PMC (Food Science & Nutrition).↩
- Magnesium - Health Professional Fact Sheet. NIH Office of Dietary Supplements.↩
- Heartburn: MedlinePlus Medical Encyclopedia. MedlinePlus (NIH).↩
- In the News: Magnesium Supplements for Sleep Disorders. NCCIH (NIH).↩
- Sleep Disorders: In Depth. NCCIH (NIH).↩
These statements have not been evaluated by the Food and Drug Administration. This product is not intended to diagnose, treat, cure, or prevent any disease.






Comments
Sign in to join the conversation.
No comments yet. Be the first.