Calculate the latest time you should drink your last caffeinated beverage based on your target bedtime, your caffeine sensitivity, and the dose. Built on a pharmacokinetic decay model with Drake 2013 sleep-disruption evidence as the threshold. Math, not medical advice.
Inputs
When you want to fall asleep.
8 oz coffee ≈ 95 mg; 16 oz cold brew ≈ 200 mg; energy drink ≈ 80-300 mg; espresso shot ≈ 65 mg.
Recommended cutoff time
—
—
Predicted caffeine remaining at bedtime, by last-cup time:
How the math works
Caffeine clears the body via first-order pharmacokinetics: in each half-life, the remaining amount drops by 50%. The formula is remaining = dose × (0.5)^(hours_elapsed / half_life).
The cutoff target used here is when blood caffeine drops to ≤ 50 mg at bedtime — roughly equivalent to a half-cup of coffee. Drake et al. 2013 (PMID 24235903) showed that caffeine doses given 6 hours before bed reduced total sleep time by 40+ minutes; 50 mg is the practical “low enough to not disrupt sleep architecture” threshold.
For a 200 mg dose at average sensitivity (5h half-life), reaching 50 mg requires ~10 hours of decay (two half-lives). So if you want to be in bed at 22:30, your cutoff is 12:30 PM — earlier than most people realize.
Why “stop drinking 6 hours before bed” can still be too late
- Higher doses extend the cutoff: a 300 mg dose at average sensitivity needs ~13 hours to drop below 50 mg.
- Slow metabolizers (~50% of adults): oral contraceptives, pregnancy, certain CYP1A2 variants, and some medications (cimetidine, some antibiotics) extend half-life to 7-10 hours. The “stop by 2 PM for an 11 PM bedtime” rule does not apply.
- Sleep onset is the most sensitive metric: even 50-100 mg at bedtime can fragment deep sleep architecture even if you fall asleep without subjective trouble.
- Tolerance is partial: regular caffeine consumers feel less subjective stimulation but the sleep-disrupting effect is mostly preserved.