Caffeine half-life averages five hours, which means a 200mg coffee at noon still has 100mg in your system at 5 pm and 50mg at 10 pm. That residual caffeine fragments your deep sleep even when you fall asleep on time. This calculator finds the latest time to have your last cup, calibrated to your sensitivity and bedtime.
Caffeine is metabolised by the CYP1A2 enzyme in the liver. Genetic variation in CYP1A2 splits the population into roughly three bands: fast metabolisers (low sensitivity, ~3-hour half-life), normal metabolisers (~5 hours), and slow metabolisers (high sensitivity, ~7 hours). Tolerance also shifts the curve — regular drinkers metabolise faster than abstainers.
The cutoff rule is simple: stop caffeine when no more than ~25mg would remain at bedtime from a typical 200mg dose. That works out to six hours before bed for normal sensitivity, eight for high, and four for low. The result page shows three reference times — morning coffee, post-lunch latte, late afternoon pick-me-up — so you can see how each one decays through the day.
Caveats. One, this is the average; your actual half-life could be 3 to 9 hours. Two, half-life slows in pregnancy, on oral contraceptives, and with age — and speeds up if you smoke. Three, caffeine sources matter: 200mg in a slow drip coffee absorbs differently than 200mg in an energy drink. The calculator treats all sources as equivalent for simplicity.
The cutoff is the latest clock time to have your last caffeine so that the residual amount at bedtime falls below the level that disturbs sleep for your sensitivity band. High-sensitivity users get an earlier cutoff because their liver clears caffeine slowly, leaving more of it circulating at lights-out.
Two things quietly break the number: hidden sources and decaf. Tea, dark chocolate, pre-workout powders, some sodas, and a few pain relievers all carry caffeine, so count them toward the same daily total. Decaf is not caffeine-free either, at roughly 2 to 5 mg a cup, which is negligible for most people but not for the very sensitive.
In a controlled trial, Drake and colleagues gave people 400 mg of caffeine at 0, 3, or even 6 hours before bed. Caffeine taken a full 6 hours before bedtime still cut total sleep by more than an hour, and crucially, subjects often underestimated the disruption. Falling asleep is not the same as sleeping well.
The mechanism is adenosine. Adenosine builds up in the brain across the day and creates sleep pressure; caffeine blocks its receptors, masking that pressure. It also specifically suppresses slow-wave (deep) sleep, so even when you drop off on schedule the night runs lighter and less restorative than it feels.
Taper rather than quitting cold. Move your cutoff earlier by about an hour a week, and swap the afternoon cup for decaf or a herbal tea so the ritual survives while the dose drops. Abrupt withdrawal from a heavy habit brings 24 to 48 hours of headache and fog that most people blame on the wrong thing.
The real lever is total daily load plus timing, not a single rule. If you drink caffeine all day, an earlier cutoff helps but a lower overall amount helps more. Aim to keep the back half of your day light, and let this calculator set the hard stop.
Caffeine half-life ranges roughly 3 to 7 hours across the population. If you metabolise slowly (high sensitivity), the same dose lingers longer, so the cutoff has to move earlier to compensate. Normal sensitivity assumes a 5-hour half-life — the median.
Mostly yes. Decaf coffee has 2 to 15mg per cup, well under the 25mg threshold the calculator uses. Decaf tea ranges higher (10 to 30mg), and decaf espresso varies wildly between brands. If you are sensitive, treat decaf as 30mg until you know your brand.
Tolerance lowers caffeine's perceived effect on alertness, but it does not change the half-life much. Regular drinkers may metabolise slightly faster, but the residual mg at bedtime is roughly the same as a non-tolerant drinker. The sleep disruption is similar even if the alertness boost feels weaker.
If a single afternoon coffee keeps you awake at 11 pm, you are high-sensitivity. Other markers: caffeine causes jitters in others around you but you are wired hours later, or you have CYP1A2 slow-metaboliser genotype on a 23andMe result. When in doubt, start with high.
Caffeine from any source metabolises through the same pathway, so the half-life math is identical. The differences between coffee, energy drinks, and tea are in absorption rate (how fast caffeine reaches peak blood level) and in supplementary ingredients. The cutoff math at 6+ hours out is dominated by half-life, not absorption.
The 5-hour normal half-life is the most commonly cited figure across pharmacology references (e.g., Drake et al. 2013, Journal of Clinical Sleep Medicine). The 3 and 7-hour bands for low and high sensitivity are based on the standard ±2 standard-deviation range across the studied population.
Once caffeine is out of the way, dial in your bedtime.
See how the cutoff is moving the debt curve over a week.
Caffeine timing is one of 5 factors — see where else you're leaking sleep.
Why caffeine reshapes deep sleep even when you fall asleep fine.
Caffeine half-life is one cause of mid-cycle wakings.