When should you stop drinking caffeine before bed?
Earlier than most people think. For an ordinary cup of coffee, the best current estimate is about eight hours before bed. A large pre-workout drink or a double energy drink needs closer to thirteen. Caffeine's half-life is around five hours, so a 4pm coffee is still half at work at 9pm. And the most useful finding in the whole literature is this: you probably cannot feel the damage it does.
How long does caffeine stay in your body?
Longer than it feels. The European Food Safety Authority's review of caffeine puts its half-life at around five hours in healthy adults, with a wide spread between people [1]. Half-life is the time for your body to clear half of a dose, so a quarter of your 2pm coffee is still circulating at midnight.
The spread matters as much as the average. Genetics set the speed of the main enzyme that breaks caffeine down, which is why some people can drink an espresso after dinner and others feel a lunchtime latte at bedtime. Pregnancy and the contraceptive pill slow clearance considerably; smoking speeds it up. If you have always suspected you handle caffeine badly, you may simply be right.
Britain is also unusual. In most of Europe the main source of caffeine is coffee. In the UK and Ireland it is tea [1], and tea deserves more respect than it gets: a cup carries around 50mg, against roughly 90mg for a mug of filter coffee, 80mg for an espresso, 80mg for a standard can of energy drink, 40mg for a can of cola and 25mg for a 50g bar of dark chocolate [1]. Three afternoon teas is a large coffee.
What does caffeine actually do to sleep?
It works by impersonating rest. Through the day a molecule called adenosine accumulates in the brain and produces the growing pressure to sleep. Caffeine fits the same receptors and blocks them [2]. The pressure is still building underneath; you just stop receiving the signal. That is why caffeine feels like energy and behaves like a loan.
The size of the loan is now well measured. A 2023 meta-analysis pooled 24 studies of caffeine and night-time sleep and found that, on average, caffeine cut total sleep by 45 minutes and sleep efficiency by seven percent, added nine minutes to the time taken to fall asleep and twelve minutes of waking during the night, and traded around eleven minutes of deep sleep for lighter stages [3]. Deep sleep is the part that leaves you feeling restored, so that last figure is the one to remember. The effect on falling asleep peaked around three hours after the dose [3].
The finding that should change your habits
Here is the study to tell people about. Researchers gave volunteers 400mg of caffeine, about two large coffees, at bedtime, three hours before bed, or six hours before bed. All three disrupted sleep. Taken a full six hours before bed, caffeine still cut objectively measured sleep by more than an hour, and the volunteers did not report any difference in their own sleep [4].
A 2025 randomised crossover trial from the same research group sharpened the picture. It compared 100mg and 400mg doses taken twelve, eight and four hours before bed. The 100mg dose, roughly one small coffee, produced no measurable effect even four hours out. The 400mg dose disturbed sleep even when taken twelve hours before bed, and fragmented it when taken within eight. Yet people only rated their sleep as worse when the large dose came four hours before bed [5]. Their perception lagged the reality by eight hours.
This is why "I can drink coffee in the evening and sleep fine" is usually wrong in an honest way. Tolerance blunts the feeling of alertness. It does not restore the deep sleep the caffeine took, and you have no sensation that reports the loss.
So when is the actual cut-off?
The 2023 meta-analysis did the arithmetic. To avoid losing sleep, a standard coffee of about 107mg should be finished at least 8.8 hours before bed, and a standard pre-workout serving of about 217mg at least 13.2 hours before [3]. For someone in bed at 11pm, that is a last normal coffee around 2pm, and anything strong kept to the morning.
Two refinements. The 2025 trial suggests that a single small dose, around 100mg, is tolerable for most people as late as four hours before bed [5], so the rule is strength multiplied by time, and no single clock hour covers every drink. And EFSA notes that even 100mg close to bedtime affects sleep in some people [1], so if you are one of the slow metabolisers, your line sits earlier than the average. On totals, EFSA's position is that up to 400mg a day, and up to 200mg in one go, raise no safety concerns for healthy adults, with 200mg a day the ceiling in pregnancy [1].
Does caffeine cause the 3am wake?
It can. The extra twelve minutes of waking after sleep onset and the loss of deep sleep in the meta-analysis [3], and the fragmentation seen when a large dose lands within eight hours of bed [5], are exactly the shape of a night that starts well and breaks in the small hours. If your wakings cluster after days with an afternoon coffee, you have a strong suspect. We have written separately about why you wake up at 3am and what genuinely helps, and caffeine timing is the first thing to rule out.
How to move your last cup without misery
Do it gradually. Bring your last caffeine forward by half an hour every few days, and the withdrawal headache most people fear either never arrives or passes within a day or two.
Use tea as the step down. At around 50mg a cup it is a gentler afternoon habit than coffee, and swapping the 3pm coffee for a tea before swapping the tea for something without caffeine is an easy staircase. Decaffeinated coffee carries a trace of caffeine, small enough not to matter for most people.
Check hidden sources. Cola, dark chocolate and some over-the-counter painkillers carry meaningful caffeine, and the painkillers in particular are easy to take in the evening without a thought. The label will tell you.
Address the slump honestly. The mid-afternoon dip is partly your body clock and partly whatever sleep you did not get last night. Daylight, a short walk, or a nap of twenty minutes or less before mid-afternoon all treat the cause. Caffeine borrows against tonight.
Where supplements honestly fit
Behind the coffee cut-off, every time. No supplement undoes four coffees, and we say so on our homepage because it is true. Moving your last caffeine to the early afternoon is free, evidence-backed, and for a great many people it is the whole fix.
If a fortnight of an honest cut-off leaves you still lying awake at bedtime, that is a switching-off problem in its own right, and falling asleep and staying asleep are different problems worth telling apart. Our Fall Asleep formula is built for that half of the night, with glycine at the studied 3g dose alongside L-theanine and magnesium, and four quick questions on our homepage will tell you which half of the night is yours.
Common questions
Is 2pm too late for coffee?
For a normal cup and a bedtime around 11pm, 2pm sits right at the meta-analysis cut-off of about 8.8 hours [3], so it is fine for most people. Push to 3pm or 4pm and you are inside the window where measured sleep loss begins, whether or not you feel it [4].
How much caffeine a day is safe?
EFSA concluded that up to 400mg a day, and up to 200mg in a single dose, raise no safety concerns for healthy adults, and that pregnant women should stay at or below 200mg a day [1]. Safety and sleep are different questions, though: a dose that is perfectly safe can still cost you an hour of sleep depending on when you take it.
Does decaf affect sleep?
Decaffeinated coffee contains a small amount of caffeine, far below the roughly 100mg that begins to affect sleep in sensitive people [1]. A late decaf is a reasonable habit for almost everyone.
Why does coffee sometimes make me feel more tired?
Because it masks sleep pressure rather than removing it. Caffeine blocks the adenosine signal while adenosine keeps building [2], so when the caffeine clears, the accumulated pressure lands at once. That crash is a measure of the sleep you owe, and the honest treatment is sleep.
References
- EFSA Panel on Dietetic Products, Nutrition and Allergies. Scientific opinion on the safety of caffeine. EFSA Journal. 2015;13(5):4102.
- Fredholm BB, Bättig K, Holmén J, Nehlig A, Zvartau EE. Actions of caffeine in the brain with special reference to factors that contribute to its widespread use. Pharmacological Reviews. 1999;51(1):83-133.
- Gardiner C, Weakley J, Burke LM, Roach GD, Sargent C, Maniar N, Townshend A, Halson SL. The effect of caffeine on subsequent sleep: a systematic review and meta-analysis. Sleep Medicine Reviews. 2023;69:101764.
- Drake C, Roehrs T, Shambroom J, Roth T. Caffeine effects on sleep taken 0, 3, or 6 hours before going to bed. Journal of Clinical Sleep Medicine. 2013;9(11):1195-1200.
- Dose and timing effects of caffeine on subsequent sleep: a randomized clinical crossover trial. 2025. PubMed Central PMC11985402.
