Enter what you drank today — see the caffeine curve, what's left at bedtime and the latest safe cup.
Caffeine is metabolized exponentially. Its half-life is the time after which half of a dose remains active. For most adults it's between 4–6 hours — shorter for smokers, much longer during pregnancy or while on the contraceptive pill. Concretely: drinking 100 mg at 3 pm leaves ~50 mg in your body at 8 pm, ~25 mg at 1 am.
Rule of thumb: no caffeine 6–8 hours before bed. A more precise approach uses the half-life: if your threshold is ~100 mg and you drink 200 mg, you need one half-life to get below — i.e., 5 hours before bed at a 5h half-life. For 400 mg you need two half-lives = 10 hours.
About 95% of caffeine is metabolized in the liver by the enzyme CYP1A2. The average half-life in healthy adults is around 5 hours per pharmacokinetic studies (e.g. Arnaud 2011, Handbook of Experimental Pharmacology) — with an enormous individual range of 1.5 to over 9.5 hours. That means two people drinking the same cup of coffee can have very different plasma levels eight hours later. Half-life means: after that interval, exactly half of the original active substance is still in plasma.
Individual half-life depends on genetics (CYP1A2 polymorphism), lifestyle and medication. Smokers metabolize caffeine roughly twice as fast as non-smokers; women on oral contraceptives need around twice as long. During pregnancy the half-life rises in the third trimester to up to 15 hours — the reason EFSA recommends a maximum of 200 mg caffeine per day for pregnant women. Certain drugs such as ciprofloxacin or fluvoxamine massively inhibit caffeine breakdown as well.
For sleep it matters that caffeine binds to adenosine receptors in the brain and blocks the tiredness signal. A widely cited study by Drake et al. 2013 in the Journal of Clinical Sleep Medicine showed: 400 mg of caffeine taken six hours before bedtime cut total sleep time by more than an hour — even when participants thought they slept fine. Deep-sleep proportions dropped measurably. This calculator helps you keep residual caffeine at bedtime below a self-chosen threshold.
Within the physiologically relevant range, caffeine follows first-order kinetics: the residual amount halves with every half-life. From the general exponential decay equation we can also derive how many hours before bedtime your last dose must fall so that only a chosen residual amount remains in plasma at bedtime.
C(t) = C0 * 0.5^(t / t_half)
t_half = individual half-life (3 - 8 h, median ~5 h)
C0 = initial dose in mg
t = hours since intake
Latest safe intake (single dose) for sleep:
hours_before_bed = t_half * log2(C0 / threshold)
Five realistic scenarios with a 5-hour half-life:
The model assumes instantaneous absorption, which is a slight simplification: filter coffee peaks in plasma after 30 - 60 minutes, faster after gastric bypass, slower after heavy meals. Individual half-life also varies a lot — adjust the slider to your own experience: 3 - 4 h for smokers and fast metabolizers, 5 h baseline, 6 - 8 h for women on oral contraceptives, pregnant women and slow metabolizers. For cardiac arrhythmias, anxiety disorders, pregnancy or children, additional limits apply that are not represented here. This page is informational and not a substitute for medical advice. EFSA recommends no more than 400 mg caffeine per day for healthy adults and not more than 200 mg in a single dose (EFSA Journal 2015;13(5):4102).