In 2013, researchers at Henry Ford Hospital in Detroit gave twelve healthy sleepers three pills a night for four nights — one at bedtime, one three hours before, one six hours before. On any given night, one of those pills held 400 mg of caffeine, roughly a large Starbucks coffee. The other two were placebo.

The six-hour dose — caffeine swallowed at 5 p.m. for an 11 p.m. bedtime — cut objectively measured sleep by more than an hour.

Here’s the part that should bother you. The participants filled out sleep diaries every morning. When they’d taken caffeine at bedtime or three hours before, they noticed. When they’d taken it six hours before, the diaries said nothing. Only the sleep monitor caught it. They lost an hour of sleep and woke up believing they’d slept normally.

The math your 3 p.m. coffee is doing without you

Caffeine’s half-life in a healthy adult averages about five hours. Half-life means exactly what it sounds like: the time your body takes to clear half of what’s circulating. It doesn’t mean the caffeine is “mostly gone” after one round.

Run the numbers on a 200 mg coffee at 3 p.m. By 8 p.m. you’re at 100 mg, about a large mug’s worth. At 11 p.m., lights out, you’ve still got roughly 66 mg on board — more than a shot of espresso. You don’t drop below 25 mg, the caffeine equivalent of a weak cup of tea, until around 6 a.m. Fifteen hours after you drank it.

A 3 PM coffee (200 mg) through the night — three metabolisms

050 mg100 mg150 mg200 mg3 PM7 PM11 PM3 AM7 AMbedtime
Fast (3 h half-life)Typical (5 h)Slow (9 h)
Milligrams remaining after a 200 mg coffee at 3 PM, for half-lives of 3, 5 and 9 hours. The dashed line marks 50 mg; the vertical line is an 11 PM bedtime. Model your own day in the caffeine calculator.

Five hours is an average. You are not an average.

Across individuals, caffeine half-life spans something like 2 to 12 hours. Caffeine is metabolized almost entirely by a liver enzyme called CYP1A2, and the gene coding for it carries at least 150 known variants. Some people clear caffeine fast enough to drink espresso after dinner. Some don’t.

On top of the genetics, a short list of everyday factors shifts the curve hard. Oral contraceptives roughly double caffeine’s half-life — if you’re on the pill, your five hours is closer to ten. Pregnancy stretches it further, up to 16 hours beyond baseline in the third trimester. Cigarette smoke pushes the other way, nearly doubling clearance — part of why heavy smokers drink so much coffee.

Same 3 p.m. coffee, three people: a fast metabolizer has about 31 mg left at 11 p.m. — a rounding error. Someone at a nine-hour half-life has 108 mg, more than a full espresso, at the moment they close their eyes.

What caffeine is actually doing up there

While you’re awake, a molecule called adenosine accumulates in your brain and binds to its receptors. That accumulation is your sleep pressure — the physical signal that you’ve been up long enough. Caffeine sits in those receptors and blocks the message. It doesn’t generate energy; the adenosine keeps piling up behind the blockade the entire time.

This is the mechanism behind the Detroit study’s strangest finding. Caffeine suppresses the feeling of sleepiness while the underlying sleep debt keeps accruing and the sleep itself degrades. Your subjective read on your own sleep is being edited by the drug you’re trying to evaluate.

The trial that put real numbers on “too late”

In 2024, Gardiner and colleagues ran a double-blind, placebo-controlled crossover trial in 23 healthy men: 100 mg or 400 mg of caffeine at 12, 8, or 4 hours before bed, with polysomnography measuring the results.

The 100 mg dose did essentially nothing — no significant effect on any sleep measure, even four hours before bed. The 400 mg dose was a different story.

400 mg taken…Total sleepDeep (N3) sleepTime awake at night
4 h before bed−50.6 min−29.7 min+26.2 min
8 h before bedno sig. change−15.3 min+29.1 min
12 h before bedno sig. change−20.6 minno sig. change

Even at twelve hours — a 400 mg dose at 11 a.m. for an 11 p.m. bedtime — deep sleep was still down 20.6 minutes. The authors’ conclusion was blunt: 100 mg is fine up to four hours before bed; 400 mg should be avoided within twelve.

It aligns with the same group’s 2023 meta-analysis of 24 studies, which found caffeine cut total sleep time by 45 minutes and sleep efficiency by 7% on average — and produced the number that’s been circulating ever since: a cutoff of 8.8 hours before bed for a cup of coffee, 13.2 hours for a standard pre-workout serving, and no cutoff at all for a cup of black tea.

Your coffee is bigger than the study’s coffee

Read the fine print on that 8.8-hour figure and you find the model’s “cup of coffee” is 107 mg. That’s a small, weak cup by American standards. Real-world drinks blow past it.

Caffeine in real drinks

Pike Place, grande 16oz310 mgCold brew, 16 oz~205 mgPre-workout, scoop~218 mgMonster, 16 oz160 mgDrip coffee, 8 oz95 mgRed Bull, 8.4 oz80 mgEspresso, single63 mgBlack tea, cup25–50 mgCola, 12 oz34–46 mgDecaf coffee3–15 mg
Typical values from USDA, Mayo Clinic and manufacturer data. Brew strength varies a lot — cold brew especially.

So when do you actually stop?

Work backward from bedtime, and weight it by dose rather than by the word “coffee.” If your last drink is over 200 mg — any large coffee, energy drink or pre-workout — give it eight to nine hours. For an 11 p.m. bedtime, that’s a 2 p.m. hard stop. Under 100 mg — a single espresso or a mug of tea — four hours appears to be enough for most people.

Then adjust for yourself. There’s no cheap test for your CYP1A2 status; your behavior is the readout. Hold your dose steady, move your cutoff back by two hours, and give it two weeks. Track something external — your wake time without an alarm, how you feel at 3 p.m. — because the morning-after impression is exactly the signal caffeine is best at scrambling. The caffeine calculator runs today’s drinks against your bedtime, and the sleep calculator tells you where that bedtime should be.

Sources (8)
  1. Drake C, Roehrs T, Shambroom J, Roth T. Caffeine effects on sleep taken 0, 3, or 6 hours before going to bed. JCSM 9(11):1195–1200 (2013). https://pmc.ncbi.nlm.nih.gov/articles/PMC3805807/
  2. Gardiner C, et al. The effect of caffeine on subsequent sleep: a systematic review and meta-analysis. Sleep Medicine Reviews 69:101764 (2023). https://www.sciencedirect.com/science/article/pii/S1087079223000205
  3. Gardiner C, et al. Dose and timing effects of caffeine on subsequent sleep: a randomized clinical crossover trial. SLEEP 48(4) (2024). https://pmc.ncbi.nlm.nih.gov/articles/PMC11985402/
  4. Temple JL, et al. The Safety of Ingested Caffeine: A Comprehensive Review. Frontiers in Psychiatry 8:80 (2017). https://pmc.ncbi.nlm.nih.gov/articles/PMC5445139/
  5. Reichert CF, Deboer T, Landolt H-P. Adenosine, caffeine, and sleep–wake regulation. Journal of Sleep Research 31(4) (2022). https://onlinelibrary.wiley.com/doi/full/10.1111/jsr.13597
  6. USDA National Agricultural Library. Caffeine content of common beverages. https://www.nal.usda.gov/sites/default/files/page-files/caffeine.pdf
  7. Mayo Clinic. Caffeine content for coffee, tea, soda and more. https://www.mayoclinic.org/healthy-lifestyle/nutrition-and-healthy-eating/in-depth/caffeine/art-20049372
  8. McCusker RR, et al. Caffeine content of decaffeinated coffee. Journal of Analytical Toxicology (2006). https://pubmed.ncbi.nlm.nih.gov/17132260/