
Caffeine and Sleep: How Late Is Too Late?
Caffeine lingers for hours. Learn the half-life, the six-hour study, hidden sources in mg, decaf facts and a two-week test to find your own cut-off.
You have probably seen lists of foods that promise better sleep. Here is what actually holds up: when and how much you eat in the evening, and what the studies behind tart cherry, kiwi and magnesium really show.
Written by the Complete Sleep editorial team
Pending medical review
Published Updated 6 min read
What changed September 2026: magnesium reworded as a supplement to discuss with a doctor, not a harmless extra.


Medical reviewer
Sleep Physician · Board-certified in Sleep Medicine
Pending medical review
In short
What you eat before bed matters less than when and how much. Finish your main meal two to three hours before lying down, keep any bedtime snack small, taper fluids in the evening, and raise the head of the bed if reflux wakes you. Tart cherry, kiwi, warm milk and magnesium have only small, short, low-certainty studies behind them, so treat them as pleasant extras, not treatments.
Key takeaways
Most advice on this topic is about single foods. The evidence says otherwise: when and how much you eat in the evening matters more than whether the snack is a banana or almonds.
The American Academy of Sleep Medicine's healthy sleep habits list is direct: don't eat a large meal before bedtime, and if you are hungry at night, have a light, healthy snack. It also says to avoid afternoon and evening caffeine and alcohol before bed, and to reduce fluids before bedtime.
Lying down on a full stomach makes it easier for stomach contents to travel back up. Heartburn, a sour taste, coughing or a hoarse voice at night are clues that reflux is breaking up your sleep.
The American College of Gastroenterology's 2022 guideline suggests avoiding meals within two to three hours of bedtime, and names the usual aggravators: coffee, chocolate, fizzy drinks, spicy food, citrus, tomatoes and high-fat food. That gap is one of the most useful levers you have, but not the only one. For night-time symptoms it also suggests raising the head end of the bed, and it recommends weight loss for anyone overweight.
Going to bed hungry is not a virtue, and it can make falling asleep harder. A small snack is reasonable: fruit, yoghurt, a small bowl of oats or toast with nut butter. The point is small: something you finish in minutes, not a second dinner. If reflux is your problem, the usual advice is to skip the snack.
"Sugar before bed crashes your blood sugar and wakes you up." For people without diabetes, this is mostly assumption. The controlled studies are small; a well-known one found that a high-glycaemic-index meal shortened the time to fall asleep when eaten four hours before bed rather than one. What a large or high-fat late meal can do is provoke reflux.
The picture is different if you have diabetes, especially on insulin or other glucose-lowering medicines. If you wake with symptoms of a low, treat it straight away, exactly as your care plan says. What belongs with your doctor or diabetes team is the pattern: if it keeps happening, they may adjust your medicines or even suggest a bedtime snack.
"Spicy food gives you nightmares." There is no good evidence for this. What spicy food can do is trigger reflux, which fragments sleep. If a curry at 9 pm ruins your night, suspect heartburn, not your dreams.
These keep appearing on lists because there is some research behind each; it is thin.
The 2016 review summed up the field: studies have been "too diverse, short, and small to lead to firm conclusions". Enjoy tart cherry juice or kiwis if you like them; just don't expect them to fix insomnia, or buy supplements on this evidence. For persistent trouble sleeping, see our guide to insomnia and what actually helps.
Waking to urinate is a common reason sleep breaks up. Drink normally through the day, then taper in the last two to three hours; no need to go to bed thirsty. If you still get up several times a night, mention it to a doctor rather than cutting fluids further.
Shift workers face this in reverse, with an "evening" meal at 3 am and bedtime at 8 am, but the same principles apply. Eat your main meal before or early in the shift, keep night-time food light, leave the same gap before lying down, and keep caffeine to early in the shift, not the drive home. See our guide to shift work and sleep.
Talk with your doctor if night-time heartburn is more than occasional or keeps returning despite these changes. Some symptoms need prompt assessment whatever their frequency: difficulty swallowing, unintentional weight loss, persistent vomiting, or any sign of bleeding such as vomiting blood or black, tarry stools. Chest pain at night should never be assumed to be reflux; heart causes need ruling out first. Also see a doctor if you regularly wake feeling you must eat to get back to sleep, or eat much of your food after the evening meal (night eating syndrome, which doctors recognise and can help with); if you have diabetes and wake unwell; or if you are up to urinate several times a night.
What you eat before bed matters less than when and how much. Leave two to three hours between your last proper meal and bed, keep late food light, raise the head of the bed if reflux wakes you, taper evening fluids, and treat tart cherry, kiwi, warm milk and magnesium as harmless extras, not remedies. Persistent reflux, night eating or night waking belong with a doctor; the warning symptoms above need prompt attention.
Aim to finish your main meal two to three hours before lying down. The American College of Gastroenterology's 2022 guideline suggests avoiding meals within two to three hours of bedtime if you get reflux, and raising the head of the bed for night-time symptoms. A small snack closer to bedtime is fine if you are genuinely hungry and reflux is not the problem.
The evidence is weak. The main trials involved 15 and 20 people for one to two weeks and reported modest improvements. It is harmless if you enjoy it, but it is not a treatment for insomnia.
For some people, going to bed hungry makes it harder to fall asleep. A small snack such as fruit, yoghurt or toast with nut butter is reasonable; the goal is something light, not a second dinner.
A 2021 systematic review found only three small trials in older adults and rated the evidence low to very low certainty. Talk with your doctor before adding any supplement, and address meal timing and evening habits first.
Related reading
Two-minute check
Wondering about snoring or daytime sleepiness? STOP-Bang is scored in your browser.
Take the self-checkTopics

Caffeine lingers for hours. Learn the half-life, the six-hour study, hidden sources in mg, decaf facts and a two-week test to find your own cut-off.

Alcohol makes you fall asleep faster, then breaks up the second half of the night: less REM, more waking, worse snoring and apnea. What to do instead.