About the Caffeine Calculator
Caffeine is the most widely used stimulant in the world, and most people who use it have only a hazy idea how much they take. It comes from coffee and tea, but also from cola, energy drinks, chocolate and some medicines, and the amounts vary far more than people expect.
There are two useful questions to ask about it. The first is how much you have in a day, compared with the amount health authorities consider safe. The second is how much is still in your body at bedtime, because caffeine lingers for hours and is one of the commonest reasons for poor sleep.
This caffeine calculator answers both. Enter what you drank, and it totals the caffeine, compares it with the advised limit for adults, pregnancy or children, and estimates how much will still be active when you go to bed.
How to Use the Caffeine Calculator
Enter how many of each drink you had in the day. The typical caffeine content of each is shown beside it.
Add any other caffeine in milligrams — tablets, pre-workout powders, or a drink with a known amount on the label.
Choose who it is for: an adult, pregnancy, or a child or teenager (which needs their weight).
Optionally, enter the hours between your last caffeine and bedtime.
How Caffeine Is Worked Out
total caffeine = sum of (number × caffeine per serving)
still active = total × 0.5^(hours ÷ 5)
The second line uses caffeine's half-life: the time for the body to clear half of it. It averages about five hours in healthy adults, so after five hours half remains, after ten a quarter, after fifteen an eighth.
Step-by-Step Example
Three mugs of brewed coffee and a can of cola. Last one six hours before bed.
Total: 3 × 95 + 34 = 319 mg
Against 400: 319 ÷ 400 = 80%
At bedtime: 319 × 0.5^(6 ÷ 5) ≈ 139 mg
That is within the daily limit, but at bedtime there is still about as much caffeine active as in one and a half fresh mugs of coffee. Treating everything as drunk at the last cup makes this an upper bound; caffeine from the morning will have cleared further.
Caffeine in Common Drinks
| Drink | Typical caffeine |
|---|---|
| Mug of brewed coffee (240 ml) | 95 mg |
| Single espresso | 63 mg |
| Mug of instant coffee | 60 mg |
| Mug of black tea | 47 mg |
| Can of cola (330 ml) | 34 mg |
| Energy drink (250 ml) | 80 mg |
| Energy drink (500 ml) | 160 mg |
| 50 g dark chocolate | 40 mg |
These are averages. A large coffee from a chain can contain 300 mg or more, and the same tea bag can release twice as much caffeine brewed for five minutes as for one. Where the label gives a figure, use that.
How Much Is Safe
Healthy adults: up to about 400 mg a day is not associated with harm, according to the European Food Safety Authority and the US FDA, and single doses up to about 200 mg are also considered safe.
Pregnancy: no more than 200 mg a day. Caffeine is cleared more slowly in pregnancy and crosses the placenta.
Children and teenagers: no more than about 3 mg per kilogram of body weight a day. Energy drinks are not recommended for children.
Sensitivity varies. Some people feel anxious or jittery, or have a racing heart, at far less than 400 mg; others notice little effect.
Why Timing Matters for Sleep
Because of the five-hour average half-life, an afternoon coffee is still partly active late into the evening. Research has found that caffeine taken six hours before bed still reduced total sleep, even when people did not feel it.
And the half-life varies widely, from about 1.5 to 9.5 hours. It is longer in pregnancy and with some medicines, including certain contraceptive pills, and shorter in smokers. Someone at the slow end still has most of a lunchtime coffee in their system at bedtime. For many people, moving the last cup earlier helps sleep more than cutting the total.
Cutting Down Without Headaches
Regular caffeine users often get headaches, tiredness and low mood for a few days after stopping suddenly. Reducing by about a quarter every few days, or swapping some drinks for half-caffeinated or decaffeinated versions, usually avoids most of it.
Understanding Your Result
Total caffeine is the day's total in milligrams.
Against the daily limit compares it with the advised amount for the group you chose.
Still active at bedtime estimates what remains at a typical half-life.
Where it came from lists each source.
Worth knowing covers going over the limit, caffeine and sleep, and personal sensitivity.
When Should You Use This Calculator?
When sleep is poor, to see how much caffeine is still active at night.
In pregnancy, to keep within 200 mg a day.
When cutting down, to know your starting point.
For a teenager, especially one who drinks energy drinks.
Common Mistakes
Assuming all coffee is the same. Coffee-shop sizes can triple the caffeine.
Forgetting tea, cola and chocolate. They add up.
Stopping at "within the limit". Timing matters for sleep.
Stopping suddenly. Withdrawal headaches are common; cut down over a week or two.
Mixing energy drinks and alcohol. Caffeine masks how drunk you feel, not how drunk you are.
If you have a heart condition, high blood pressure or anxiety, or take medicines that interact with caffeine, ask a doctor or pharmacist what is right for you. Nothing here is medical advice.