Sleep and food occupy the same loop. One night of poor sleep raises levels of ghrelin (the hunger hormone) and lowers leptin (the satiety hormone), reliably increasing appetite the following day — particularly for high-sugar, high-fat foods. Those food choices then disrupt the following night’s sleep, and the cycle continues.

Most conversations about sleep focus on the bedroom: the darkness, the temperature, the screens. These matter. But what you eat, when you eat, and which specific nutrients you get enough of have a direct, documented effect on sleep quality that is rarely given the same attention. Food is one of the most accessible levers available for better sleep — and one of the least used.

“Sleep is not separate from nutrition. It is downstream of it. What you eat all day shapes how you sleep at night.”

— Mama Sara

How Food Affects Sleep: The Key Mechanisms

The connection between food and sleep runs through several overlapping pathways. Understanding them makes the practical advice make sense rather than feel arbitrary.

Tryptophan and serotonin. Tryptophan is an amino acid — found in protein-rich foods — that the body converts first into serotonin and then into melatonin, the hormone that governs the sleep-wake cycle. Without adequate tryptophan intake, melatonin production is limited. Carbohydrates eaten alongside tryptophan-rich foods help shuttle tryptophan into the brain more efficiently — which is part of why a small carbohydrate-containing evening snack can genuinely support sleep onset.

Blood sugar stability. Blood sugar that crashes during the night triggers a cortisol release that can wake you or prevent deep sleep. This is why going to bed hungry, or eating a high-sugar dinner that causes a subsequent blood sugar drop, can disrupt sleep architecture even when you feel you’ve slept through the night. Stable blood sugar through the day and into the evening supports uninterrupted sleep.

Gut-brain communication. The gut produces around 90% of the body’s serotonin and communicates directly with the brain via the vagus nerve. A well-nourished gut microbiome produces neurotransmitters and short-chain fatty acids that support relaxation and healthy sleep. A dysbiotic gut — disrupted by a diet high in ultra-processed food and low in fibre — produces inflammatory signals that can interfere with both mood and sleep.

Inflammation. Chronic low-grade inflammation — driven by poor dietary choices, excess sugar, and a high omega-6 to omega-3 ratio — disrupts sleep quality independently. People with higher inflammatory markers consistently show poorer sleep across multiple large studies.

Nutrients That Support Sleep

Sleep nutrient
Magnesium
The most important sleep mineral. Magnesium activates the parasympathetic nervous system (rest and digest), regulates neurotransmitters including GABA (the brain’s primary calming chemical), and is involved in regulating melatonin. The majority of adults are borderline deficient. Food sources: dark leafy greens, pumpkin seeds, almonds, dark chocolate (70%+), black beans, avocado, and whole grains. Consistently low magnesium intake is strongly associated with insomnia and restless sleep.
Sleep nutrient
Tryptophan
The precursor to both serotonin and melatonin. Food sources: turkey, chicken, eggs, dairy (particularly warm milk — the folk remedy has a biochemical basis), oats, bananas, pumpkin seeds, and tofu. Eating tryptophan-rich food alongside a small amount of complex carbohydrate in the evening (a banana with almond butter, oat-based porridge, warm milk with honey) enhances its conversion to serotonin and melatonin.
Sleep nutrient
Melatonin (food sources)
Small amounts of melatonin occur naturally in certain foods: tart cherries (the highest known food source — tart cherry juice has shown measurable effects on sleep duration and quality in several trials), tomatoes, grapes, walnuts, and oats. While food-source melatonin is far lower than supplemental doses, regular consumption of tart cherry juice in the evening is one of the few dietary interventions with clinical trial support for sleep.
Sleep nutrient
Vitamin D
Vitamin D deficiency is strongly associated with sleep disorders, shorter sleep duration, and poor sleep quality. The mechanism involves vitamin D receptors in the areas of the brain that regulate sleep. Food sources are limited (oily fish, egg yolks, fortified foods) — most vitamin D comes from sunlight exposure. During winter months in northern latitudes, supplementation is recommended for most adults. If you struggle with sleep and haven’t had your vitamin D checked, it is worth doing.
Sleep nutrient
B vitamins
B6, B9 (folate), and B12 are all involved in the synthesis of serotonin and melatonin. B6 in particular is required as a cofactor in the conversion of tryptophan to serotonin. Food sources: whole grains, legumes, leafy greens, eggs, meat, and fish. A diet based on whole foods provides these readily; a diet high in processed food is typically deficient across the B vitamin range.
Sleep nutrient
Omega-3 fatty acids
Higher omega-3 intake is associated with better sleep quality and longer sleep duration. The mechanism involves DHA’s role in brain cell membrane function and its effect on serotonin signalling. A study of children found that DHA supplementation increased sleep duration by nearly an hour. Food sources: oily fish, walnuts, flaxseed, chia seeds. Two to three portions of oily fish per week provides a meaningful dose.

Foods and Habits That Disrupt Sleep

  • !
    Caffeine (later than you think)

    Caffeine has a half-life of five to seven hours in most adults — meaning that a coffee at 3pm still has half its caffeine active at 8 or 9pm. It blocks adenosine receptors (adenosine is the chemical that builds sleep pressure through the day), reducing sleep drive and delaying sleep onset. Even if you fall asleep normally, caffeine consumed in the afternoon reduces slow-wave (deep) sleep measurably. A 2pm cutoff is a reasonable minimum; noon is better for those sensitive to caffeine.

  • !
    Alcohol

    Alcohol is widely used as a sleep aid and genuinely helps with sleep onset. The problem is what it does to sleep architecture: alcohol suppresses REM sleep in the first half of the night and causes rebound REM (lighter, more fragmented sleep) in the second half. The result is sleep that feels less restorative even at the same duration. One or two drinks on occasion is unlikely to cause significant disruption; regular evening drinking consistently degrades sleep quality.

  • !
    Large, late meals

    Eating a large meal within two to three hours of bed forces the digestive system to work during what should be a rest period, raises core body temperature (which inhibits sleep onset), and can cause reflux in those prone to it. If dinner is late by necessity, keep it lighter — protein and vegetables rather than a large serving of heavy carbohydrates — and allow at least ninety minutes before lying down.

  • !
    High-sugar evening snacks

    A sugary snack before bed causes a blood glucose spike followed by a drop during the night, triggering a cortisol release that can cause early waking or prevent return to deep sleep. If you snack in the evening — and many people do — choose something that combines protein and a small amount of complex carbohydrate: a small bowl of oats, a piece of cheese with an oatcake, a banana with nut butter, warm milk. These support stable blood sugar through the night.

  • !
    Eating too little through the day

    Undereating during the day — skipping breakfast, eating a small lunch — and then eating the majority of calories in the evening disrupts circadian rhythm (the body clock that governs sleep), raises cortisol in the evening when it should be falling, and creates hunger that interferes with sleep onset. Distributing food intake more evenly across the day, with a reasonably substantial breakfast and lunch, supports the natural cortisol curve and better sleep.

An Evening Eating Pattern for Better Sleep

This is not a rigid protocol — it is a framework that brings together the evidence above into something practical.

Dinner (ideally 2–3 hours before bed): A balanced meal with protein (supports tryptophan availability), complex carbohydrates (help shuttle tryptophan into the brain), and plenty of vegetables. Think: salmon with roasted sweet potato and greens. Chicken with lentils and a salad. A vegetable and chickpea stew with wholegrain bread.

If you want an evening snack: Something small, protein-led, with a little complex carbohydrate. Warm oat milk. A small bowl of porridge with banana. A few walnuts and a small piece of dark chocolate. A warm herbal tea — chamomile, valerian, passionflower — which have mild anxiolytic effects that support relaxation.

What to stop: Caffeine after 2pm. The evening glass of wine if sleep is already poor. The late-night sugar hit. The habit of eating dinner at 10pm.

Better sleep is one of the highest-leverage things you can do for your health — it affects everything from immune function to mental health to metabolic rate to food choices the following day. And food is one of the most direct, practical, within-your-control inputs into sleep quality. Start there.