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.
- 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.
More settings
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
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 becomes , and your body multiplies every cup by the same factor:
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
- Elimination rate from the half-life
k_e = \frac{\ln 2}{t_{1/2}} = \frac{0.693}{5} = 0.1386\ \text{per hour} - Each cup: absorbed (kₐ ≈ 4/h), then eliminated
A'(t) = k_a G(t) - k_e A(t),\quad G'(t) = -k_a G(t) - Laplace transform: a cup at time tᵢ is Dᵢ·e^(−s tᵢ), and the body multiplies by one fixed factor
A(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}} - Back in time: each cup’s curve, shifted, just adds
A(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
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
| Symbol | Meaning | Unit |
|---|---|---|
| caffeine in cup i, and when you drank it | mg, h | |
| absorption and elimination rates | /h | |
| hours 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.
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.
Related exhibits
- Start here
Cooling coffee: when is it drinkable?
Hot things cool fast, then slower and slower. Exponential decay predicts the sip.
- Go further
Door closer: slam, bounce, or glide
One damping knob turns a slam into a glide. Where two dots (the poles) sit tells you which.
- Also try
Why the shower goes hot, then cold
You react to water that left the tap seconds ago. Delay plus impatience makes the swing, and one number predicts it.
- Also try
Compound interest: money that grows on itself
Interest earns interest. Exponents explain why saving early wins.
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.