Coffee-to-Sleep Calculator
Enter your last cup and bedtime, see how much caffeine is still active when you're lying awake doing math.
Caffeine halves every half-life; sleep impact starts around 50 mg of circulating caffeine for most sensitive sleepers. Standard: β€400 mg/day (pregnancy: 200 mg).
How the math works
Exponential decay: active = mg Γ 2^(βhours / halfLife). Elapsed time crosses midnight if bedtime is earlier on the clock than the cup time.
- Half-life 5 h is the pooled clinical median for healthy adults (range 2β10 h). Smoking roughly halves it; pregnancy and oral contraceptives roughly double it; liver disease stretches it further. Genetic CYP1A2 metabolizers span 4β9Γ.
- "Latest cup" solves
mg Γ 2^(βh/hl) = 50βh = hl Γ log2(mg/50). A 150 mg cup at 5 h half-life: 5 Γ log2(3) β 7.9 h before bed. - Even 50 mg at bedtime measurably reduces deep sleep in controlled studies, caffeine's sleep effect is bigger than its "falling asleep" effect: it cuts slow-wave sleep even when you doze off fine.
Frequently asked
How many hours should you stop drinking coffee before bed?
For average metabolism and a normal cup, 8β10 hours. The tool's "latest cup" line computes it for your exact cup size and sensitivity.
How much caffeine is left at bedtime after a 3 pm coffee?
At a 5-hour half-life and a 190 mg cup, an 11 pm bedtime has roughly 67 mg active, enough to shave deep sleep in sensitive people.
How long until caffeine is fully out of your system?
About 95% cleared after 4.3 half-lives: ~21 h for the average adult, meaning an afternoon cup is still ~10% active at breakfast.