Caffeine Half-Life Calculator

Dose, hours before sleep, personal half-life and sensitivity threshold: residue in mg, percentage still active, hours to threshold and sleep margin. Exponential decay, without alarmism.

Calculation parameters
Was this calculator useful?

Caffeine and sleep: a count made in hours, not cups

This calculator does not tell you whether coffee is good or bad for you: it tells you how much caffeine is still circulating at the moment you go to bed — which is the only question sleep actually asks. Four levers: the dose of the last intake in milligrams (the espresso, the filter cup, the can), the hours between that dose and bed, the personal half-life — the time your liver takes to halve the dose, which varies enormously between people — and the sensitivity threshold: the residue below which, for you, the dose is silent. Out come four numbers: the residue in milligrams, the percentage still active, the hours needed to fall below threshold and the sleep margin — the first exponential decay of this catalog, and the mirror twin of compound interest: there time multiplies, here it halves.

The formula: the halving that never ends

The core is first-order decay, the same as medicines: R = D · (1/2)^(t/h) — every half-life halves the residue, and it never reaches exactly zero. The percentage still active is p = 100 · (1/2)^(t/h) and has an elegant property: it does not depend on the dose — only on the clock and the metabolism. The hours to threshold are the smallest integer k at which the residue falls below S, and the margin is the difference m = t − k: positive if the threshold arrives before bed, negative if after — and it is the sign of that number, not the residue itself, that decides the page's verdict.

The dose scale: the percentage that does not move

Eight hours before bed, a 5-hour half-life, threshold at 30 mg; only the dose changes:

Dose (mg)Residue (mg)Still activeHours to thresholdMargin
40 — the single espresso13.233.0%3+5
80 — the medium cup26.433.0%80
120 — the large cup39.633.0%10−2
160 — the double filter52.833.0%13−5
200 — the field's limit66.033.0%14−6

The percentage column is immobile: 33.0 percent from the espresso to the field's limit — decay does not know how much you drank, it only knows hours and half-life. Everything else scales: the residue linearly (double dose, double residue), the hours to threshold in steps — and the margin crosses zero between 80 and 120 mg: at the medium cup the count closes in a perfect tie, at the large one the threshold arrives two hours after you are already in bed.

A complete numerical example

The middle case: 80 mg — a medium cup, or a double espresso — drunk 8 hours before bed, with a 5-hour half-life and a personal threshold of 30 mg. In eight hours the dose crosses a good half-life and a half: 26.4 mg remain, 33.0 percent. The 30 mg threshold takes exactly 8 hours from the cup — and the margin closes at 0: the three o'clock coffee, for someone going to bed at eleven, crosses the finish line exactly on it. It is the middle case's tie: one cup later, or one stricter threshold, and the sign flips.

Reading the margin: the sign that decides

The verdict runs on the percentage still active and the sign of the margin. Below 15 percent the tail is thin: memory-grade pharmacology, sleep starts clean. Between 15 and 30, the quarter still circulating: perceptible in light sleepers, manageable by moving the cup. Between 30 and 55, the half dose: real caffeine at the wrong hour — the band where the half-life itself lives. From 55 up, the cup is still full: more than half the dose works as you lie down. And across all bands, the margin: if it is negative, the personal threshold arrives after bed — the first hours of sleep run with caffeine on board, whatever the percentage.

The half-life: the most personal number in the model

The default's 5 hours are the median for healthy adults, but the whole 3-7 range is real: fast metabolisms — often smokers, through enzyme induction — clear in 3-4 hours; slow ones need 6-7, and oral contraceptives, pregnancy and some medicines can double the times. The same cup at the same hour produces different nights in different people: that is why the colleague who drinks espresso after dinner sleeps perfectly — and it is no proof you can too. The right half-life is found by honest trial: if the afternoon coffee costs you sleep, yours is longer than you think.

The 30 mg threshold: where the dose ends and sensitivity begins

The residue is never zero — halving is asymptotic — so a convention is needed: below which residue is the dose, for you, silent? The default's 30 mg are a reasonable compromise (the order of a light tea); sensitive people go down to 10-15, tolerant ones up to 40-50. The threshold is the only input that touches neither residue nor percentage: it only moves the hours to threshold and therefore the margin — the model's way of saying the same chemistry weighs differently on different receptors. Declaring it is more honest than faking a universal limit the literature does not have.

The two directions of the count: the cup or the clock

The model has two practical levers and a clear hierarchy. Halving the dose halves the residue immediately — but leaves the percentage immobile, and moves the margin only by a few steps. Moving the cup back by one half-life halves everything: residue and percentage together. It is the hierarchy of decay: the clock beats the cup — the 120 mg coffee at two in the afternoon weighs less, in bed, than the 60 mg espresso at six. Whoever wants to give up nothing has one free strategy: the same caffeine, all of it, but earlier.

International perspective, limits and good use

The model is universal by construction: milligrams and hours have no currency and no borders, and the real range of doses is worldwide — southern Europe's 60-80 mg espresso, the north's 95-120 filter cup, energy cans of 80-160 everywhere. The limits are declared: a single dose (the morning cups are largely cleared by bedtime, but close-together afternoon doses add up on their own), first-order decay with a constant evening half-life, no interactions with alcohol or medicines, and no diagnosis: whoever has slept badly for months talks to a doctor, not to a table. In the catalog, the smoking cost calculator — the other habit with a hidden bill — and the heart rate zones calculator, for the other side of recovery, work alongside. The decision stays yours: this is just the number that was missing on the nightstand.

The hours scale: the decay that crosses every band

The medium 80 mg cup, half-life 5, threshold 30; only the cup's hour changes:

Hours before bedResidue (mg)Still activeHours to thresholdMargin
2 — the after-dinner coffee60.675.8%8−6
5 — one exact half-life40.050.0%8−3
8 — the early afternoon26.433.0%80
11 — the late morning17.421.8%8+3
14 — breakfast11.514.4%8+6

One row of distance between the cup still full and the thin tail: the hours scale crosses all four verdict bands — from the after-dinner 75.8 to breakfast's 14.4 — while the hours-to-threshold column stays nailed to 8: the threshold does not know when you go to bed, it only knows when you drank. The margin slides accordingly, from −6 to +6, symmetric around the eight-hour tie: every hour earlier is one hour of margin, at par, with no discounts and no interest.

The half-life scale: the same cup, a different night

Same 80 mg cup, same eight hours, same threshold; only the metabolism changes:

Half-lifeResidue (mg)Still activeHours to thresholdMargin
3 hours — the fast metabolism12.615.7%5+3
4 hours — the quick side20.025.0%6+2
5 hours — the median26.433.0%80
6 hours — the slow side31.739.7%9−1
7 hours — the slow metabolism36.245.3%10−2

The flag trips between the median and the slow side: at half-life 5 the count closes in a tie, at 6 the threshold arrives one hour after bed, at 7 two. It is the row that explains the eternal evening-coffee dispute: the same cup at the same hours produces margins of opposite sign in different people — whoever metabolizes in three hours takes a seventh of the dose to bed, whoever in seven nearly half. The number to discover is not in the table: it is your half-life — found honestly, one evening at a time.

The visible half-life: the 50.0 that appears in the table

There is a point of the model where the theory shows itself in a round figure: when the elapsed hours equal the half-life, the percentage shows exactly 50.0 — for any half-life, from 3 to 7. It is the definition itself surfacing in the table: one half-life, half a dose. And the scale continues with the cleanness of halving: at half-life 5, after 5-10-15 hours there remain 50.0 — 25.0 — 12.5 percent — the half, the quarter, the eighth. No other number in the catalog tells its own model with this transparency: the column is the formula, read aloud.

The grid's extremes: from the milligram to the lost night

The absolute minimum — a 40 mg single espresso, sixteen hours earlier, fast metabolism, tolerant threshold at 50 — closes at 1.0 mg of residue, 2.5 percent: and with the dose below threshold from the first instant, the hours to threshold are zero — the count is born closed, margin +16. The maximum — 200 mg one hour before bed, slow half-life, strict threshold at 10 — takes 181.1 mg to bed, 90.6 percent, with the threshold 31 hours from the cup: margin −30, the night lost by construction — and the proof by absurdity that the model's range covers the whole spectrum between the irrelevant coffee and the one that is, in effect, a guard shift.

The zero tie: where the default tells the model

The calculator's middle case — 80 mg, eight hours, half-life 5, threshold 30 — closes with a margin of exactly zero: the personal threshold is crossed at the very instant the head touches the pillow. It is not a case built to please: it is the photograph of the median habit — the early-afternoon coffee, bed at eleven — which the model places exactly on the border. The tie's lesson is fragility: from there, every variation has a sign — the four o'clock cup or the 6-hour half-life turns it negative, the single espresso or the 35 threshold brings it back positive. The default is not a judgment: it is the equilibrium point your own case departs from, in one direction or the other.

The count's strategies

Four concrete moves follow from the model — clock moves, not renunciations. Move, do not cut: bringing the cup one half-life earlier halves residue and percentage together — the most powerful lever, and it costs not one milligram. Use the dose's linearity only when the clock cannot move: half dose, half residue, immediately. Discover your half-life by honest trial: if the three o'clock coffee costs you sleep, yours is longer than the median — and the model needs recalibrating, not contesting. And declare the threshold: setting it low and respecting it is worth more than pretending immunity — the margin is a contract with yourself, and it works only if its terms are written before the evening.

Frequently asked questions

How much caffeine is still circulating when I go to bed?

It depends on just three numbers: the dose, the hours elapsed and your half-life. With a medium 80 mg cup drunk eight hours earlier and a 5-hour half-life, 26.4 mg remain — 33 percent. The calculator does the exact halving for any combination and compares it with your personal threshold.

What is the caffeine half-life?

The time in which the body halves the dose: about 5 hours on average in a healthy adult, but the real range runs from 3 (fast metabolisms, often smokers) to 7 and beyond (slow metabolisms, oral contraceptives, some medicines). It is the most personal number in the model: the same cup produces different nights in different people.

Why does the percentage not change when I change the dose?

Because decay is proportional: every half-life halves any quantity. The percentage still active depends only on hours and half-life — 33 percent after eight hours at half-life 5, whether the cup is 40 or 200 mg. What changes with the dose are the absolute milligrams of residue, and that is what the threshold works on.

What is the sensitivity threshold?

The residue below which the dose is, for you, silent: halving never reaches zero, so a personal convention is needed. The default 30 mg are the order of a light tea; sensitive people go down to 10-15, tolerant ones up to 40-50. The threshold touches neither residue nor percentage: it only moves the hours needed and the margin.

What does a negative margin mean?

That the personal threshold is reached after bedtime, not before: the first hours of sleep run with a residue your sensitivity still considers active. It is the sign of the margin, not the residue itself, that decides the verdict: zero is the exact tie — the threshold crossed right on the bed's line.

How many hours before sleep should the last coffee be?

The honest answer is: it depends on dose, half-life and threshold — which is why the calculator exists. With the middle values (80 mg, half-life 5, threshold 30) it takes 8 hours: the three o'clock coffee for someone going to bed at eleven. A slow metabolism or a large cup pushes the border toward morning; a fast one brings it near dinner.

Is coffee after dinner always bad for sleep?

No: with a short half-life and a high threshold the count can close positive even with few hours. It is however the model's most fragile combination — few hours grant few halvings, and a slightly longer half-life is enough to take half a dose to bed. The colleague who sleeps perfectly after the evening espresso has a different half-life, not proof that holds for you.

Better to reduce the dose or move the cup earlier?

The clock beats the cup: halving the dose halves the residue but leaves the percentage immobile, while moving the cup one half-life earlier halves everything — residue and percentage together. The model's free strategy is to move, not to give up: the same caffeine, all of it, but earlier in the afternoon.

Does the calculator consider several cups in a day?

No, by declaration: it models the last dose, the one that commands the evening. The morning cups are largely cleared by bedtime — twelve hours are more than two half-lives even for slow metabolisms — but close-together afternoon doses add up on their own: in that case the real residue is higher than the computed one.

How much caffeine is in an espresso, a filter cup, a can?

Orders of magnitude: single espresso 40-80 mg, double 80-120, filter cup 95-120, black tea 40-60, standard energy can 80, large versions up to 160. The calculator's 40-200 range covers real single doses; for close-together combinations, enter the sum.

Does the model hold in every country?

Yes, by construction: milligrams and hours have no currency and no jurisdiction, and first-order pharmacokinetics is the same in Oslo and Mexico City. Only the habits change — southern Europe's espresso, the north's filter, Asia's tea — that is, the dose to enter, not the mathematics that clears it.

What does the count NOT cover?

Multiple close doses, interactions with alcohol and medicines, half-life variation within the same day, sleep quality itself — light, screens and schedules often weigh more than the residue — and any medical assessment: whoever has slept badly for months talks to a professional. It is the honest count of the last cup's chemistry alone.

Updated July 2026

Formula

R = D \cdot \left(\tfrac{1}{2}\right)^{t/h}, \qquad p = 100 \cdot \left(\tfrac{1}{2}\right)^{t/h}, \qquad k = \min\{\,k \in \mathbb{N} : D \cdot \left(\tfrac{1}{2}\right)^{k/h} < S\,\}, \qquad m = t - k

Comments (0)

No comments yet. Be the first!