How Nutrition Affects Sleep Quality
Caffeine, alcohol, late large meals, and chronic under-eating all affect sleep in measurable ways. The interventions that actually move the needle are unsurprising and unsexy.
The takeaways
- Caffeine has a half-life of ~5–6 hours; afternoon coffee shows up in sleep architecture even if you fall asleep fine.
- Alcohol falls asleep easily and wakes badly; it suppresses REM and fragments the second half of the night.
- Adequate carbohydrate intake supports sleep — chronic energy restriction is a common cause of disrupted sleep in dieters.
- Magnesium, glycine, and tart cherry have small evidence bases; sleep hygiene has a much larger one.
Sleep is the recovery variable that has the largest effect on almost everything else, and nutrition interacts with it in concrete, measurable ways. The interesting part is not the supplements aisle; it is the day-to-day pattern of caffeine, alcohol, energy intake, and meal timing. If you change those, you will sleep meaningfully better. If you ignore those and add a magnesium pill, you will sleep almost the same.
Caffeine: the easy lever everyone underuses
Caffeine has an average half-life of about 5–6 hours, which means a 2 p.m. coffee still has roughly 50% of its caffeine in your system at 7 p.m. and 25% at midnight. Studies that have used polysomnography to measure sleep architecture (not just self-reported quality) have shown that caffeine taken even six hours before bed reduces total sleep time by ~40 minutes and reduces deep sleep substantially. Most people fall asleep fine on caffeine; their sleep just is not as good.
- If you wake up tired or groggy, your last caffeine intake is the cheapest experiment to run.
- A practical default: no caffeine after about 2 p.m. for most adults.
- Slow metabolisers (some carry CYP1A2 variants) should cut earlier.
Alcohol: a sedative, not a sleep aid
Alcohol shortens sleep onset latency — you fall asleep faster — but degrades sleep quality across the night. The first half of the night looks almost normal on EEG; the second half shows REM suppression, increased awakenings, and more fragmented sleep. Subjective quality also drops. Even moderate intake (1–2 drinks) measurably affects HRV and sleep latency in tracked individuals. The pragmatic guidance: alcohol earlier is better, alcohol less is better, and alcohol with food and water is better than without.
Energy intake and sleep
Chronic energy restriction is a commonly missed cause of disrupted sleep. People dieting hard often report waking at 3 a.m., shallow sleep, or sweaty wake-ups; the mechanism is partly stress-hormone driven and partly carbohydrate-related. Increasing total energy by 100–200 kcal in the evening, particularly with some carbohydrate, often resolves the pattern. Athletes in extended deficits should be especially attentive to this.
Meal timing
A very large meal less than two hours before bed worsens sleep onset and increases reflux risk. A small meal or snack with protein and some carbohydrate (yoghurt with berries, oatmeal, a slice of toast with cottage cheese) is fine and may help in the context of energy restriction. Skipping dinner entirely is a tactic some people use successfully and others find sleep-disrupting; pay attention to what your own body reports.
What about supplements?
- Magnesium: small effect on subjective sleep in older adults and in people who were low to begin with. Not a magic intervention but reasonable if dietary intake is low.
- Glycine (3 g before bed): modest evidence for improved sleep onset and quality.
- Tart cherry juice: small, study-replicated effect on sleep duration through endogenous melatonin and tryptophan.
- Melatonin: useful for circadian misalignment (jet lag, shift work). Doses 0.3–1 mg are physiological; the 5–10 mg products on shelves are pharmacological and often counterproductive.
- L-theanine, ashwagandha, valerian: small and inconsistent effects in trials.
Hydration and night-time waking
Drinking large volumes within an hour or two of bed predictably causes nocturia. Front-load fluid earlier in the day. People who dehydrate during the day and then catch up in the evening often report fragmented sleep that resolves with a more even fluid distribution.
Tracking sleep alongside intake
If you track both your eating and your sleep, you can find your own patterns much faster than any general advice can give them to you. People who pair a nutrition app with a basic sleep tracker often discover within two weeks that their worst sleep nights cluster predictably with afternoon caffeine, late dinners, alcohol, or low-energy days. None of that is mystical; it is just data you would not have had otherwise.
Frequently asked
Does eating before bed cause weight gain?
Total energy across the day determines weight; meal timing is mostly a satiety and sleep-quality lever. A small protein-and-carb snack before bed is fine and may even support sleep in people who are otherwise hungry. A large heavy meal close to bedtime is more likely to disrupt sleep than to specifically cause fat gain.
How long before bed should I stop drinking caffeine?
Caffeine's half-life is about 5–6 hours, so most adults benefit from cutting off intake 8+ hours before sleep. For people aiming for 11 p.m. bedtime, that means no caffeine after about 2 p.m.
What is the best supplement for sleep?
There is no clear winner. The interventions with the largest effect sizes are sleep hygiene, consistent timing, and reducing caffeine and alcohol — not supplements. Among supplements, low-dose melatonin (0.3–1 mg) is best for circadian misalignment; magnesium and glycine have modest evidence for general sleep quality.
References & further reading
- Drake C et al. (2013). Caffeine effects on sleep taken 0, 3, or 6 hours before going to bed. JCSM.
- Ebrahim IO et al. (2013). Alcohol and sleep I: effects on normal sleep. Alcoholism: Clin & Exp Res.
- Inagawa K et al. (2006). Subjective effects of glycine ingestion before bedtime on sleep quality.
Editorial note. Articles on The Pantry Notes are written for general informational purposes and are not medical advice. See our editorial principles for how we work.
Keep reading
Magnesium 101: The Quiet Mineral
Magnesium is involved in hundreds of enzymatic reactions and is one of the most commonly low minerals in modern diets. A grounded guide to forms, food, and supplementation.
Pre-Workout Nutrition: Timing, Composition, and What Actually Helps
What to eat before training, when to eat it, and which pre-workout claims survive contact with the evidence.
Post-Exercise Recovery: The 24-Hour Window
What recovery actually requires in the hours after a hard session — protein, carbs, sleep, and the things that genuinely help versus the things that do not.