What you eat and drink in the hours before bed can meaningfully affect how quickly you fall asleep, how deeply you sleep, and how rested you feel in the morning. The relationship isn't magic — it's biology. Certain nutrients and compounds support the processes your body uses to wind down, while others work against them.
Here's what the science says, what variables shape your experience, and what's worth paying attention to on your own plate.
Sleep is regulated by two key systems: circadian rhythm (your internal body clock) and sleep pressure (the buildup of adenosine, a chemical that makes you feel tired). Several hormones and neurotransmitters drive these systems — most notably melatonin and serotonin.
The foods you eat influence these compounds directly. Some foods contain sleep-relevant nutrients. Others contain the precursors — the raw materials your body uses to manufacture those compounds. Timing, quantity, and individual metabolism all determine how much impact any given food actually has.
Tryptophan is an amino acid your body converts into serotonin and then into melatonin — the hormone that signals nighttime to your brain. It's one of the most studied dietary contributors to sleep.
Foods with meaningful tryptophan content include:
One nuance worth knowing: tryptophan competes with other amino acids to cross the blood-brain barrier. Pairing tryptophan-rich foods with complex carbohydrates may help, because carbohydrates trigger an insulin response that clears competing amino acids from the bloodstream — potentially making it easier for tryptophan to reach the brain. Whether this effect is meaningful in practice varies by person and portion size.
Some foods contain small amounts of melatonin itself, not just its precursors. Research into dietary melatonin is still developing, but foods that have shown measurable melatonin content include:
Tart cherry juice in particular has received attention in sleep research, with some studies noting improvements in sleep duration and quality in certain populations. The concentrations vary widely by product and serving size, so results aren't uniform.
Magnesium is a mineral involved in nervous system regulation and the activation of neurotransmitters associated with relaxation. Low magnesium has been associated with sleep disruption in some research, though the relationship is complex.
Good dietary sources include:
| Food | Notes |
|---|---|
| Dark leafy greens (spinach, Swiss chard) | High concentration |
| Pumpkin seeds | Also a tryptophan source |
| Black beans and legumes | Versatile, easy to incorporate |
| Dark chocolate | Small amounts; watch caffeine content |
| Avocado | Also contains B vitamins |
| Whole grains | Oats, brown rice, quinoa |
A small, complex carbohydrate-based snack before bed is broadly considered better than either going to bed hungry or eating a large, heavy meal. Options like oatmeal, whole-grain crackers, or a small bowl of rice are gentle on digestion and may support tryptophan transport as described above.
Highly processed carbohydrates — white bread, sugary snacks — can spike and then crash blood sugar, which may disrupt sleep continuity for some people.
Several herbal teas have long been associated with relaxation and sleep support:
None of these are sedatives in a clinical sense, but they can be part of a wind-down routine that signals to your body it's time to sleep.
The classic warm milk remedy has some basis in biology — milk contains tryptophan, and the warmth itself may have a mild relaxing effect. Whether the tryptophan content is sufficient to measurably move the needle is debated, but for many people, it functions as a calming bedtime ritual, which has its own value.
Worth separating out from herbal teas because its mechanism is different — it's specifically the melatonin and anti-inflammatory compounds in tart cherries (not just a warm, comforting drink) that researchers have focused on.
Understanding helpful foods means understanding what works against sleep:
The when can matter as much as the what. A large meal immediately before bed — regardless of content — puts your digestive system to work at a time when your body is trying to shift into rest mode. Most sleep-focused guidance suggests finishing significant eating at least two to three hours before bed, with lighter snacks being the exception if hunger is an issue.
The timing of caffeine deserves particular attention. Individual sensitivity varies widely — some people can have caffeine in the early afternoon with no effect on sleep; others are affected by morning coffee if they're particularly sensitive. Knowing your own response matters here.
No food affects everyone identically. Factors that influence how much dietary changes affect your sleep include:
Dietary changes alone are unlikely to resolve significant sleep problems — but they can meaningfully support a broader approach to better sleep. The most consistently relevant habits across the evidence:
What's most useful for any individual depends on their current diet, health history, lifestyle, and what's actually disrupting their sleep — which is worth exploring with a healthcare provider if sleep problems are persistent or severe.
