The Best Foods for Sleep
The best foods for sleep are rich in tryptophan (turkey, pumpkin seeds, eggs), magnesium (leafy greens, almonds, oats), and melatonin (tart cherries, pistachios, walnuts). Pair protein with light carbs for maximum effect, finish dinner 2–3 hours before bed, and keep any bedtime snack small and easy to digest.
Sleep starts long before you close your eyes. The foods you eat in the hours before bed directly influence your body's ability to produce melatonin, calm the nervous system, and settle into deep, restorative rest. Get the nutritional side right, and falling asleep — and staying asleep — becomes noticeably easier. Get it wrong, and even a solid bedtime routine can't fully compensate.
This guide covers the best foods for sleep, the science behind why they work, what to avoid, and how to build these foods into your evenings in a way that fits real life.
How Food Influences Sleep Quality
Your body needs specific raw materials to produce sleep-related hormones. Melatonin — the hormone that signals it's time to wind down — is synthesized from serotonin, which is itself made from the amino acid tryptophan. Without enough tryptophan from food, that entire production chain slows down.
Magnesium plays a separate but equally important role. It activates the parasympathetic nervous system — your body's "rest and digest" mode — and helps regulate GABA, a neurotransmitter that quiets nerve activity and allows the brain to settle into sleep. Research consistently shows that people with lower magnesium intake tend to experience lighter, more fragmented nights.
Meal timing matters too. Eating a heavy meal close to bedtime keeps your digestive system working hard precisely when your body is trying to power down. Certain foods — particularly those that spike blood sugar — can cause wakefulness in the small hours even when you fall asleep fine.
Tryptophan-Rich Foods: Your Body's Sleep Starter
Tryptophan is an essential amino acid you can only get from food. It's the foundational building block for both serotonin and melatonin, making it arguably the most important sleep nutrient in your diet. Top sources include:
- Turkey — the most well-known sleep food, and the reputation is earned
- Eggs — protein-dense and versatile, useful at dinner or as a light evening snack
- Dairy products — milk, yogurt, and cheese provide tryptophan alongside calcium, which also supports melatonin synthesis
- Pumpkin seeds and sunflower seeds — among the richest plant-based tryptophan sources available
- Tofu and edamame — excellent options for plant-based eaters; soy is a standout tryptophan source
- Walnuts — uniquely, they contain both tryptophan and melatonin directly
One detail worth knowing: tryptophan is more effective when paired with carbohydrates. Carbs trigger an insulin response that clears competing amino acids from the bloodstream, giving tryptophan a clearer path to the brain. This is the real mechanism behind why a small carb-and-protein bedtime snack often works better than protein alone.
Magnesium-Rich Foods That Help You Relax
Magnesium supports sleep through multiple pathways: it activates GABA receptors, assists melatonin regulation, and helps calm an overactive nervous system. Studies have linked higher magnesium intake with better sleep quality and fewer middle-of-the-night wakings.
The best food sources of magnesium include:
- Leafy greens: spinach, Swiss chard, kale — a cup of cooked spinach is a substantial source
- Nuts and seeds: almonds, cashews, pumpkin seeds, chia seeds
- Legumes: black beans, chickpeas, lentils
- Whole grains: oatmeal, brown rice, quinoa
- Dark chocolate (70%+) — a small square provides magnesium, though its caffeine content means keeping this to earlier in the evening
- Avocado — also provides vitamin B6, which supports serotonin production, and healthy fats that support hormone balance
Most adults fall short of recommended magnesium intake. Prioritizing these foods at dinner is one of the simplest, lowest-effort adjustments you can make for sleep.
Melatonin in Food: What the Research Actually Shows
Your pineal gland produces melatonin in response to darkness, but certain foods contain melatonin naturally — or support your body's own production of it.
Tart cherries are the standout. Multiple studies have found that tart cherry juice measurably increases circulating melatonin levels and can modestly improve sleep duration and quality in healthy adults. The effect is consistent enough that tart cherry juice is now one of the most evidence-supported functional foods for sleep. About 8 oz in the evening is the amount most commonly used in research.
Other foods with meaningful melatonin content or precursor support:
- Pistachios — among the highest melatonin content of any nut; a small handful before bed is a legitimate sleep snack
- Walnuts — melatonin plus tryptophan plus omega-3s in one food
- Grapes (especially red and purple varieties)
- Tomatoes
- Oats — a mild melatonin source and a solid complex carbohydrate for evening eating
Fatty fish — salmon, sardines, mackerel — deserve special mention. Rich in omega-3 fatty acids, they support melatonin production and help regulate the sleep-wake cycle. Research published in the Journal of Sleep Research found associations between higher omega-3 intake and improved sleep quality, with evidence continuing to build across age groups.
Kiwi is another food worth singling out. A small clinical trial found that eating two kiwis an hour before bed for four weeks was associated with falling asleep faster and sleeping longer. The mechanism isn't fully established, but kiwi's antioxidant content and serotonin-related compounds are likely contributors.
The Best Bedtime Snack Combinations
If you're genuinely hungry before bed, eating something small is usually better than lying awake. The key is keeping the snack under 200 calories, easy to digest, and ideally combining a tryptophan source with a light carbohydrate. Some combinations that work well:
- Warm milk with a drizzle of honey — tryptophan and calcium from the milk, a small carb hit from the honey to help tryptophan cross the blood-brain barrier
- Oatmeal with banana slices — whole-grain carbs, plus banana's B6 and potassium support serotonin production
- Greek yogurt with a few tart cherries — slow-digesting protein plus melatonin-containing fruit, relatively low in sugar
- Almond butter on a small slice of whole grain toast — healthy fats, magnesium, and the carb-protein balance that supports tryptophan uptake
- A small handful of pistachios with grapes — melatonin from both; no preparation required
- Cottage cheese with kiwi — casein protein (slow-digesting, sustaining through the night) plus kiwi's sleep-supporting compounds
Keep portions modest. The goal isn't a second dinner — it's providing the raw materials for melatonin production while keeping digestion light enough for genuine rest.
Drinks That Support Better Sleep
What you drink in the evening matters as much as what you eat. A few options have real merit:
- Tart cherry juice: The most researched sleep-supporting drink. About 8 oz in the evening is reasonable and consistent with study amounts
- Chamomile tea: Contains apigenin, a flavonoid that binds to GABA receptors in the brain and produces a mild calming effect. Not sedating, but genuinely soothing
- Warm milk: Tryptophan, calcium, and the warmth itself all contribute to the wind-down signal
- Passionflower tea: Like chamomile, it has mild interactions with GABA pathways and is traditionally used as a calming herb before bed
- Ashwagandha tea or golden milk: Adaptogenic herbs have emerging research behind them for supporting the body's stress response, which directly affects sleep quality
What to avoid in the evening: caffeinated beverages within 6–8 hours of bedtime, alcohol (more below), and high-sugar drinks that spike blood sugar right before you're trying to sleep.
Foods and Drinks to Limit Before Bed
Knowing what not to eat is as important as knowing what to reach for. These are the main dietary culprits behind disrupted sleep:
Caffeine has a half-life of roughly 5–6 hours. Half the caffeine from a 3pm coffee is still active in your system at 9pm. For caffeine-sensitive people, cutting off by 1–2pm is a sensible practice. Don't forget non-obvious sources: some dark chocolates, black and green teas, and certain sparkling waters all contain caffeine.
Alcohol is widely misunderstood as a sleep aid. It does help you fall asleep faster — but it fragments the second half of sleep, suppressing REM sleep and increasing nighttime waking. You can fall asleep easily after a drink and still wake feeling genuinely unrested. This effect scales with the amount consumed.
Heavy, fatty, or spicy meals close to bedtime keep the digestive system working hard and raise core body temperature. Your body needs to drop its core temperature slightly to initiate sleep; a large late meal actively interferes with that process.
High-sugar foods and refined carbohydrates in the evening can cause blood sugar spikes and subsequent crashes that pull you awake in the early morning hours — often that frustrating 2–4am window.
Meal Timing: When You Eat Matters Too
Your digestive system follows its own internal clock, and eating in sync with it supports better rest.
Finish dinner at least 2–3 hours before bed. This gives your body adequate time to digest before you lie down. Eating right before sleep is associated with acid reflux, heavier, more uncomfortable nights, and less restful sleep overall.
If a late dinner is unavoidable, keep it lighter. A large, rich meal at 10pm is harder on sleep than a smaller portion of simply prepared fish and vegetables at the same time. Portion size matters as much as timing.
Front-loading calories through the day tends to support better sleep. Research in chronobiology consistently suggests that eating more earlier — with a lighter evening meal — aligns better with the body's internal clock. A consistent dinner schedule (eating around the same time each night) also helps anchor your circadian rhythm, making it easier to feel genuinely sleepy at a predictable hour.
Building a Sleep-Supportive Dinner Plate
You don't need a complicated sleep diet. You need a dinner pattern that reliably covers the nutritional bases for melatonin production and nervous system calm. A simple template that works:
- A quality protein with tryptophan: salmon, turkey, chicken, tofu, eggs, or legumes
- Magnesium-rich vegetables: a generous portion of leafy greens, broccoli, or roasted sweet potato
- A moderate serving of whole-grain carbs: brown rice, quinoa, whole grain bread, or sweet potato (which doubles as a magnesium source)
- Healthy fats: olive oil, avocado, or the fat from fatty fish — omega-3s specifically support melatonin regulation
A practical example: baked salmon with roasted spinach, quinoa, and half an avocado. That single plate covers tryptophan, omega-3s, magnesium, B6, and complex carbs — essentially every core sleep nutrient, and it takes about 25 minutes to prepare.
Avoid heavy cream sauces, deep-fried preparations, and very spicy seasonings in the hours before bed. The proteins and vegetables can be as flavorful as you want — it's the heavy-fat, rich cooking that tends to sit uncomfortably at night.
Top Sleep Foods: Quick Reference
The foods most consistently supported by research for improving sleep quality, and the primary reason each earns its place:
| Food | Key Sleep Benefit | Best Use |
|---|---|---|
| Tart cherries / juice | Direct melatonin content | 8 oz juice in the evening |
| Pistachios | High melatonin + magnesium | Small handful as bedtime snack |
| Fatty fish (salmon, sardines) | Omega-3s, tryptophan | Dinner, 2–3x per week |
| Pumpkin seeds | Tryptophan + magnesium | Snack or salad topping |
| Kiwi | Serotonin precursors, antioxidants | 1–2 kiwis before bed |
| Walnuts | Melatonin + tryptophan + omega-3s | Snack, added to oatmeal |
| Oats | Complex carbs + melatonin | Evening meal or bedtime snack |
| Spinach / leafy greens | Magnesium | Side dish at dinner |
| Banana | B6, potassium, carbs | Bedtime snack with nut butter |
| Chamomile tea | Apigenin (mild GABA interaction) | 30–60 minutes before bed |
Frequently Asked Questions
What is the single best food to eat before bed for sleep?
If you had to pick one option, a small bowl of oatmeal with banana and walnuts covers an impressive range of sleep-supporting bases: melatonin from the oats and walnuts, B6 and potassium from the banana, tryptophan, and the complex carbs that help tryptophan reach the brain. Tart cherry juice is another strong single-food choice with consistent research behind it.
Does warm milk actually help you sleep?
Yes — though the effect is mild and partly driven by the ritual itself. Milk contains tryptophan and calcium (which supports melatonin synthesis), and the warmth of a hot drink helps signal wind-down time. It's not a sedative, but as part of a consistent evening routine it genuinely contributes. The act of making it slowly and drinking it quietly has its own calming value.
How long before bed should I stop eating?
A good guideline: finish your last substantial meal 2–3 hours before you plan to sleep. A small, easy-to-digest snack under 200 calories can be eaten within 30–60 minutes of bed without issue for most people. The concern is with large, heavy meals — not a handful of pistachios or a cup of yogurt.
Does tart cherry juice really improve sleep?
It has more research behind it than most functional foods marketed for sleep. Multiple studies have found that tart cherry juice increases melatonin levels in the body and is associated with modest improvements in sleep duration and quality. It's not a substitute for good sleep habits overall, but it's a sensible and evidence-backed addition to an evening routine.
What foods should I definitely avoid before bed?
The main ones: caffeine within 6–8 hours of bedtime, alcohol (disrupts REM sleep even when it helps you fall asleep initially), heavy fatty or fried foods that burden digestion and raise body temperature, and high-sugar or refined-carb foods that cause blood sugar fluctuations and early-morning wakefulness.
Is it okay to eat a banana before bed?
Yes — it's actually a solid choice. Bananas provide potassium and vitamin B6, both of which support serotonin production. They also offer a gentle carbohydrate hit that helps shuttle tryptophan to the brain. Pair a small banana with almond butter or a few walnuts for a more sustaining pre-bed snack.
Can what I eat help me stay asleep, not just fall asleep?
Yes. Middle-of-the-night waking is often connected to blood sugar fluctuations — a high-sugar evening meal or snack causes a spike, then a dip that can rouse you around 2–4am. Choosing complex carbs over refined ones and including moderate protein or fat in evening meals helps maintain more stable blood sugar through the night. Adequate magnesium intake is also consistently linked to fewer nighttime wakings.
Does alcohol help or hurt sleep?
Alcohol helps you fall asleep faster but significantly reduces sleep quality. It suppresses REM sleep, increases waking in the second half of the night, and can worsen breathing during sleep. You may fall asleep quickly and still wake feeling genuinely unrested. From a pure sleep-quality standpoint, alcohol works against you — even at moderate amounts.
What should I drink before bed to sleep better?
Chamomile tea, tart cherry juice (a small glass), warm milk, or passionflower tea are the options with the most evidence or traditional support. It's also worth staying well-hydrated throughout the day so you're not drinking large amounts right before bed — which leads to nighttime bathroom trips that fragment sleep just as effectively as the wrong foods do.
Do magnesium supplements work as well as food sources for sleep?
Both can be helpful. Food sources are generally preferable because they come alongside other beneficial nutrients — B vitamins, fiber, protein — in a form the body absorbs well. That said, if your diet is consistently low in magnesium-rich foods, a supplement is a reasonable consideration. Magnesium glycinate is a commonly used form for sleep support. Talk with a healthcare provider before adding new supplements to your routine.
Are there specific foods that help children sleep better?
The same core foods apply: tryptophan-rich proteins, whole grain carbs, magnesium-rich vegetables, and warm milk work across age groups. Research on omega-3s and sleep in children is actually more developed than the adult literature — studies including the DOLAB research from Oxford found associations between higher omega-3 intake and better sleep in school-age children. Fatty fish, walnuts, and chia seeds are practical sources for kids.
What is the best dinner to eat before an important day when you really need good sleep?
Keep it familiar and unfussy. A moderate portion of lean protein (chicken, turkey, or fish), roasted vegetables, and a serving of complex carbs (sweet potato, rice, or quinoa) is an ideal pre-important-event dinner. Avoid anything too rich, spicy, or out of the ordinary that might cause digestive discomfort. Eat it 2–3 hours before bed, and resist the urge to eat a large portion — moderate is better than full.
Sources & Further Reading
- Lin HH, Tsai PS, Fang SC, Liu JF. "Effect of kiwifruit consumption on sleep quality in adults with sleep problems." Asia Pacific Journal of Clinical Nutrition, 2011.
- Losso JN, et al. "Pilot Study of the Tart Cherry Juice for the Treatment of Insomnia and Investigation of Mechanisms." American Journal of Therapeutics, 2018.
- Montgomery P, et al. "Fatty acids and sleep in UK children: subjective and pilot objective sleep results from the DOLAB study." Journal of Sleep Research, 2014.
- National Sleep Foundation. "Diet and Sleep." sleepfoundation.org.
- Harvard T.H. Chan School of Public Health, The Nutrition Source. "Magnesium." hsph.harvard.edu.
Reviewed by The Positivity.org Editorial Team · Last updated April 15, 2026
Stay Inspired
Get a daily dose of positivity delivered to your inbox.

