🌙 Better sleep starts tonight.Download Free on iOS →
Habits August 12, 2026 5 min read

Best Foods for Sleep Quality: What to Eat for Better Rest

Discover the best foods for sleep quality backed by science. Learn what to eat—and avoid—to fall asleep faster and wake up more rested.

SleepBetter.ai

Sleep Science & Research

Best Foods for Sleep Quality: What to Eat for Better Rest

What you eat during the day has a direct impact on how well you sleep at night. The best foods for sleep quality work by supporting melatonin production, calming the nervous system, and stabilizing blood sugar — all of which influence how quickly you fall asleep and how deeply you stay asleep. This guide breaks down exactly which foods to prioritize, when to eat them, and what to cut back on if poor sleep is a recurring problem.

Why Food Affects Sleep in the First Place

Sleep is regulated by two key systems: your circadian rhythm and sleep pressure (adenosine buildup). Both are heavily influenced by nutrition.

Several nutrients play direct roles in sleep biology:

  • Tryptophan is an amino acid that converts to serotonin and then melatonin — the hormone that signals your brain it's time to sleep.
  • Magnesium activates GABA receptors, which quiet nervous system activity and promote relaxation.
  • Melatonin precursors found in certain foods can meaningfully raise nighttime melatonin levels.
  • Blood sugar stability matters because glucose crashes in the middle of the night can trigger cortisol release, waking you up at 2 or 3 a.m.

When your sleep diet is missing these key nutrients, your body has less raw material to build the sleep-promoting hormones it needs.

The Best Foods That Help You Sleep

1. Tart Cherry Juice

Tart cherries are one of the few natural food sources of melatonin. A 2012 study published in the European Journal of Nutrition found that adults who drank tart cherry juice twice daily slept an average of 25 minutes longer and had better sleep efficiency compared to a placebo group. Aim for 8 oz of unsweetened tart cherry juice about 1–2 hours before bed.

2. Kiwi

Two kiwi fruits eaten one hour before bed significantly improved sleep onset, duration, and efficiency in a study of adults with self-reported sleep disturbances. Researchers attribute this to kiwi's high serotonin and antioxidant content. It's one of the most underrated foods that help you sleep.

3. Fatty Fish

Salmon, mackerel, and sardines are rich in omega-3 fatty acids and vitamin D — a combination that has been linked to higher serotonin production. A study in the Journal of Clinical Sleep Medicine found that men who ate Atlantic salmon three times per week fell asleep about 10 minutes faster than those who ate chicken or pork.

4. Nuts — Especially Almonds and Walnuts

Almonds provide magnesium and melatonin. A small handful (about 1 oz) delivers roughly 77 mg of magnesium, which is meaningful given that magnesium deficiency is common and associated with insomnia. Walnuts also contain tryptophan and their own small amounts of melatonin, making them a smart pre-bed snack.

5. Oats

A small bowl of oatmeal in the evening isn't just comforting — it's strategic. Oats contain melatonin and complex carbohydrates that help shuttle tryptophan across the blood-brain barrier more efficiently. The mild insulin response from complex carbs facilitates tryptophan uptake into the brain, which accelerates melatonin synthesis.

6. Chamomile Tea

Chamomile contains apigenin, a flavonoid that binds to GABA receptors in the brain — the same receptors targeted by anti-anxiety medications, though with a far milder effect. Drinking a cup about 45 minutes before bed can reduce the time it takes to fall asleep and improve subjective sleep quality.

What to Avoid Eating Before Bed

Knowing what to eat for better sleep is only half the equation. Several common foods actively disrupt sleep:

  • Alcohol may help you fall asleep faster, but it suppresses REM sleep and causes fragmented sleep in the second half of the night. Even one drink close to bedtime measurably reduces sleep quality.
  • High-fat, fried foods take longer to digest and can cause acid reflux when you lie down, disrupting sleep continuity.
  • Sugary snacks and refined carbs spike and then crash blood sugar, which can trigger cortisol release and nighttime waking.
  • Caffeine has a half-life of 5–7 hours. A 3 p.m. coffee still has roughly half its caffeine in your system at 8 p.m. Cut off caffeine by 2 p.m. if sleep is a concern.
  • Spicy foods raise core body temperature, which works against the natural temperature drop your body needs to initiate sleep.

Meal Timing Matters as Much as Food Choice

Your sleep diet isn't just about what you eat — when you eat matters too. Large meals within 2–3 hours of bedtime increase metabolic activity, raise core body temperature, and can cause reflux, all of which make it harder to fall and stay asleep.

A practical framework:

  • Finish your last full meal 3 hours before bed. This gives your digestive system time to do most of its work before you lie down.
  • If you need a snack, keep it small and sleep-supportive. A banana with almond butter, a small bowl of oats, or a handful of walnuts are all solid options.
  • Front-load protein and complex carbs earlier in the day. This ensures tryptophan availability without overwhelming your digestion at night.

For a complete overview of sleep improvement strategies beyond nutrition, see our guide on how to sleep better.

How to Build a Sleep-Friendly Diet Over Time

Optimizing your sleep diet doesn't require an overnight overhaul. Start by making two or three targeted swaps:

  1. Replace your evening dessert with kiwi or a small bowl of tart cherry juice.
  2. Swap your afternoon coffee for herbal tea after 2 p.m.
  3. Add a magnesium-rich food (almonds, leafy greens, pumpkin seeds) to your dinner a few nights per week.

Tracking how these changes affect your actual sleep makes the patterns visible. SleepBetter.ai reads your Apple Health sleep data and correlates it with your habits over time, so you can see which dietary changes are genuinely moving the needle — not just which ones are supposed to.

Consistency compounds. A sleep-supportive diet practiced five nights out of seven will deliver measurable results within two to four weeks. Blood sugar stability, magnesium levels, and melatonin synthesis all improve gradually, not overnight.


Tonight's action: Eat two kiwi fruits or drink 8 oz of tart cherry juice about an hour before bed, and skip any caffeine after 2 p.m. today — then notice how quickly you fall asleep.

Key Questions Answered

  • Q.Why Food Affects Sleep in the First Place
  • Q.The Best Foods That Help You Sleep
  • Q.What to Avoid Eating Before Bed
  • Q.Meal Timing Matters as Much as Food Choice
  • Q.How to Build a Sleep-Friendly Diet Over Time

Your sleep coach is waiting

Personalized sleep plan, Apple Health analysis, guided breathwork — and a routine that runs itself. Free to start.

More Sleep Reads

Start tracking your sleep tonight

Start your personalized sleep plan

Answer a few questions, sync Apple Health, and SleepBetter.ai builds your roadmap to better sleep. Free to start.

Free forever. No credit card required.