How the calculation works
In healthy adults, the amount of caffeine in the body is often described as halving roughly every 5 hours. The calculator uses simple exponential decay: remaining = dose Γ 0.5(hours elapsed Γ· half-life). With a 5-hour half-life, 50% is left after 5 hours, 25% after 10 hours and 12.5% after 15 hours. Change the half-life to something like 3 or 7 hours and the answer changes with it; the table under the result shows the whole timeline.
This is a deliberately simple model. It describes the decline after absorption has finished. In real life, blood levels keep rising for roughly the first 30 to 60 minutes after you drink something, so numbers right after a cup will not match the curve exactly.
Share remaining after each half-life (calculated at build time)
The share left depends only on how many half-lives have passed, not on the dose. The right-hand columns convert half-lives into hours for three assumed half-lives.
| Half-lives | Remaining (%) | Cleared (%) | 3 h half-life | 5 h half-life | 7 h half-life |
|---|---|---|---|---|---|
| 0.5 | 70.7 | 29.3 | 1.5 h | 2.5 h | 3.5 h |
| 1 | 50.0 | 50.0 | 3 h | 5 h | 7 h |
| 2 | 25.0 | 75.0 | 6 h | 10 h | 14 h |
| 3 | 12.5 | 87.5 | 9 h | 15 h | 21 h |
| 4 | 6.3 | 93.8 | 12 h | 20 h | 28 h |
| 5 | 3.1 | 96.9 | 15 h | 25 h | 35 h |
| 6 | 1.6 | 98.4 | 18 h | 30 h | 42 h |
A 200 mg dose at different half-lives (calculated at build time)
| After | 3 h half-life | 5 h half-life | 7 h half-life |
|---|---|---|---|
| 4 h | 79.4 mg | 114.9 mg | 134.6 mg |
| 8 h | 31.5 mg | 66.0 mg | 90.6 mg |
| 12 h | 12.5 mg | 37.9 mg | 61.0 mg |
| 16 h | 5.0 mg | 21.8 mg | 41.0 mg |
Eight hours after the same 200 mg, the amount left ranges from 31.5 mg to 90.6 mg depending on the half-life. That spread is exactly why one average cannot describe everybody.
Worked examples
Example 1: 150 mg at 3 p.m., bedtime at 11 p.m. (5-hour half-life)
Eight hours is 1.6 half-lives, so 150 Γ 0.51.6 β 49.5 mg remains, about a third of the dose. Someone with a 7-hour half-life would still hold noticeably more at the same time.
Example 2: two separate drinks
100 mg at 8 a.m. and 100 mg at 1 p.m., checked at 11 p.m. with a 5-hour half-life: the morning dose has had 15 hours and leaves 12.5 mg; the afternoon dose has had 10 hours and leaves 25 mg. The total is 37.5 mg. The calculator handles one dose at a time, so for several drinks calculate each separately and add the results.
Working backwards to a last-drink time
If you decide how much you are comfortable having left at bedtime, you can solve for the cut-off:hours needed = half-life Γ log2(dose Γ· target amount). The 25 mg target below is just an illustrative number, not a safety threshold.
- 100 mg, target 25 mg, 5-hour half-life: 100 Γ· 25 = 4 = 2Β², so two half-lives, which means 10 hours before bed.
- 200 mg, target 25 mg, 5-hour half-life: 200 Γ· 25 = 8 = 2Β³, so three half-lives, or 15 hours before bed.
- 100 mg, target 25 mg, 7-hour half-life: the same four-fold drop takes 7 Γ 2 = 14 hours.
Bigger doses and longer half-lives push the cut-off much earlier. If the answer is unrealistically early, a smaller serving or a decaf swap is the practical fix.
Half-life differs from person to person
Genetics, liver function, pregnancy, smoking and medications can all change how quickly caffeine is cleared. The usual direction of each factor is below.
- Pregnancy: metabolism slows, especially later on, so the half-life lengthens. The American College of Obstetricians and Gynecologists (ACOG) advises staying under 200 mg per day while pregnant.
- Smoking: smokers tend to clear caffeine faster, and the half-life can lengthen again after quitting.
- Medications: some drugs and hormonal products slow caffeine metabolism. If you take any medication, ask a pharmacist or doctor about caffeine.
- Liver function and genes: caffeine is processed mostly in the liver, so reduced liver function can make it linger, and equal doses can feel very different from one person to the next.
The 5-hour figure is a typical value for healthy adults. If you know you are sensitive, set a longer half-life to stay on the cautious side.
Daily intake guidance
The U.S. FDA cites about 400 mg per day, roughly four or five cups of coffee, as an amount not generally associated with negative effects in healthy adults. That is a general reference rather than a guarantee, and some people feel jitters, anxiety or sleeplessness on far less. If you are pregnant, nursing or have a heart condition, talk with a clinician. Caffeine content varies by product, so check labels, and add up your whole day with theCaffeine Calculator.
Caffeine and sleep
When one half-life has passed, half of the caffeine is still there. That is why a late-afternoon coffee can still matter at night. A common rule of thumb is to finish caffeine at least six hours before bed, but sensitive people may need an earlier cut-off. Caffeine is also thought to affect the depth of sleep, not only how quickly you fall asleep. To plan your bedtime around sleep cycles, try the Sleep Cycle Calculator.
Common misunderstandings
- "After five hours it's gone." After one half-life, half remains.
- "Coffee doesn't stop me falling asleep." You may fall asleep fine yet still get lighter sleep without noticing.
- "Decaf has no caffeine." It has much less, not none.
- "Only coffee has caffeine." Tea, energy drinks, some sodas, chocolate and some cold or pain remedies can contain it too.
When not to rely on this calculator
- Pregnancy or regular medication use, where your own half-life may be far from average: medical advice comes first.
- Entering a day's total as one dose: compute each drink separately.
- Teenagers and children: the daily figures here refer to adults.
- Arrhythmia, anxiety disorders or severe insomnia: follow your clinician's guidance rather than a calculated number.
Using the result
- If the bedtime figure bothers you, move the last drink earlier or reduce the serving. Changing the hours field shows the difference immediately.
- Note your last-drink time and how you slept for about a week. That reveals a personal cut-off better than any average.
- To cut back, shrink the portion or swap the afternoon cup for decaf instead of stopping abruptly, which can bring headaches and fatigue in regular drinkers.
- This tool models one dose. For the day's total, use the Caffeine Calculator; for fluids, see the Water Intake Calculator.
Frequently Asked Questions
How long until caffeine is completely gone?
Roughly four to five half-lives (about 20 to 25 hours with a 5-hour half-life) clear most of it, around 94 to 97%. A pure halving model never reaches exactly zero; it only gets closer.
Is the result medically accurate?
No. It applies an average half-life to give a reference estimate, and your actual metabolism may differ. It does not replace diagnosis or advice.
What half-life should I choose?
If you do not know, keep the average of 5 hours. If afternoon coffee clearly affects your sleep, try 6 to 7 hours to be cautious. During pregnancy the half-life may be longer.
How much coffee per day is too much?
The FDA cites about 400 mg a day for healthy adults, and ACOG advises under 200 mg during pregnancy. Your own sensitivity may mean less is right for you.
What leftover amount is safe for sleep?
There is no fixed number. Some people sleep fine with a sizeable amount left and others do not. Use the figure for comparison and find your own cut-off from notes on how you slept.
Do I still feel alert after the half-life has passed?
Remaining caffeine can still have an effect. How alert you feel also depends on dose, tolerance and how rested you are, so the remaining amount alone cannot predict it.