Caffeine Half-Life Calculator
How much caffeine is in your system at bedtime — and when you should stop drinking it.
FDA daily limit: 400 mg.
Add your drink
— mg (At bedtime)
—
Additional options
Show hour by hour until bedtime
| Time | Remaining |
|---|
Common drinks reference
| Drink | Typical mg | Notes |
|---|
History of caffeine
Coffee traces back to 9th-century Ethiopia and the Coffea arabica plant. Legend has a goatherd named Kaldi noticing his goats unusually energetic after eating the red berries. Yemeni Sufis picked it up in the 15th century to stay awake during prayer; it reached Europe via Venice in the early 1600s.
In the body, caffeine works by impersonation. It looks structurally similar to adenosine — the molecule that builds up across waking hours and signals you're tired. Caffeine slots into adenosine receptors without activating them, so the "sleepy" signal gets blocked. The adenosine keeps accumulating — when caffeine wears off, you feel the full backlog.
People respond differently because the liver enzyme CYP1A2 breaks caffeine down. Genetic variants make some fast metabolizers (~3h half-life), others slow (~8-10h). Pregnancy roughly triples the half-life; smoking nearly halves it.
How this works
Target 0 mg at bedtime
Sleep researchers including Matthew Walker recommend zero caffeine at bedtime. The often-cited 50 mg "safe" threshold is actually where EEG studies start showing measurable sleep disruption — not a green light. Even small amounts push you out of the deepest restorative sleep stages.
Tolerance doesn't protect your sleep
High-tolerance coffee drinkers often feel fine drinking caffeine in the late afternoon. EEG scans tell a different story: their deep sleep is still reduced, they just don't notice it. Tolerance dulls the feel of caffeine, not its impact on sleep.
Stop caffeine 10+ hours before bed
With a 5-hour half-life, 200 mg at 2 pm leaves ~50 mg at 8 pm and ~25 mg by 2 am — well into your sleep window. Slow metabolizers should stop even earlier. Your safe cutoff depends on dose, metabolism, and bedtime — that's what this calculator computes in real time.
Caffeine clears via first-order pharmacokinetics: half remains after each half-life. Remaining = dose × 0.5(hours/half-life), summed.
Sources
- Drake et al. (2013). Caffeine effects on sleep. J Clin Sleep Med.
- Walker, M. (2017). Why We Sleep.
- Yang, Palmer, de Wit (2010). Genetics of caffeine consumption. Psychopharmacology.
Educational only. Not medical advice. Consult a clinician.