The best foods for sleep, judged by the trials behind them, are tart cherry juice, kiwi, fatty fish and a carbohydrate-based dinner eaten a few hours before bed. Dairy, chamomile tea, pumpkin seeds, oats and nuts have weaker or indirect evidence. Every one of these studies is small, so treat food as a nudge. Finish dinner about three hours before bed, keep caffeine and alcohol out of the evening, and give any change two weeks.
As Lulu Guo, a board-certified sleep medicine physician who reviews for the Sleep Foundation, puts it, "It's better to focus on overall healthy dietary patterns throughout the day rather than focus on a specific food or drink to improve sleep." The foods below are extras on top of a good overall diet.
Health note: food changes don't treat insomnia or sleep apnea. If poor sleep lasts more than a few weeks, see a doctor, and check with one before taking a magnesium supplement if you're on medication.
TL;DR
- Food reaches sleep through three routes: melatonin in the food, tryptophan that your body turns into melatonin, and magnesium.
- The two tart cherry juice trials used about 8 oz twice a day. The famous "84 extra minutes" came from 8 people.
- Two kiwis an hour before bed for four weeks was followed by better sleep in 24 adults, in a study with no control group.
- Turkey alone is unlikely to make you sleepy. Protein lowers the share of tryptophan that reaches your brain, and carbohydrate raises it.
- Finish dinner about three hours before bed and have your last coffee at least 8.8 hours before.
- Alcohol gets you to sleep faster, then breaks up the second half of the night.
Why food affects sleep
The three routes: melatonin, tryptophan and magnesium
Some foods contain melatonin, the hormone that makes you sleepy as evening comes on. Others supply tryptophan, an amino acid your body turns into serotonin and then melatonin. A third group is high in magnesium, which acts on the brain's GABA and NMDA receptors. Trials of magnesium for sleep disagree with each other, so that route is the least certain.
How much melatonin is in food
Very little. Montmorency tart cherries hold about 13.5 nanograms of melatonin per gram, so a 100 g serving has roughly 0.0013 mg. In an MIT study of adults over 50, the dose that brought night-time melatonin back to normal was 0.3 mg, about 220 times more.
Food can still have an effect. Tart cherry concentrate raised the melatonin in people's urine in one trial, and the authors of the biggest cherry result think part of the effect may come through tryptophan. The mechanisms are unsettled. Judge each food by its trial.
Your whole diet counts
In a Columbia University sleep-lab study of 26 adults, more fibre went with more deep (slow-wave) sleep, more saturated fat with less, and more sugar and other non-fibre carbohydrate with more brief arousals from sleep. It's one small study of a single day's free eating, but it fits Dr Guo's point about the whole diet. For the non-food side, see our full sleep habits checklist.
Melatonin-rich foods
Tart cherries and tart cherry juice
The three best-known tart cherry trials are small, and they don't all agree.
- 20 healthy adults, 7 days (Howatson 2012). Concentrate raised urinary melatonin and increased time in bed, total sleep and sleep efficiency compared with placebo.
- 15 older adults with insomnia, 2 weeks (Pigeon 2010). Juice cut time awake after first falling asleep, but didn't change how fast people fell asleep or how long they slept. The authors called the effects "considerably less" than sleeping pills or therapy for insomnia.
- 8 adults over 50 with insomnia, 2 weeks (Losso 2018). Eleven started and three were referred on for sleep apnea. The eight who finished slept 84 minutes longer in a sleep lab on cherry juice than on placebo. The Cherry Marketing Institute supplied the juice.
That 84-minute figure is real, and it comes from eight people.
To copy the two juice trials, drink about 8 oz (240 mL) twice a day, in the morning and one to two hours before bed, for two weeks. Nobody has tested a bowl of fresh cherries.
Kiwi
In a 2011 Taiwanese study, 24 adults with sleep problems (22 of them women) ate two kiwis an hour before bed every night for four weeks. By the end they took 35% less time to fall asleep, spent 29% less time awake in the night and slept 13% longer.
There was no control group, so expectation could explain some of it. The researchers credit kiwi's serotonin and antioxidants, not melatonin. Two kiwis a night for four weeks is a cheap test.
Eggs, milk and nuts
Eggs contain about 1.54 ng of melatonin per gram, according to the Sleep Foundation. Milk taken from cows at night has about ten times the melatonin of daytime milk (39 vs 4 picograms per mL in a Brazilian study). But when Finnish researchers gave night-time milk to older care-home residents for eight weeks, their rated sleep changed only with the season.
A 2017 review found nuts have the most melatonin of any plant food, and eggs and fish lead the animal foods. A 2020 review of 14 dairy studies found mixed results that lean toward better sleep when dairy is part of a balanced diet.
Tryptophan foods
Turkey and the one-gram problem
Turkey has about a quarter of a gram of tryptophan per 100 g (Sleep Foundation). Supplement studies found tryptophan helps at 1 g or more, mostly in people with mild insomnia. Getting 1 g from turkey takes about 400 g, close to a pound.
Tryptophan also competes with other amino acids to get into the brain. In a small MIT study, the blood tryptophan ratio differed by a median 54% between a carbohydrate-rich and a protein-rich breakfast in the eight people who ate both. Earlier work found carbohydrate raises that ratio and protein lowers it. A big turkey dinner brings plenty of competitors along with its tryptophan.
Why carbohydrate at dinner may help
Twelve healthy young men ate a rice dinner four hours before bed. After high-glycaemic jasmine rice they fell asleep in 9 minutes on average, against 17.5 minutes after low-glycaemic rice. The same jasmine meal one hour before bed took 14.6 minutes. Eat your carbohydrates at dinner, and eat dinner early.
Cheese, tofu and fatty fish
Cottage cheese, low-fat ricotta and mozzarella are among the top cheeses for tryptophan, and a cup of firm tofu has about 593 mg (Sleep Foundation). That's a lot for a food and still under the 1 g supplement dose.
Fatty fish has one longer trial. In a US secure hospital, 95 men ate either Atlantic salmon or a meat meal three times a week from September to February. The meat group took longer to fall asleep by the end of winter, and the salmon group reported better daytime functioning. It's a single trial in an unusual setting.
Magnesium-rich foods
What the magnesium research shows
A 2022 review of nine studies (7,582 people) found magnesium levels linked to sleep quality in observational studies, while the trials contradicted each other. One trial in 46 older adults with insomnia found a 500 mg magnesium supplement, taken for eight weeks, improved insomnia scores and time to fall asleep. If you're weighing a supplement, read magnesium glycinate vs citrate.
Pumpkin seeds, spinach and oats
Per the Sleep Foundation:
- An ounce of pumpkin seeds (a small handful): 37% of the daily value for magnesium.
- A cup of boiled spinach: 37%.
- A cup of uncooked oats: 66%.
Oats are also a carbohydrate, which helps tryptophan reach the brain, so an evening bowl covers two routes.
Bananas and almonds
A cup of sliced banana gives up to 10% of the daily value for magnesium, which is modest. For almonds, there's a 2026 Indian trial funded by the Almond Board of California: 175 adults with poor sleep ate either 60 g of almonds a day (about 50 nuts) or a snack with the same calories for five months. The almond group rated their sleep better and reported falling asleep faster, but most sleep-lab measures didn't change, and participants knew which snack they were eating.
Chamomile tea
Most sleep-food guides recommend chamomile tea. A 2019 meta-analysis found a pooled improvement in sleep quality with chamomile, and the authors say larger trials are needed to confirm it. The one trial in people with diagnosed insomnia found no significant change in insomnia severity. A caffeine-free cup in the evening is a reasonable part of a wind-down routine.
When to eat
The three-hour rule
Finish dinner about three hours before bed, so by 7pm for a 10pm bedtime. In a survey of 793 university students, eating within three hours of bed was linked to more waking in the night, though not to taking longer to fall asleep. In a Japanese study of 147 people with acid reflux and 294 without, finishing dinner less than three hours before bed came with 7.45 times the odds of reflux compared with four hours or more. Both are observational, so neither proves cause.
A bedtime snack
If you're hungry later, keep it small. Two kiwis an hour before bed is the best-tested snack, and tart cherry juice fits one to two hours before. Pairings such as yogurt with pumpkin seeds or oatmeal with banana are reasonable but untested.
Caffeine cutoff
Caffeine's half-life averages about four hours in healthy adults, with a range of two to eight, according to the European Food Safety Authority. At four hours, a 2pm coffee still has about a quarter of its caffeine left at 10pm. A 2023 meta-analysis of 24 studies found caffeine cut total sleep by 45 minutes and put the cutoff for a cup of coffee at 8.8 hours before bed, around 1pm for a 10pm bedtime. Huberman's stricter rule is 12 hours.
The FDA also lists tea, chocolate, soft drinks, energy drinks, energy bars and some over-the-counter medicines as caffeine sources. More in how long caffeine stays in your system.
Foods and drinks to avoid before bed
Alcohol
Alcohol helps you fall asleep faster, then breaks up the second half of the night. A 2013 review of all known studies in healthy sleepers found it delays your first REM period at any dose and lowers total REM in most studies at moderate and high doses.
Heavy, spicy, fatty and sugary food
The Sleep Foundation lists spicy food as a trigger for heartburn and reflux before bed, which makes the three-hour gap matter most if you're prone to it. In the Columbia sleep-lab study, a bigger share of calories from saturated fat predicted less deep sleep, and a bigger share from sugar went with more brief arousals from sleep. If you want something sweet, have it with dinner rather than as a large snack at bedtime.
Beyond food: the bedroom and supplements
Room temperature
The Sleep Foundation puts the best bedroom temperature at about 65°F (18.3°C), with most doctors recommending 65 to 68°F. Cleveland Clinic gives 60 to 67°F. A 2012 review found that in normal bedding, heat increases waking and cuts both deep and REM sleep, and Huberman's sleep newsletter says body temperature needs to drop by 1 to 3 degrees for you to fall and stay asleep. More in the best bedroom temperature for sleep.
Melatonin supplements vs food
In his Sleep Toolkit episode, Huberman says the doses in most melatonin products are "far, far, far greater" than what the body makes. In the MIT study above, 0.3 mg brought night-time levels back to normal, while 3 mg kept melatonin raised into the next morning. A 1997 study of 21 night-shift workers found a week of melatonin left their own production unchanged. Read melatonin side effects and doses before you buy a bottle.
How long before you see results
The cherry and kiwi trials behind the best foods for sleep ran one to four weeks. Change one thing at a time, keep it up for two weeks, and track how long you take to fall asleep and how often you wake.
If you get into bed wired, food won't fix that alone. A guided session may help you downshift first, and NSDR for sleep covers how to use one at bedtime.
FAQ
What is the best snack to eat before bed for sleep?
The best-tested bedtime snack is two kiwis about an hour before sleep, from a four-week study of 24 adults. Tart cherry juice one to two hours before bed is the other option with trial data. Keep any snack small.
How long before bed should you stop eating?
Stop eating full meals about three hours before bed. Eating inside that window was linked to more night waking in a survey of 793 students and to higher odds of reflux in a Japanese study. A small snack an hour before bed is fine.
Does eating certain foods improve sleep quality?
Certain foods do seem to improve sleep quality a little. Kiwi, tart cherry juice, fatty fish and a high-glycaemic rice dinner all showed effects, but in trials of 8 to 95 people, and the kiwi study had no control group. Even the best foods for sleep are modest. The authors of one cherry trial judged its effects "considerably less" than those of sleeping pills or therapy for insomnia.
What foods are high in melatonin?
Nuts have the most melatonin among plant foods, and eggs and fish among animal foods, according to a 2017 review. Montmorency tart cherries hold about 13.5 ng per gram, and milk collected at night has about ten times more than daytime milk. All of these are tiny next to a 0.3 mg supplement.
Can changing your diet improve sleep quality?
Changing your diet can improve sleep quality modestly. More fibre and less saturated fat and sugar went with deeper, less broken sleep in a 26-person lab study, and a review of 14 dairy studies leaned toward better sleep with a balanced diet. Give any change two weeks.
Sources
- Lin HH, Tsai PS, Fang SC, Liu JF. 2011. Effect of kiwifruit consumption on sleep quality in adults with sleep problems. Asia Pacific Journal of Clinical Nutrition. https://pubmed.ncbi.nlm.nih.gov/21669584/ [no control group]
- Howatson G, Bell PG, Tallent J, et al. 2012. Effect of tart cherry juice (Prunus cerasus) on melatonin levels and enhanced sleep quality. European Journal of Nutrition. https://pubmed.ncbi.nlm.nih.gov/22038497/
- Pigeon WR, Carr M, Gorman C, Perlis ML. 2010. Effects of a tart cherry juice beverage on the sleep of older adults with insomnia: a pilot study. Journal of Medicinal Food. https://pubmed.ncbi.nlm.nih.gov/20438325/
- Losso JN, Finley JW, Karki N, et al. 2018. Pilot study of the tart cherry juice for the treatment of insomnia and investigation of mechanisms. American Journal of Therapeutics. https://pubmed.ncbi.nlm.nih.gov/28901958/ [juice supplied by the Cherry Marketing Institute]
- Burkhardt S, Tan DX, Manchester LC, Hardeland R, Reiter RJ. 2001. Detection and quantification of the antioxidant melatonin in Montmorency and Balaton tart cherries (Prunus cerasus). Journal of Agricultural and Food Chemistry. https://pubmed.ncbi.nlm.nih.gov/11600041/
- Meng X, Li Y, Li S, et al. 2017. Dietary sources and bioactivities of melatonin. Nutrients. https://pubmed.ncbi.nlm.nih.gov/28387721/
- Milagres MP, Minim VP, Minim LA, et al. 2014. Night milking adds value to cow's milk. Journal of the Science of Food and Agriculture. https://pubmed.ncbi.nlm.nih.gov/24243550/
- Valtonen M, Niskanen L, Kangas AP, Koskinen T. 2005. Effect of melatonin-rich night-time milk on sleep and activity in elderly institutionalized subjects. Nordic Journal of Psychiatry. https://pubmed.ncbi.nlm.nih.gov/16195124/
- Komada Y, Okajima I, Kuwata T. 2020. The effects of milk and dairy products on sleep: a systematic review. International Journal of Environmental Research and Public Health. https://pubmed.ncbi.nlm.nih.gov/33339284/
- Hartmann E. 1982. Effects of L-tryptophan on sleepiness and on sleep. Journal of Psychiatric Research. https://pubmed.ncbi.nlm.nih.gov/6764927/
- Wurtman RJ, Wurtman JJ, Regan MM, et al. 2003. Effects of normal meals rich in carbohydrates or proteins on plasma tryptophan and tyrosine ratios. American Journal of Clinical Nutrition. https://pubmed.ncbi.nlm.nih.gov/12499331/
- Afaghi A, O'Connor H, Chow CM. 2007. High-glycemic-index carbohydrate meals shorten sleep onset. American Journal of Clinical Nutrition. https://pubmed.ncbi.nlm.nih.gov/17284739/
- Hansen AL, Dahl L, Olson G, et al. 2014. Fish consumption, sleep, daily functioning, and heart rate variability. Journal of Clinical Sleep Medicine. https://pubmed.ncbi.nlm.nih.gov/24812543/
- St-Onge MP, Roberts A, Shechter A, Choudhury AR. 2016. Fiber and saturated fat are associated with sleep arousals and slow wave sleep. Journal of Clinical Sleep Medicine. https://pubmed.ncbi.nlm.nih.gov/26156950/
- Arab A, Rafie N, Amani R, Shirani F. 2023 (online 2022). The role of magnesium in sleep health: a systematic review of available literature. Biological Trace Element Research. https://pubmed.ncbi.nlm.nih.gov/35184264/
- Abbasi B, Kimiagar M, Sadeghniiat K, et al. 2012. The effect of magnesium supplementation on primary insomnia in elderly: a double-blind placebo-controlled clinical trial. Journal of Research in Medical Sciences. https://pubmed.ncbi.nlm.nih.gov/23853635/
- Desai SR, Pinto L, Halbe A, Vaidya RA, Udipi SA, Kalita S. 2026. Effects of almond consumption on sleep quality in adults: a randomized controlled trial. Frontiers in Nutrition. https://pubmed.ncbi.nlm.nih.gov/42577429/ [almonds supplied and trial funded by the Almond Board of California; open-label]
- Hieu TH, Dibas M, Surya Dila KA, et al. 2019. Therapeutic efficacy and safety of chamomile for state anxiety, generalized anxiety disorder, insomnia, and sleep quality: a systematic review and meta-analysis. Phytotherapy Research. https://pubmed.ncbi.nlm.nih.gov/31006899/
- Chung N, Bin YS, Cistulli PA, Chow CM. 2020. Does the proximity of meals to bedtime influence the sleep of young adults? A cross-sectional survey of university students. International Journal of Environmental Research and Public Health. https://pubmed.ncbi.nlm.nih.gov/32295235/
- Fujiwara Y, Machida A, Watanabe Y, et al. 2005. Association between dinner-to-bed time and gastro-esophageal reflux disease. American Journal of Gastroenterology. https://pubmed.ncbi.nlm.nih.gov/16393212/
- European Food Safety Authority. 2015. Caffeine: EFSA explains risk assessment. https://www.efsa.europa.eu/sites/default/files/corporate_publications/files/efsaexplainscaffeine150527.pdf
- Gardiner C, Weakley J, Burke LM, et al. 2023. The effect of caffeine on subsequent sleep: a systematic review and meta-analysis. Sleep Medicine Reviews. https://pubmed.ncbi.nlm.nih.gov/36870101/
- US Food and Drug Administration. Spilling the beans: how much caffeine is too much? https://www.fda.gov/consumers/consumer-updates/spilling-beans-how-much-caffeine-too-much
- Ebrahim IO, Shapiro CM, Williams AJ, Fenwick PB. 2013. Alcohol and sleep I: effects on normal sleep. Alcoholism: Clinical and Experimental Research. https://pubmed.ncbi.nlm.nih.gov/23347102/
- Okamoto-Mizuno K, Mizuno K. 2012. Effects of thermal environment on sleep and circadian rhythm. Journal of Physiological Anthropology. https://pubmed.ncbi.nlm.nih.gov/22738673/
- Zhdanova IV, Wurtman RJ, Regan MM, et al. 2001. Melatonin treatment for age-related insomnia. Journal of Clinical Endocrinology and Metabolism. https://pubmed.ncbi.nlm.nih.gov/11600532/
- Matsumoto M, Sack RL, Blood ML, Lewy AJ. 1997. The amplitude of endogenous melatonin production is not affected by melatonin treatment in humans. Journal of Pineal Research. https://pubmed.ncbi.nlm.nih.gov/9062869/
- Sleep Foundation (Suni E; medically reviewed by Guo L). Foods that help you sleep. Updated 5 August 2025. https://www.sleepfoundation.org/nutrition/food-and-drink-promote-good-nights-sleep
- Sleep Foundation. Best temperature for sleep. https://www.sleepfoundation.org/bedroom-environment/best-temperature-for-sleep
- Cleveland Clinic Health Essentials. What is the ideal sleeping temperature for my bedroom? https://health.clevelandclinic.org/what-is-the-ideal-sleeping-temperature-for-my-bedroom
- Huberman A. 2021. Toolkit for Sleep. Huberman Lab newsletter. https://www.hubermanlab.com/newsletter/toolkit-for-sleep
- Huberman A. 2022. Sleep Toolkit: Tools for Optimizing Sleep & Sleep-Wake Timing. Huberman Lab podcast. https://www.hubermanlab.com/episode/sleep-toolkit-tools-for-optimizing-sleep-and-sleep-wake-timing
- Huberman A. Using Caffeine to Optimize Mental & Physical Performance. Huberman Lab podcast. https://www.hubermanlab.com/episode/using-caffeine-to-optimize-mental-and-physical-performance
