Skip to main content
Tool / Sleep

Caffeine Half-Life Calculator.

Plot your bloodstream caffeine decay curve across the day and find the exact time you need to stop drinking coffee to protect your sleep.

Metabolism

When you plan to fall asleep

Caffeine Intake

Every drink in the 24 hours before bedtime

mg
mg
Result
Caffeine at bedtime
38mg
Threshold for undisturbed sleep: ≤ 50 mg
Defaults to today. Change it if the test was on another day.
05010015020050 mg thresholdBedtime−14h−12h−10h−8h−6h−4h−2hbedhours from bedtime
Total Today
190 mg
Adult guide 400 mg
Peak
152 mg
at 12:00 PM
Half-Life
5.5 hours
Drops Below 50 mg
8:51 PM
2.2h before bedtime

Medical Disclaimer

This calculator uses population-average pharmacokinetic constants. Individual clearance varies with liver function, medication, pregnancy stage, and oral contraceptive use. For clinical guidance, consult a physician.

How the Math Works

Caffeine clearance follows first-order elimination: the body removes a fixed fraction of whatever is in the bloodstream each unit of time. Half the dose disappears every half-life.

  1. 01Decay constant. k = ln(2) / half-life. For an average metabolizer (t½ = 5.5h), k ≈ 0.126 per hour.
  2. 02Single dose decay. C(t) = D × exp(-k × Δt). A 100 mg dose 11 hours later is 100 × exp(-0.126 × 11) ≈ 25 mg.
  3. 03Superposition. For multiple doses, total caffeine is the sum of each individual decay curve. Every drink is placed in the 24 hours that end at your bedtime, so a drink later on the clock than bedtime counts as the evening before: coffee at 3:00 AM before bed at 8:00 AM is five hours before sleep.
  4. 04Bedtime threshold. The 50 mg horizontal line marks the published level above which slow-wave sleep is measurably suppressed.
  5. 05Cutoff time. Solving C(t) = 50 backward from bedtime gives the latest time you can have caffeine without exceeding the threshold.

Frequently Asked Questions

What is the half-life of caffeine?+

In healthy adults the average caffeine half-life is about 5–6 hours, but the population range is roughly 1.5 to 9.5 hours. Genetic variation in the CYP1A2 enzyme, smoking, pregnancy, oral contraceptives, and certain medications all shift the value, which is why this calculator lets you pick a metabolizer profile rather than assuming the population average.

How do I calculate caffeine half-life?+

The model: C(t) = D × exp(−k × Δt), where C(t) is bloodstream caffeine at time t, D is the dose, and k = ln(2) ÷ half-life. For multiple doses, you sum each curve (superposition). To find the cutoff for sleep, solve C(t) ≤ 50 mg working back from bedtime. This calculator does that solve for you.

Does pregnancy or smoking change caffeine half-life?+

Yes, both substantially. Pregnancy (especially third trimester) roughly doubles caffeine half-life to ~11 hours because hepatic CYP1A2 activity drops. Smoking does the opposite: it induces CYP1A2 and roughly halves the half-life to ~2.5 hours. Quitting smoking unmasks the slower clearance within a few days, which is why ex-smokers often suddenly find their old afternoon coffee disrupts sleep. Separately from the half-life, ACOG and EFSA advise keeping caffeine under 200 mg a day during pregnancy; with the Pregnant profile the calculator flags a day above that.

How long does caffeine stay in your body?+

Caffeine has an average half-life of about 5.5 hours in healthy adults, meaning half the dose is cleared every 5.5 hours. A standard 200 mg dose drops to ~100 mg 5.5 hours after you drink it, ~50 mg after 11 hours, and ~25 mg after 16.5 hours, so a large coffee at midday can still be near 50 mg at a late-evening bedtime.

Why does the calculator support five metabolizer types?+

The CYP1A2 enzyme drives ~95% of caffeine breakdown, and genetic variants change its activity. Pregnancy roughly doubles the half-life (ACOG guidance), while smoking induces CYP1A2 and shortens the half-life to ~2.5 hours.

What is the 50 mg bedtime threshold based on?+

Sleep research shows that doses as low as 20–50 mg in the bloodstream near bedtime can suppress slow-wave (deep) sleep and increase sleep onset latency. The 50 mg line is a conservative cut-off; sensitive sleepers may need an even lower target.

What math does the calculator use?+

It applies first-order elimination kinetics: C(t) = D × exp(-k × Δt), where k = ln(2) / half-life. Multiple doses are summed via the superposition principle: each dose decays on its own curve, and total bloodstream caffeine is the sum at any given time.

How accurate is the prediction?+

The model is a population-level estimate. Real-world clearance varies with liver function, oral contraceptives, certain medications, and food. Treat the curve as a planning guide, not a precise blood measurement.

How can I avoid caffeine ruining sleep?+

Work backwards from bedtime. At the average 5.5-hour half-life, a 200 mg coffee takes about 11 hours (two half-lives) to fall to the 50 mg threshold, so finish it about 11 hours before bed; a 95 mg cup of drip coffee needs about 5 hours. Slow metabolizers need longer and fast metabolizers less. The calculator finds your personal cutoff from every drink you log.

Does caffeine half-life change with age?+

In healthy adults, age on its own has only a modest effect: caffeine half-life rises slightly in older adults as liver CYP1A2 activity gradually declines, but it stays within the usual 4–7 hour band for most people. The dramatic differences are at the extremes of life: newborns clear caffeine extremely slowly (half-life can exceed 70–100 hours because CYP1A2 is immature), and clearance reaches adult levels by roughly 6–12 months. The bigger drivers in adults are genetics (CYP1A2 variant), smoking, pregnancy, and oral contraceptives, which is why this tool asks for a metabolizer profile rather than your age.

The ScienceBy Aayush Gupta

How caffeine actually leaves your body.

Caffeine is cleared by first-order elimination kinetics: the amount removed in any given hour is a fixed fraction of what is still circulating. The hepatic enzyme CYP1A2 does the bulk of the work, breaking caffeine down into paraxanthine, theobromine, and theophylline. The half-life (the time for blood caffeine to drop by 50%) averages around 5 hours in healthy adults but ranges from under 3 hours to over 9.

This calculator applies first-order decay and superposition across multiple doses: C(t) = D × exp(−k × Δt) where k = ln(2) / half-life. Stacking doses is additive on the curve, which is why a 200 mg afternoon coffee on top of morning leftovers can land you at bedtime with more circulating caffeine than the afternoon dose alone implies.

Why your half-life is not five hours.

CYP1A2 activity varies ten-fold across the population. The single nucleotide polymorphism rs762551 (CYP1A2 *1F) splits adults into "fast" and "slow" metabolizers. Cornelis et al. (2006) showed that slow metabolizers carry meaningfully higher cardiovascular risk from heavy caffeine intake. Smoking induces CYP1A2 and roughly halves the half-life (to ~2.5h); pregnancy in the third trimester roughly doubles it (to ~11.5h).

Oral contraceptives, certain SSRIs, ciprofloxacin, and grapefruit also inhibit CYP1A2 and extend caffeine half-life by 50–100%. If you take any of these and your sleep is fragmented, your effective caffeine cutoff is much earlier than the population average suggests.

The bedtime threshold that actually matters.

The most direct evidence comes from Drake et al. (2013): 400 mg of caffeine at bedtime, 3 hours before bed, or 6 hours before bed all measurably degraded sleep quality vs placebo, including the 6-hour-before condition. The pragmatic threshold most sleep researchers use is to keep blood caffeine under ~50 mg at bedtime. For an average metabolizer (half-life about 5.5 hours) a 200 mg coffee takes two half-lives, about 11 hours, to fall that far, so it needs to be finished about 11 hours before lights-out.

That gap scales with your metabolizer type. A slow metabolizer (half-life about 8 hours) needs about 16 hours after a 200 mg coffee, which for most people who sleep eight hours means first thing after waking or not at all. Fast metabolizers (about 3 hours) need about 6 hours and can sometimes drink coffee six hours before bed without sleep effects, but ask whether your sleep would be better if you did not.

Go Further
The Cortisol ProtocolFree

Caffeine timing is one lever on cortisol. The protocol pairs the cutoff with light, breathwork, and sleep architecture.

Get it free →

← All Tools · Sleep

For education, not medical advice. Results are estimates, not a diagnosis. Discuss any abnormal value or health concern with a qualified clinician.

Free / PDF Guide

50 High-Protein Snacks. Free.

Drop your email. We'll send the PDF straight to your downloads and add you to the weekly research drop. Unsubscribe anytime.

See what's inside →

Your email joins the list and is never sold or shared. Privacy policy

← All Tools