Caffeine Half-Life Calculator
Caffeine has a half-life of about 5.7 hours, so a 200 mg filter coffee at 8am is still leaving roughly 47 mg in your blood at eight in the evening. Add what you drank and when, and this draws the whole curve, stacked drinks included, with the time it falls below 50 mg and 20 mg.
Caffeine Levels Over Time
Half-life used: ~5.7 hours (average adult). Actual half-life varies by genetics, age, liver function and medications. Smoking speeds clearance up; pregnancy and oral contraceptives slow it down, in some cases by a lot.
How the caffeine curve is calculated
One equation, applied per drink and then added up: the caffeine left from a dose is the dose multiplied by 0.5 raised to the power of the hours elapsed divided by the half-life. The half-life used here is 5.7 hours. So 200 mg — a filter coffee and a bit — taken at 8am is down to about 100 mg by two in the afternoon, about 47 mg by eight in the evening and about 22 mg by two in the morning, and the graph is that curve for every drink summed at each point in the day — which is the reason stacking three drinks keeps the level up far longer than any one of them would.
The two times the tool reports are found by walking forward from your last drink in one-minute steps until the total falls to or below a threshold: 20 mg for "clear" and 50 mg for the suggested bedtime. Those two thresholds are ours. There is no published cut-off for how little caffeine still affects sleep, the effect is dose-dependent and varies hugely between people, and a bedtime warning fires when more than 50 mg is still on board because that is roughly a cup of tea's worth — a figure we chose as a reasonable line, not one anybody publishes.
The half-life is the other figure to hold loosely. Around five to six hours is the range usually quoted for a healthy adult, and individual clearance varies by a factor of several depending on genetics, liver enzymes, smoking, pregnancy and oral contraceptives. Using 5.7 hours for everyone is a simplification, and if caffeine reliably keeps you up longer than this curve suggests, your own half-life is probably the reason rather than the arithmetic. The preset drink strengths — 63 mg for an espresso, 95 for filter coffee, 150 for an Americano, 160 for an energy drink, 40 for tea — are typical figures, not measurements of what you are holding.
The two sleep findings quoted in the questions are cited below: the 2013 trial that gave 400 mg six hours before bed and still found disturbed sleep, and the 2023 meta-analysis that put a cup of coffee at 8.8 hours before bedtime. The review on individual differences in caffeine metabolism is the source for the note that smoking, pregnancy and oral contraceptives change the half-life; the page gives no figures for those because the review's are ranges, not a number per person.
Where these numbers come from
- 1. Caffeine effects on sleep taken 0, 3, or 6 hours before going to bed — Drake C, Roehrs T, Shambroom J, Roth T, Journal of Clinical Sleep Medicine 9(11):1195–1200, 2013 (PMC)
- 2. The effect of caffeine on subsequent sleep: A systematic review and meta-analysis — Gardiner C et al., Sleep Medicine Reviews 69:101764, 2023 (PubMed)
- 3. Interindividual Differences in Caffeine Metabolism and Factors Driving Caffeine Consumption — Nehlig A, Pharmacological Reviews 70(2):384–411, 2018 (PubMed)
Nothing on this site is medically reviewed. Every figure above was read out of the code that runs on this page, and where a number is our own judgement rather than a published one, the note says so and cites nothing. Method last checked 25 September 2026.
Why the afternoon coffee is still with you at midnight
Caffeine is probably the world's most widely used psychoactive drug, and most people have no idea how long it actually stays in their system. That 3pm "pick-me-up" coffee? Roughly half of it is still circulating in your blood at 9pm.
The half-life model is simple but powerful. Caffeine follows predictable exponential decay in the body. With a half-life of approximately 5.7 hours, a 200mg dose (a filter coffee and a bit) at 8am leaves about 96mg at 2pm, 47mg at 8pm, and 22mg at 2am. That last 22mg is about half a cup of tea; whether it matters depends on how sensitive you are, and the research on small residual doses is thin.
What makes this calculator useful is stacking. Most people don't drink just one coffee. A morning espresso at 7am plus a latte at 11am plus an afternoon pick-me-up at 3pm creates overlapping decay curves that keep caffeine levels elevated much longer than any single drink would.
The visual graph in this tool shows your real caffeine level throughout the day based on exactly what you consumed and when. If the curve is still high at your bedtime, that is one plausible reason for poor sleep, and the easiest one to test.
Frequently Asked Questions
What is the half-life of caffeine?
How much caffeine is in common drinks?
When should I stop drinking coffee before bed?
How does caffeine affect sleep?
More tools
Sleep Debt Calculator
Calculate your sleep debt based on this week's sleep vs your target. See your cognitive deficit and how long to recover.
Burnout Risk Assessment
A free 10-question burnout quiz across exhaustion, cynicism, efficacy, physical symptoms and recovery. Score out of 50 in 2 minutes, no signup.
Daily Journal Prompts
Get a unique journaling prompt every day. Categories include gratitude, self-reflection, goals, mindfulness, and recovery. Free, no signup required.
Track sleep quality streaks in Dailies
Build better sleep habits by tracking your sleep quality daily and maintaining your streak with Dailies.