How long does caffeine stay in your system?

Caffeine peaks about an hour after a cup, then halves roughly every five hours, though that varies by person. A 3 pm coffee can leave nearly half its caffeine at bedtime. Each cup follows the same curve, shifted to when you drank it, and the curves simply add. The Laplace transform explains why they stack.

50 mg ≈ a cup of teacupbedtime: 6.09 mg
Caffeine at bedtime
6.09 mg
Highest level
41.6 mg
Total taken
47 mg

Challenge: Drink at least 150 mg and still be under 25 mg at bedtime.

7.5 means 7:30 am; 15 means 3 pm.
More settings
About 5 hours for most adults, but it varies from person to person.

Play

Move your afternoon cup earlier, one hour at a time. Watch bedtime caffeine drop.

Challenge: Drink at least 150 mg and still be under 25 mg at bedtime. The box under the picture turns green when you get it.

Stuck? Pick one of the examples from the “Try an example” menu, or press “New example.”

Understand

A(s)=ka(s+ka)(s+ke)∑iDi e−stiA(s) = \frac{k_a}{(s + k_a)(s + k_e)}\sum_i D_i\,e^{-s t_i}

Your body clears caffeine at a rate proportional to how much is there. That's a differential equation, and its answer is exponential decay with a half-life. Absorption from the gut adds a quick rise first.

The Laplace transform makes the whole day simple. A cup at time tit_i becomes Die−stiD_i e^{-s t_i}, and your body multiplies every cup by the same factor:

A(s)=ka(s+ka)(s+ke)∑iDi e−stiA(s) = \frac{k_a}{(s + k_a)(s + k_e)}\sum_i D_i\,e^{-s t_i}

Back in time, that means the cups' curves add. Each one is the same bump, shifted to when you drank it.

Use

Every input has a unit menu, so you can type values in the units you already have. Results follow your units.

Show the work

  1. Elimination rate from the half-lifek_e = \frac{\ln 2}{t_{1/2}} = \frac{0.693}{5} = 0.1386\ \text{per hour}
  2. Each cup: absorbed (kₐ ≈ 4/h), then eliminatedA'(t) = k_a G(t) - k_e A(t),\quad G'(t) = -k_a G(t)
  3. Laplace transform: a cup at time tᵢ is Dᵢ·e^(−s tᵢ), and the body multiplies by one fixed factorA(s) = \underbrace{\frac{k_a}{(s + k_a)(s + k_e)}}_{\text{your body}}\ \underbrace{\sum_i D_i e^{-s t_i}}_{\text{your cups}}
  4. Back in time: each cup’s curve, shifted, just addsA(t) = \sum_i \frac{D_i\,k_a}{k_a - k_e}\big(e^{-k_e (t - t_i)} - e^{-k_a (t - t_i)}\big),\ \ k_a = 4

Export

Export PDF

Pick a drink, the number of cups, and the times. Set your bedtime. "More settings" lets you change the half-life. About 5 hours is typical.

  • The dashed line (50 mg, about a cup of tea) is a reference, not a sleep threshold.
  • Caffeine amounts vary by brand and brew. Check the label for energy drinks.

For learning and estimation. Verify with applicable codes, standards, and a qualified professional before using in design, construction, or safety-critical work.

Cheat card

ke=ln⁡2t1/2k_e = \frac{\ln 2}{t_{1/2}}
A(s)=ka(s+ka)(s+ke)∑iDi e−stiA(s) = \frac{k_a}{(s + k_a)(s + k_e)}\sum_i D_i\,e^{-s t_i}
A(t)=∑iDikaka−ke(e−keτi−e−kaτi)A(t) = \sum_i \frac{D_i k_a}{k_a - k_e}\left(e^{-k_e \tau_i} - e^{-k_a \tau_i}\right)
SymbolMeaningUnit
Di,tiD_i, t_icaffeine in cup i, and when you drank itmg, h
ka,kek_a, k_eabsorption and elimination rates/h
τi\tau_ihours since cup i
  • After absorption, each half-life halves what's left. Two half-lives leave a quarter.
  • Because curves add, spacing cups apart doesn't reduce the total. It only lowers the peaks.
  • Half-life is shorter for smokers, and longer in pregnancy and with some medications.

Print this card

Where it’s used

  • Medicine & Health
    Pharmacists use the same model to plan dosing schedules so a medicine stays in its useful range.
  • Biology
    Many substances, from caffeine to alcohol byproducts, clear the body at a rate proportional to how much is there.
  • Health & Fitness
    Pick the latest time for your afternoon coffee so it doesn’t keep you awake.

Questions people ask

How long does caffeine last?

Its half-life is about 5 hours for most adults, though it ranges from about 3 to 7 hours or more. Five hours after a peak of 95 mg, about 48 mg remains. After 10 hours, about 24 mg.

Why does the Laplace transform make stacking easy?

In the Laplace domain, drinking a cup at time tᵢ is just a factor e^(−s tᵢ), and your body multiplies every cup by the same fixed factor. Adding cups adds terms. Back in time, that means each cup's curve adds to the others, which is called superposition.

Is this medical advice?

No. It's a simple model of an average adult. Sensitivity to caffeine varies a lot. Talk to a doctor about caffeine and pregnancy, medications, or health conditions.