Caffeine Calculator
Caffeine has a half-life of about 5 hours. Enter a drink, when you had it and your bedtime to see how much is still active at night, and your ideal cutoff time.
Caffeine can dull deep sleep even when you fall asleep fine. Earlier is safer.
How caffeine clears
Caffeine follows first-order decay with a half-life around 5 hours, so half is gone every 5 hours:
Remaining = dose x 0.5 ^ (hours / half-life)
Last call = half-life x log2(dose / 25) hours before bed
Under about 25 mg at bedtime is unlikely to disturb sleep for most people. Individual half-life varies widely (roughly 1.5 to 9.5 hours).
Source: pharmacokinetics of caffeine; general sleep guidance.
Frequently asked questions
How long does caffeine stay in your system?
Caffeine has a half-life around 5 hours, so about half is gone after 5 hours and a quarter after 10. It varies a lot by person, from roughly 1.5 to 9.5 hours.
When should I stop drinking caffeine?
This tool estimates the latest time to have your last dose so under 25 mg remains at bedtime. A common rule of thumb is no caffeine after early afternoon.
Why does caffeine hurt sleep even if I fall asleep fine?
Caffeine can reduce deep sleep quality even when you drop off, leaving you less rested. Cutting off earlier helps.
How much caffeine is in my drink?
It varies, but rough averages are: espresso 63 mg, brewed coffee 95 mg per 8 oz, energy drinks around 160 mg, and teas 28 to 47 mg. Pick the closest match.
Medical disclaimer: This calculator is for general information and education only. It is an estimate, not medical advice, diagnosis or treatment. Always talk to your doctor or midwife about your health and any decisions.
