Diet and sleep: what to eat, what to avoid, and when

Medically-informed guide ยท Reviewed and updated โ€” October 2026

What and when you eat has a measurable, if often underestimated, effect on how well you sleep. The relationship runs through blood sugar regulation, digestion, and several nutrients directly involved in producing sleep-related hormones.

Foods and nutrients that support sleep

  • Tryptophan-containing foods (turkey, eggs, dairy, nuts, seeds): a precursor to serotonin and melatonin production.
  • Magnesium-rich foods (leafy greens, almonds, pumpkin seeds): magnesium supports muscle relaxation and nervous system regulation.
  • Complex carbohydrates (whole grains, oats) in modest evening portions: can support tryptophan uptake into the brain more effectively than protein alone.
  • Tart cherry juice and kiwi: both studied specifically for sleep, showing modest improvements in sleep duration and quality in some trials.

What to limit or avoid before bed

  • Caffeine after early-to-mid afternoon โ€” its roughly 5-6 hour half-life means a 3pm coffee is still partly active at bedtime for most people.
  • Alcohol close to bedtime โ€” it may speed sleep onset but fragments the second half of the night and suppresses REM sleep.
  • Large, heavy, or spicy meals within 2-3 hours of bed โ€” active digestion and potential reflux both interfere with comfortable sleep onset.
  • High-sugar snacks late at night โ€” the resulting blood sugar swing can trigger a cortisol release in the middle of the night, which disrupts sleep continuity.

Does meal timing matter as much as content?

Yes โ€” eating your last substantial meal roughly 2-3 hours before bed gives your digestive system time to settle, reducing the odds of reflux or discomfort disturbing sleep onset. A light snack closer to bedtime is generally fine and, for some people, actually helps by preventing hunger-driven waking overnight.

A reasonable evening eating pattern

  1. Finish your main evening meal 2-3 hours before bed.
  2. If hungry closer to bedtime, choose a small, easily-digested snack (a few nuts, a small portion of yogurt, a banana) rather than a large or sugary one.
  3. Cut caffeine by early-to-mid afternoon, adjusted for your own sensitivity.
  4. Limit alcohol, especially in the 3 hours before bed.

Frequently asked questions

Does a glass of warm milk before bed actually help?

The tryptophan content is real but modest in the quantities typically consumed โ€” the ritual and warmth likely contribute as much to the calming effect as the biochemistry itself.

Is it bad to go to bed hungry?

For many people, yes โ€” hunger can cause waking during the night. A small, light snack is usually a reasonable solution if you're genuinely hungry at bedtime.

Does drinking water before bed disrupt sleep?

Large amounts can, through nighttime bathroom trips. Staying hydrated earlier in the evening and tapering intake in the final hour before bed is a reasonable balance.