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).

β€”from cup to bed
β€”caffeine still active at bedtime
β€”still active at 6 am next day
β€”latest cup to be under 50 mg at bed
β€”verdict
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.
Half-lives are population medians, not your metabolism. If caffeine wrecks your sleep at any hour, your personal half-life is longer than the chart. Not medical advice.

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.