Free tool · Sleep

Caffeine Half-Life Calculator

See how much caffeine is left in your body at bedtime and find your sleep-safe cutoff, using the 5.7-hour half-life decay model. Free, no signup.

What did you drink?
Caffeine left at bedtime
36 mg
From 95 mg, 8 h before bed
Sleep-safe cutoff

You drop below 50 mg at about 8:17 PMbefore your target bedtime. Looks clear.

Hour-by-hour decay
3:00 PM
95 mg
4:00 PM
84 mg
5:00 PM
74 mg
6:00 PM
66 mg
7:00 PM
58 mg
8:00 PM
52 mg
9:00 PM
46 mg
10:00 PM
41 mg
11:00 PM
36 mg
Press Esc to reset

How the caffeine half-life model works

Caffeine is cleared from the body by first-order (exponential) elimination: a roughly constant fraction is removed per unit of time, not a fixed amount. That fraction is captured by the half-life — the time for the amount in your bloodstream to halve. Using a central estimate of 5.7 hours, the remaining caffeine after t hours is:

remaining(t) = dose × 0.5^(t / 5.7)

So a 95 mg coffee falls to ~48 mg after 5.7 hours, ~24 mg after 11.4 hours, and ~12 mg after ~17 hours. The "sleep-safe cutoff" above solves that equation for the moment your level drops below about 50 mg — t = 5.7 × log₂(dose ÷ 50) — a level most people tolerate without it nudging their sleep onset. The half-life of 5.7 hours is an average; individual clearance varies widely with genetics, pregnancy, smoking, and medication, so treat the numbers as a planning guide rather than a precise blood reading.

Why afternoon coffee follows you to bed

A controlled study published in the Journal of Clinical Sleep Medicine found that caffeine consumed even 6 hours before bedtime significantly reduced total sleep time. Because elimination is exponential, the dose that feels "worn off" by evening can still be leaving 30–50 mg circulating at lights-out — enough to delay deep sleep. Seeing the curve makes the trade-off concrete: a 3 p.m. coffee and an 11 p.m. bedtime leaves a meaningful residue, while shifting that cup two hours earlier can drop you under the threshold in time.

Turn your cutoff into a daily habit

Knowing your sleep-safe cutoff time is only useful if you actually stop by it. The simplest fix is a recurring rule: "no caffeine after X." You can track that as a daily yes/no habit in HabitBox — a free, ad-free habit tracker that lives on your home screen. Log a one-tap check-in each evening, watch the streak build, and let the cue do the work. It runs fully on-device (no account needed) on iOS and Android. Pair it with a wind-down routine like the self-care morning routine to bookend your day.

Note: this tool is an educational estimate for healthy adults and is not medical advice. If caffeine, sleep, or a health condition is a concern, talk to a clinician.

Frequently asked questions

How long does caffeine stay in your system?+

Caffeine has an average half-life of about 5 to 6 hours in healthy adults, meaning roughly half of a dose is cleared every ~5.7 hours. After one half-life a 95 mg coffee leaves ~48 mg; after two (~11 hours) about 24 mg. It can take a full day to clear almost completely, and clearance is slower during pregnancy or with certain medications.

What is the half-life of caffeine?+

A half-life is the time it takes for half of a substance to be eliminated. For caffeine the commonly cited average is about 5.7 hours, though it ranges from roughly 1.5 to 9.5 hours between individuals depending on genetics (CYP1A2 activity), smoking, oral contraceptives, and liver function.

How late is too late for coffee before bed?+

Research suggests caffeine taken even 6 hours before bed can measurably reduce sleep. This calculator flags a 'sleep-safe cutoff' — the time your level drops below about 50 mg — so you can see how early you'd need your last cup. For an afternoon coffee, a cutoff of roughly 8 to 10 hours before bed is a common safe margin.

Why 5.7 hours and not a fixed number?+

5.7 hours is a central estimate from pharmacokinetic studies, but your personal half-life can be much shorter or longer. Fast metabolizers may clear caffeine in 3 to 4 hours; slow metabolizers, pregnant people, and those on certain drugs can take 9+ hours. Treat the result as a guide, not a medical reading.

Does the type of drink change the result?+

The half-life is the same regardless of source — what changes is the starting dose. A brewed coffee (~95 mg) starts higher than black tea (~47 mg) or cola (~40 mg), so it takes longer to fall below the sleep-safe threshold. Pick your drink above and the curve recalculates instantly.

Make 'no coffee after 2 PM' stick

Knowing your sleep-safe cutoff is step one. Holding to it every day is what changes how you sleep. HabitBox lets you track a one-tap daily habit, watch your streak grow, and keep all data on your device — free, no account.

Free · Local-only data · No account required

Related reading

More free tools