☕😴 Coffee-to-Sleep Tradeoff

A gentle calculator that estimates how your caffeine timing and dose might nudge tonight’s sleep. Private by design—everything runs in your browser.

Your Inputs

Typical: espresso ~60–75 mg, brewed coffee ~80–150 mg, tea ~20–60 mg.
Local time today.
~5.0 h (adjust if you metabolize faster/slower)
How strongly caffeine affects your sleep.
You can add several cups; we’ll combine them.
Kind rule: information, not judgment.

Results

Residual caffeine at bedtime
Estimated bedtime delay
Estimated sleep affected
Assumes simple half-life decay and your selected sensitivity. Not medical advice.
Tip: If delay feels high, try moving the last caffeinated drink earlier, choosing a smaller dose, or switching to decaf after lunch.

How the calculator estimates sleep impact (friendly science)

Caffeine doesn’t turn off instantly—it fades gradually. A common way to describe that fade is a half-life: the time it takes for the active amount to drop by half. For many adults, a reasonable default is around five hours, though three to seven hours is still common depending on genetics, liver enzyme activity, medications, and timing. This tool lets you adjust the half-life so the results feel closer to your experience.

The math is gentle. For each drink, we estimate the fraction remaining at bedtime using simple exponential decay: remaining = dose × 0.5^(hours_until_bed / half_life). If you add multiple drinks, we sum the remaining amounts. That total becomes your residual caffeine at bedtime. From there, we translate the residual into a bedtime delay and a rough sleep-lost estimate using a smooth curve that scales with sensitivity. Think of it as a friendly yardstick: more residual caffeine tends to push bedtime later and can reduce total sleep time, especially if your schedule is fixed.

Sensitivity matters a lot. Some people can sip an evening espresso and drift off. Others feel wired after a small tea. That’s why we include three presets—Low, Typical, and High—that change how strongly a given residual amount translates to delay and sleep loss. No judgment, just sliders. If your real-world experience differs (e.g., you’re unusually sensitive or very tolerant), set the sensitivity to match your reality and treat the numbers as guidance, not rules.

Finally, a kindness note: your sleep is influenced by many things—light exposure, stress, meals, exercise, temperature, and more. This calculator focuses only on caffeine timing and dose to offer a quick, private “what if?” view. Use it to nudge choices (earlier last cup, smaller dose, or decaf after lunch) and to build your own intuition. It’s not medical advice, and it doesn’t diagnose or treat sleep disorders. If you have concerns about sleep, consider speaking with a qualified professional.

Privacy & accessibility: everything runs locally in your browser; inputs aren’t uploaded. Results are announced via ARIA live regions for assistive tech.

Explore more tools