Goal · Sleep

Food and sleep: what the evidence says

The biggest food levers for sleep are what you stop: caffeine in the afternoon and alcohol near bedtime. Bedtime foods and drinks have small, uncertain effects.

By the editors of Alimentotherapy Last reviewed 4 min read Not medical advice

Affiliate disclosure: this page links to Promeed and USA Magnesium. If you buy through those links we may earn a commission, at no extra cost to you, and that does not change what we recommend or the evidence grades on this page. How we make money

The short answer

The food changes with the clearest effect on sleep are subtractions: caffeine taken even six hours before bed measurably cut sleep in a controlled trial, and alcohol fragments the second half of the nightDrake 2013; Ebrahim 2013. For lasting trouble sleeping, the first-line approach recommended by the American College of Physicians and the American Academy of Sleep Medicine is cognitive behavioral therapy for insomnia (CBT-I), not a food or supplement Qaseem 2016; Edinger 2021.

Foods and herbs for sleep, graded

Every claim from our remedy pages that relates to sleep, strongest evidence first. Each row links to the full page and its sources.

Food or herbGradeWhat the research found
ChamomileSelf-rated sleep qualityLimitedA 2024 review of 10 studies (772 participants) found a reduction in Pittsburgh Sleep Quality Index scores, but the pooled studies disagreed a great deal and several other sleep measures did not change.
KiwifruitSleep qualityLimitedIn 24 adults with sleep problems who ate two kiwifruit an hour before bed for four weeks, sleep onset and total sleep improved, but the study had no control group.
Tart cherrySleep duration and quality in healthy adultsLimitedIn a 20-person placebo-controlled crossover trial, a week of tart cherry juice concentrate raised urinary melatonin and increased time in bed, total sleep time and sleep efficiency.
Tart cherryInsomnia in older adultsLimitedIn a pilot crossover trial of 15 older adults, a tart cherry juice blend reduced time awake after falling asleep compared with placebo, but not time to fall asleep or total sleep. The authors noted effects were far smaller than those of proven insomnia treatments.
ChamomileInsomniaNot supportedOnly one randomized trial has tested chamomile for insomnia, and it found no significant change in insomnia severity.

Start with caffeine and alcohol

In a placebo-controlled study, a moderate dose of caffeine taken at bedtime, three hours before or six hours before all disturbed sleep compared with placebo. The authors concluded that the trial supports avoiding substantial caffeine for at least six hours before bed Drake 2013. Coffee is the obvious source, but strong tea, cola, energy drinks, pre-workout powders and dark chocolate add up too. Green tea has less caffeine than coffee but is not caffeine-free.

Alcohol works the other way round. A review of the sleep-laboratory studies found that at every dose it shortens the time to fall asleep and deepens the first half of the night, then increases disruption in the second half, and it delays and reduces REM sleep at moderate and higher doses Ebrahim 2013. A nightcap can feel like it helps while making the night worse.

Lasting insomnia: the first-line treatment is not a food

The American College of Physicians recommends that all adults with chronic insomnia receive CBT-I as the initial treatment, rated a strong recommendation on moderate-quality evidence Qaseem 2016. The American Academy of Sleep Medicine guideline on behavioral and psychological treatments also puts multicomponent CBT-I first Edinger 2021. CBT-I is a short, structured program (in person, by phone or through a digital program) covering sleep timing, time in bed, and the thoughts and habits that keep insomnia going.

Loud snoring broken by silent pauses and gasps, or waking unrefreshed and sleepy all day, points to obstructive sleep apnea, which needs a medical assessment rather than a diet changeMedlinePlus.

MedlinePlus sleep-habit advice adds the basics: keep the bedroom quiet, dark and at a temperature you like, and if you cannot fall asleep within 30 minutes, get up and do something quiet elsewhere until you feel sleepy MedlinePlus.

Bedtime foods and drinks

The foods most often suggested for sleep are tart cherry juice, chamomile tea and warm milk. The table on this page shows how each one is graded. In short, the trials are small, short and often unblinded, and none comes close to the effect of CBT-I. A caffeine-free herbal infusion as part of a wind-down routine is a reasonable habit; just keep the cup small if night-time trips to the bathroom wake you.

How to try a change fairly

Change one thing at a time and keep a simple sleep diary (bedtime, rough time to fall asleep, wake-ups, how rested you feel) for two weeks before and two weeks after. Sleep varies a lot night to night, so a single good night proves nothing either way.

Magnesium: food first, and modest evidence

Magnesium is the supplement most often sold for sleep. The evidence is weak: a 2021 systematic review found only three small trials in 151 older adults, at moderate to high risk of bias, and judged the evidence of low to very low quality Mah 2021. Pooled, people fell asleep about 17 minutes sooner, and the change in total sleep time was not statistically significant.

Food comes first. Good sources include dark leafy greens, nuts such as almonds and cashews, beans and peas, seeds, tofu and whole grains MedlinePlus. The recommended daily amount for adults is 310 to 320 mg for women and 400 to 420 mg for men, depending on age MedlinePlus. For supplements, the NIH Office of Dietary Supplements sets an upper limit of 350 mg a day of supplemental magnesium for adults, because higher supplement doses can cause diarrhea, nausea and cramping NIH ODS. People with reduced kidney function can build up magnesium to harmful levels and should not take supplements without their clinician MedlinePlus.

If your clinician suggests trying a supplement, USA Magnesium sells a single product, magnesium glycinate. Check the dose per serving against the 350 mg limit.

When to see a clinician, not the pantry

  • Loud snoring with pauses in breathing, gasping or snorting at night, or waking unrefreshed and sleepy all day: these are signs of obstructive sleep apnea.
  • Insomnia that has become a regular problem, most nights, for weeks.
  • Low mood, anxiety or pain that is keeping you awake.
  • You are taking sleep medicines, or a medicine that may be keeping you awake, without having discussed it with your clinician.

Common questions

How long before bed should I stop drinking coffee?

At least six hours. In a controlled trial, a moderate dose of caffeine taken six hours before bedtime still disturbed sleep compared with placebo, and the authors concluded that this supports avoiding substantial caffeine for a minimum of six hours before bed.

Does magnesium help you sleep?

The evidence is weak. A 2021 review found only three small trials in older adults, with low to very low quality evidence; people fell asleep about 17 minutes sooner on average. Get magnesium from greens, nuts, beans and whole grains first, keep supplements under 350 mg a day, and avoid them with kidney disease unless your clinician advises.

What is the best treatment for long-term insomnia?

Cognitive behavioral therapy for insomnia (CBT-I). The American College of Physicians recommends it as the initial treatment for all adults with chronic insomnia, and the American Academy of Sleep Medicine also puts it first. Foods and supplements have much smaller and less certain effects.

Sources

Primary research and government sources, each checked on the date this page was reviewed.

  1. PubMedDrake C, et al. Caffeine effects on sleep taken 0, 3, or 6 hours before going to bed. J Clin Sleep Med. 2013. PMID 24235903.
  2. PubMedEbrahim IO, et al. Alcohol and sleep I: effects on normal sleep. Alcohol Clin Exp Res. 2013. PMID 23347102.
  3. GuidelineQaseem A, et al. Management of chronic insomnia disorder in adults: a clinical practice guideline from the American College of Physicians. Ann Intern Med. 2016. PMID 27136449.
  4. GuidelineEdinger JD, et al. Behavioral and psychological treatments for chronic insomnia disorder in adults: an American Academy of Sleep Medicine clinical practice guideline. J Clin Sleep Med. 2021. PMID 33164742.
  5. PubMedMah J, et al. Oral magnesium supplementation for insomnia in older adults: a systematic review and meta-analysis. BMC Complement Med Ther. 2021. PMID 33865376.
  6. MedlinePlusMedlinePlus. Changing your sleep habits.
  7. MedlinePlusMedlinePlus. Magnesium in diet.
  8. NIH ODSNIH Office of Dietary Supplements. Magnesium: Fact Sheet for Health Professionals.
  9. MedlinePlusMedlinePlus. Obstructive sleep apnea - adults.

Keep reading