① Where does "no coffee after 2 p.m." actually come from?
I believed that rule for years. When I went looking for what it rests on, I couldn't find an organisation willing to name a time.
The American Academy of Sleep Medicine says only that caffeine may disrupt sleep if taken "too close to bedtime." The Sleep Health Foundation says to "avoid caffeine close to bedtime." A 2023 review quoted both side by side and pointed out that wording this loose leaves people with nothing to act on.
There's a reason nobody commits to a number. Caffeine's half-life ranges from two to ten hours across healthy adults.
② Start with what's solid — 400 mg cut into deep sleep even 12 hours ahead
In 2024 an Australian team tested this head-on. Twenty-three people took placebo, 100 mg, or 400 mg of caffeine at 12, 8, or 4 hours before bed — seven conditions in all — with sleep recorded at home by polysomnography. Neither participants nor researchers knew which condition a given night was, and conditions were spaced 48 hours apart.
The nights with 400 mg four hours before bed were unambiguous.
▸ Total sleep time down 50.6 minutes
▸ Deep sleep (N3) down 29.7 minutes
▸ Sleep efficiency down 9.5%
▸ Time awake after falling asleep up 26.2 minutes
None of that surprised me. What came next did.
Deep sleep was also down 15.3 minutes on the 8-hour nights and 20.6 minutes on the 12-hour nights, and all three were statistically significant. Twelve hours before bed is around 11 a.m. for someone who sleeps at 11 p.m. Caffeine taken before lunch was still showing up in that night's deep sleep.
Total sleep time needs a more careful reading. It fell 28.7 minutes at 8 hours and 30.0 minutes at 12 hours, with p values of .076 and .060 — just short of the threshold. You can't rewrite an estimated half-hour as "no effect," and you can't claim it as confirmed either.
③ And yet 100 mg didn't register, even four hours before bed
Same people, same measurements. At 100 mg nothing separated from placebo — objectively or subjectively — at any of the three timings, including four hours before bed.
400 mg is what the study called the upper recommended daily limit. 100 mg was treated as roughly one cup of coffee. Same hour on the clock, and one cup versus four came out differently.
One caution. A null result in 23 people means "this trial didn't detect it," not "there is no effect."
④ So what is that "8.8 hours" number everyone quotes?
You run into it fast when you search. It comes from a 2023 meta-analysis by the same team, pooling 24 crossover studies. On average caffeine cost 45 minutes of total sleep, added 9 minutes to falling asleep, and took 11.4 minutes off deep sleep.
But what that meta-analysis actually shows isn't the number 8.8. It's that the cutoff moves with the dose.
▸ A cup of black tea (47 mg) — no cutoff at all. Even right before bed, total sleep time didn't drop significantly
▸ A cup of coffee (107 mg) — 8.8 hours
▸ A standard serve of pre-workout (217.5 mg) — 13.2 hours
For a 10 p.m. bedtime that means coffee before 1:12 p.m. and pre-workout before 8:50 a.m. Same person, same night, and the cutoffs sit nearly five hours apart. This was never a question one clock time could answer.
It also matters what was measured to produce 8.8. The paper defines it plainly: the first timepoint at which the 95% confidence interval of the effect size no longer crossed zero for that dose.
Put another way, it isn't the hour caffeine stops affecting you. It's the hour past which a statistically significant reduction is no longer predicted. That's a detection threshold, not a threshold in the body.
I'm not the one drawing that line — the same team wrote it themselves the following year. Because the cutoff came out of statistical modelling, they noted, you can't recover how many minutes of sleep are actually lost, so you can't judge whether the size is clinically meaningful.
⑤ The most awkward finding — people couldn't tell
Each morning participants were asked to guess which condition they'd had. 44% got the dose right, 36% got the timing right, and 22% got both.
The part that stood out was elsewhere. On the 8-hour and 12-hour nights deep sleep measurably dropped, while perceived sleep quality didn't move at all. Only at 4 hours did people report sleeping badly.
So "I drink coffee in the afternoon and sleep fine" is weak evidence of no effect. It looked more like an effect you don't feel at those hours.
⑥ What these studies didn't test
The things I kept flagging as I read.
What was tested was capsules, not coffee. Anhydrous caffeine went into gelatin capsules matched to glucose placebos for weight and appearance. The "100 mg is about a cup" conversion wasn't measured here — the authors borrowed it from other work — and the meta-analysis's "107 mg per 250 mL" comes from a survey of commercial coffee in Australia. Cup sizes, beans and brewing vary enough that counting cups is shakier than noticing the days you drank more than usual.
Every dose was given all at once. The authors flag this themselves: whether the same total spread across the day behaves the same way is unclear. So what this article can speak to is the last cup, not the daily total.
The participants were 23 men, none over 40. The authors explain why women were excluded — hormonal variation, and specifically that oral contraceptives lengthen caffeine's half-life. That at least gives a direction: for women the cutoff plausibly shifts earlier rather than later.
That said, women and older adults aren't missing from the evidence base. Of the 24 studies in the meta-analysis, 12 included women and one was entirely female, and studies with mean ages of 37, 50, 51 and 56 are in there. What the young male sample supplied was the fine-grained dose-by-timing grid, not the broader finding that caffeine disturbs sleep.
Genetics were measured too. Two variants tied to caffeine metabolism and sensitivity were typed in every participant, nothing significant emerged, and the authors state plainly that the study was never powered to detect it.
⑦ What to do with this
The most useful line came from the meta-analysis authors, attached to their own numbers: treat these cutoffs as a starting point and adjust dose and timing against your own sleep. You can't hand the same clock to someone with a two-hour half-life and someone with a ten-hour one.
▸ Sleeping well right now — nothing to change. Just know when your last cup is and how big it is, so you have something to walk back if sleep gets rocky later
▸ Restless at night — before you move the clock earlier, shrink the last cup first. In this trial, shifting from 4 hours to 12 hours didn't spare deep sleep, but dropping to 100 mg at the same hour left nothing detectable
▸ Already off caffeine by the afternoon — check whether the morning total is creeping toward 400 mg. Even a morning dose showed up in that night's deep sleep
One more thing: don't let last night's impression be the judge. Given that participants identified their own condition 22% of the time, two weeks of drinking the same way and comparing beats a single night's feeling.
Change the question and it gets easier to answer. Not "how late can I drink coffee," but "when was my last cup, and how big was it?"
We've written separately about what sleep does to pain.
→
barosit.com/community/p/99e4a6d7-ba38-485e-a166-7e942d9ae3c6
Sources
▸ Gardiner CL, Weakley J, Burke LM, et al. Dose and timing effects of caffeine on subsequent sleep: a randomized clinical crossover trial. Sleep. 2025;48(4):zsae230 (online 8 Oct 2024). Placebo-controlled, double-blind, randomised crossover trial; 23 males (25.3 ± 5.0 years; habitual intake 112.2 ± 81.0 mg/day). 400 mg at 4 h: total sleep −50.6 min (p<.001), N3 −29.7 min (p<.001), sleep efficiency −9.5% (p<.001), WASO +26.2 min (p=.002). N3 also −15.3 min at 8 h (p=.016) and −20.6 min at 12 h (p=.001). Total sleep −28.7 min at 8 h (p=.076) and −30.0 min at 12 h (p=.060), both non-significant. No significant effect of 100 mg at any timing. Condition identification: dose 44%, timing 36%, both 22%. No competing interests.
▸ Gardiner C, Weakley J, Burke LM, et al. The effect of caffeine on subsequent sleep: A systematic review and meta-analysis. Sleep Med Rev. 2023;69:101764. 24 crossover studies. Total sleep −45.3 min (95% CI 29.0–61.5), sleep onset latency +9.1 min, WASO +12 min, sleep efficiency −7% (CI 4.0–10.0), N3+N4 −11.4 min. Meta-regression: timing (p=0.032) and final dose (p=0.037) both significant. Cutoff defined as the first timepoint at which the 95% CI of the effect size did not cross the null. Risk of bias: 16 low, 3 some concerns, 5 high. No competing interests.
This article is not medical advice. If you cut back on caffeine and still can't sleep, caffeine may not be the cause — at that point it's worth looking at sleep itself rather than adjusting when you drink. If you notice heart palpitations or rising anxiety, reduce your intake, and see a clinician if symptoms persist. If you're pregnant or living with heart disease, an anxiety disorder or reflux, separate intake guidance applies and you should discuss it with your doctor.