Understanding the coffee kick calculator — concept and principle
This calculator estimates how much caffeine is in your body now and at bedtime after several cups through the day, using a simple half-life model. It shows the amount per kilogram, the peak after the last cup, the hours until the level falls below a sleep-relevant threshold, the day's total and its share of the 400 mg daily guide. Coffee drinkers who sleep badly use it to time their last cup.
How it is calculated
- Each cup is assumed to be absorbed quickly, then cleared exponentially
- Amount left from one cup after t hours = caffeine × 0.5^(t ÷ half-life)
- Cups are taken at time 0 and every "hours between cups"; amounts add up
- Sleep threshold used: 1.4 mg per kg of body weight
- Share of daily guide = total ÷ 400 mg × 100
The principle
Caffeine is almost fully absorbed within about 45 minutes and then broken down by the liver at a rate described by its half-life, about 4 hours on average but 2–8 hours between people, and longer in pregnancy. Each half-life halves what remains, so caffeine from a morning cup is still present in the evening. The European Food Safety Authority notes that about 1.4 mg per kg taken close to bedtime may disturb sleep, and that up to 400 mg a day spread over the day is of no safety concern for healthy adults (200 mg in pregnancy).
Worked example
Defaults: 70 kg; 3 cups of 95 mg, 3 hours apart; 7 hours since the first; 6 hours until bed; half-life 4 h.
- Now (t = 7): 95 × (0.5^1.75 + 0.5^1 + 0.5^0.25) = 95 × 1.638 = 156 mg = 2.22 mg/kg.
- Peak after the last cup (t = 6): 95 × 1.948 = 185 mg.
- At bedtime (t = 13): 95 × 0.579 = 55 mg = 0.79 mg/kg.
- Below 1.4 mg/kg (98 mg) in about 2.7 hours from now.
- Total today = 285 mg = 71% of 400 mg.
| Caffeine per cup (mg) | Caffeine in your body now (mg) |
|---|---|
| 23.8 | 39 |
| 47.5 | 78 |
| 71.2 | 117 |
| 95 | 156 |
| 119 | 195 |
| 142 | 233 |
| 190 | 311 |
How to read the result
By bedtime the level is below the sleep threshold, though some people are more sensitive. If you sleep poorly, try moving the last cup earlier; with a 4-hour half-life, a cup at 4 pm still leaves about a quarter of its caffeine at midnight. Caffeine content varies widely between drinks.
Common mistakes
- Assuming all coffee contains the same caffeine.
- Forgetting tea, cola, energy drinks and chocolate.
- Using the average half-life when pregnant or on medicines that slow caffeine breakdown.
- Treating the threshold as exact for everyone.
Frequently asked questions
How long does caffeine stay in the body?
Half is cleared in about 4 hours on average, but it takes many hours to clear almost completely.
How much caffeine is safe per day?
EFSA considers up to 400 mg a day of no safety concern for healthy adults, 200 mg in pregnancy.
When should I have my last coffee?
It depends on your sensitivity; many people stop at least 6–8 hours before bed.
Sources: EFSA NDA Panel, "Scientific Opinion on the safety of caffeine", EFSA Journal 2015;13(5):4102 · USDA FoodData Central (brewed coffee, espresso)