Caffeine Calculator — How Much Is Still in You?
Caffeine clears exponentially with a half-life of roughly 5 hours: half gone at 5 hours, three-quarters gone at 10. So 200 mg of coffee caffeine is still 100 mg at the 5-hour mark and about 50 mg at 10 hours — enough, for many people, to lighten sleep if that lands at bedtime.
How it works
Caffeine does not fade linearly; it halves, and halves again. That exponential shape has two consequences people consistently get wrong. The first is optimism in the afternoon — a coffee at 3 pm still has a quarter of its strength at 1 am. The second is panic in the morning: last night's coffee really is nearly gone by wake-up, because five half-lives erase 97% of anything.
The molecule works by occupying adenosine receptors — borrowing alertness against the sleep pressure that adenosine was reporting, not removing the pressure itself. When the caffeine clears, the accumulated adenosine is still there, which is the entire mechanism of the afternoon crash. Sleep researchers commonly suggest a personal caffeine curfew 8–10 hours before bed for anyone whose sleep is fragile; the rows on this page let you test your own last coffee against your own bedtime.
Doses for reference: an espresso is about 63 mg, a mug of filter coffee 120–200 mg depending on size and strength, black tea 40–70 mg, a cola 35–45 mg, and energy drinks typically 80 mg per small can (some large cans reach 300 mg). The calculator's default 200 mg is a large coffee.
The method
Remaining caffeine = dose × 0.5^(hours ÷ 5), using the ~5-hour mean elimination half-life in healthy adults. Time below a threshold solved with log₂. Individual half-life ranges from about 3 to 11+ hours with genetics, smoking, medication and pregnancy.
Frequently asked questions
How long does caffeine actually stay in your system?
Detectable traces persist well past the useful effect — with a 5-hour half-life, 200 mg is ~6 mg after 25 hours. The practically relevant window is the first 10–12 hours, where the amounts are large enough to affect alertness and sleep.
Why does coffee stop working for me by afternoon but keep me awake at night?
Tolerance builds to the alerting effect faster than to the sleep-disrupting effect. Studies find sleep measurably shortened and lightened by caffeine taken even 6 hours before bed, in people who report feeling nothing from it.
Does a nap clear caffeine?
No — only time and liver enzymes do. (A short nap right after coffee — the 'coffee nap' — works because you wake as the caffeine arrives, not because the nap removed it.)