In sleep hygiene I gave caffeine one section and a rule of thumb: cut it 8 to 10 hours before bed. That rule deserves its own numbers, because it is one of the few in sleep science where a meta-analysis has produced an actual clock time, and because almost everyone I talk to sets their cutoff by feel. Feel is exactly the sense caffeine switches off.
What does caffeine actually cost you in sleep?
In 2023, Gardiner’s team pooled 24 randomised trials into a single meta-analysis. The averages: total sleep time down 45 minutes, sleep efficiency down 7%, falling asleep 9 minutes slower, and 12 more minutes awake during the night. Light sleep went up, deep sleep went down by 11.4 minutes.
Forty-five minutes a night is not a rounding error. It is roughly the difference between 7.5 hours and under 7, which is where the metabolic costs described in sleep and longevity start to show up. And that is an average across doses and timings, including some fairly conservative ones.
The deep sleep number bothers me more than the total. You can partly compensate for a shorter night by going to bed earlier. You cannot decide to have more slow-wave sleep.
Why you do not feel the damage
Drake’s 2013 randomised trial is the one I quote most often, because of a detail that rarely makes it into summaries. Participants took 400 mg of caffeine 0, 3 or 6 hours before bed. At 6 hours, polysomnography showed more than an hour of lost sleep. Subjective sleep quality ratings did not differ from placebo.
Read that again. The machines saw over an hour missing. The people felt nothing.
This breaks the feedback loop most people rely on. “Coffee at 4 pm doesn’t affect me” usually means “I don’t notice the effect”, which after Drake is a very different claim. It also explains how someone can drink espresso after dinner for a decade and honestly report sleeping fine.
How late is too late, exactly?
The Gardiner meta-analysis did something unusual: it modelled dose against timing and produced cutoffs. To avoid a measurable reduction in total sleep time:
| Dose | Example | Last intake before bed |
|---|---|---|
| ~107 mg | one 250 ml filter coffee | 8.8 h |
| ~217 mg | standard pre-workout serving | 13.2 h |
For a 10:30 pm bedtime, that puts the last coffee at about 1:40 pm and the last pre-workout at 9:20 am. The pre-workout number surprises people every time I mention it: an evening gym session with a scoop of pre-workout is, caffeine-wise, a double espresso at 9 pm.
Two caveats before you set an alarm. These are population averages from crossover trials, mostly in younger adults. And the dose-timing model assumes a single intake, while most coffee drinkers stack: a 9 am, an 11 am and a 2 pm coffee overlap in your blood in a way no single-dose cutoff fully captures.
Why your friend can drink espresso at 9 pm
Caffeine’s half-life averages 5 to 6 hours but ranges from roughly 2 to 10 across healthy adults. Most of that spread is CYP1A2, the liver enzyme that clears caffeine. Fast metabolisers genuinely can drink coffee after dinner and sleep; slow metabolisers are still carrying half the dose at 2 am.
You do not need a genetic test to find out which you are. Run the behavioural version: two weeks with a 2 pm cutoff, two weeks without, logging minutes-to-sleep each morning. If the cutoff weeks look identical, congratulations, spend your attention elsewhere. Hormonal contraception and pregnancy slow clearance further, which is worth knowing if your usual afternoon coffee suddenly starts costing you nights.
The trap is using your friend’s tolerance as evidence about your own. CYP1A2 does not transfer by argument.
Where caffeine hides
Working back from the 8.8-hour rule only works if you count everything:
| Source | Typical caffeine |
|---|---|
| Filter coffee, 250 ml | 100–140 mg |
| Espresso, single | ~63 mg |
| Black tea, 250 ml | 40–70 mg |
| Energy drink, 250 ml | 80 mg |
| Cola, 330 ml | 32–40 mg |
| Dark chocolate, 50 g | 20–40 mg |
| Decaf, 250 ml | 2–7 mg |
The afternoon tea people switch to “instead of coffee” is a half-coffee. Decaf, on the other hand, is genuinely negligible: you would need to chain ten cups to approach one filter coffee. If your evening ritual is the cup rather than the drug, decaf solves the problem cleanly.
The three-coffee day, added up
Single-dose cutoffs undersell the problem, because doses stack. Take an ordinary office day, three filter coffees of about 100 mg each at 9 am, 11 am and 2 pm, and a 5-hour half-life. By 10:30 pm the residuals look like this:
| Coffee | Time | Left in blood at 10:30 pm |
|---|---|---|
| #1, 100 mg | 9:00 am | ~15 mg |
| #2, 100 mg | 11:00 am | ~20 mg |
| #3, 100 mg | 2:00 pm | ~31 mg |
| Total | ~66 mg |
Sixty-six milligrams at lights-out is two-thirds of an espresso, from a day where every single coffee individually respected the “no coffee after 2 pm” rule. With a slow CYP1A2 variant and an 8-hour half-life, the same day leaves over 100 mg in circulation at bedtime, a full coffee you never see yourself drinking.
This arithmetic is why I treat the 8.8-hour figure as the cutoff for the last dose, not permission for a heavy afternoon. If your total is four or more coffees, the honest fix is shrinking the stack, not just moving it.
Does tolerance protect you?
Partly, and less than it feels like it does. Habitual intake blunts the subjective kick, mostly through changes in adenosine signalling, but trials still find objective sleep effects in regular consumers. Tolerance is better at hiding the cost than removing it, which is Drake’s finding restated.
There is also the circular pattern worth naming: short sleep raises next-day caffeine intake, which trims the next night, which raises intake again. Gardiner’s group framed their whole review around this loop. If you are drinking four coffees to survive the afternoon, the cutoff is not the first thing to fix; the night before is. Start with the sleep protocol and let the caffeine dose fall on its own.
What we do not know
The cutoff model comes from single doses in mostly young, healthy adults; nobody has properly modelled a realistic three-coffee day. Data in adults over 60, who clear caffeine more slowly, is thin. And we do not know how much of the deep sleep reduction matters long-term in people whose total sleep time stays normal. Where the evidence stops, I stop.
Where to start tonight
Pick your bedtime, subtract 9 hours, and make that your last-coffee alarm for two weeks. Log two numbers each morning: minutes to fall asleep, number of awakenings. That is the whole experiment. If nothing changes, you have earned your afternoon espresso back with data instead of a hunch. If you also drink in the evenings, run this before touching alcohol, because the two overlap in tracker data and alcohol has its own article.
Frequently asked questions
How many hours before bed should I stop drinking coffee?
The 2023 meta-analysis puts a standard coffee (about 107 mg) at 8.8 hours before bed to avoid measurable sleep loss, and a pre-workout dose (about 217 mg) at 13.2 hours. With a slow CYP1A2 variant, add margin: noon is a safer cutoff than 2 pm.
Does decaf affect sleep?
Practically no. A cup of decaf carries 2 to 7 mg of caffeine against 100 to 140 mg in filter coffee. You would need around ten cups to approach one regular coffee, so an evening decaf is a sleep-neutral ritual.
Why can some people drink espresso after dinner and sleep fine?
Caffeine's half-life ranges from about 2 to 10 hours between healthy adults, driven largely by the CYP1A2 enzyme. Fast metabolisers clear an evening espresso before it matters. The risk is assuming you are one of them without testing it, since caffeinated sleep loss is mostly not felt.
Does caffeine reduce deep sleep?
Yes. Pooled trial data shows about 11 fewer minutes of slow-wave sleep with caffeine, alongside more light sleep and more time awake during the night. Unlike total sleep time, deep sleep cannot be topped up by simply staying in bed longer.
Sources
- The effect of caffeine on subsequent sleep: A systematic review and meta-analysis (2023) · meta-analysis · PMID 36870101
- Caffeine effects on sleep taken 0, 3, or 6 hours before going to bed (2013) · RCT · PMID 24235903
- Recommended Amount of Sleep for a Healthy Adult: A Joint Consensus Statement of the AASM and Sleep Research Society (2015) · review · PMID 26039963