DevTools Logo

Caffeine Half-Life Calculator

Caffeine Half-Life Calculator

Log your drinks and see when caffeine drops below your sleep-safe threshold.

Runs in your browser
Try an example

Drink log

0 drinks · 0 mg logged

Typical caffeine half-life is about 5–6 h; individual range is wider. The chart shades ±1 h around your choice.

Typical mg per serving: USDA FoodData Central / FDA guidance; check product labels. Educational simulation — individual metabolism varies; not medical advice.

Caffeine curve

5.5 h half-life · 50 mg threshold
Working…

Threshold is an adjustable rule of thumb, not a clinical limit. Decay is never exactly zero; +/-1 h band is illustrative, not a full population range.

Examples

Office day

Two 95 mg coffees and a 63 mg espresso are logged at their actual times; the curve shows the combined load and the sleep-safe cutoff.

Exam night

Two energy drinks in the evening and a later espresso: extend the horizon to 48 h to see the next day's remaining caffeine.

Half-life sensitivity

Move the half-life slider between 2 and 8 h; the shaded band shows one hour faster and slower than your choice.

Zero threshold

Set the threshold to 0 mg to see why exponential decay never reaches exactly zero — there is no finite crossing.

About this tool

Log drinks with a date, time and dose; the tool superposes each one's exponential decay (half-life 5.5 h by default, adjustable 2–8 h) to show how much caffeine is on board now, at bedtime and at a future time. It solves when you drop below a sleep-safe threshold (50 mg by default), sketches a ±1 h half-life band, and notes totals above the FDA's 400 mg/day guidance. Typical mg values come from USDA/FDA serving averages. Educational simulation — not medical advice.

Everything runs locally in your browser with no server uploads or account required. Results are informational population-average estimates only and are not medical advice, diagnosis, or clinical guidance.

What this tool does not do

  • Results are informational population-average estimates only and are not medical advice, diagnosis, or clinical guidance.
  • Runs entirely in the current browser tab; nothing is synced across devices or backed up to a server.

How to use this tool

  1. Log drinks and timestamps

    Add coffees, teas, or energy drinks with serving mg and time consumed.

  2. Tune half-life and sleep cutoff

    Adjust your personal half-life (2–8 h) and bedtime mg threshold.

  3. Check your sleep-safe time

    Inspect remaining caffeine now, at bedtime, and where the decay curve crosses your cutoff.

Use cases

Office day

Two 95 mg coffees and a 63 mg espresso are logged at their actual times; the curve shows the combined load and the sleep-safe cutoff.

Exam night

Two energy drinks in the evening and a later espresso: extend the horizon to 48 h to see the next day's remaining caffeine.

Half-life sensitivity

Move the half-life slider between 2 and 8 h; the shaded band shows one hour faster and slower than your choice.

Zero threshold

Set the threshold to 0 mg to see why exponential decay never reaches exactly zero — there is no finite crossing.

Common mistakes

Mistake:How does the calculator combine multiple drinks across the day?

Fix:Each logged beverage decays exponentially from its own timestamp, and the curve sums all active doses at every minute to find when your total falls below your chosen sleep-safe threshold (50 mg by default).

Mistake:Why does zero-milligram threshold show 'never'?

Fix:Pure exponential decay approaches zero asymptotically without reaching exact mathematical zero, so practical cutoffs like 25 mg or 50 mg are used for bedtime planning.

Frequently asked questions

What is caffeine's typical half-life in adults?

Population averages center around 5 to 5.5 hours, meaning half of a 100 mg coffee remains after ~5.5 hours, though genetics, pregnancy, smoking, and medications shift half-life roughly between 2 and 8+ hours.

How does the calculator combine multiple drinks across the day?

Each logged beverage decays exponentially from its own timestamp, and the curve sums all active doses at every minute to find when your total falls below your chosen sleep-safe threshold (50 mg by default).

Why does zero-milligram threshold show 'never'?

Pure exponential decay approaches zero asymptotically without reaching exact mathematical zero, so practical cutoffs like 25 mg or 50 mg are used for bedtime planning.

Is this medical or clinical sleep advice?

No. Serving sizes and decay curves are educational estimates based on USDA/FDA reference figures (including the FDA's 400 mg/day healthy-adult benchmark), not medical advice.