About the Caffeine Calculator
This caffeine calculator adds up the caffeine in everything you drink in a day — brewed coffee, espresso shots, black and green tea, cola and energy drinks, plus any other source in milligrams — and compares the total with the FDA’s 400 mg per day guideline for healthy adults, or the 200 mg per day limit that ACOG and the NHS advise during pregnancy.
It also estimates how much caffeine is still in your system when you go to bed, using caffeine’s elimination half-life (about 5 hours on average, but anywhere from 2 to 10 hours depending on genetics, smoking, pregnancy and medications). If you struggle to fall asleep, this shows whether your afternoon coffee might be the culprit.
For simplicity the bedtime estimate treats your whole intake as if it were taken at your last drink, which gives a cautious (higher) figure. Caffeine content varies widely by brand, brew strength and cup size, so use the “other” field for label values when you know them.
With the default inputs, the total caffeine today is 271 mg. Change any value above to recalculate instantly.
How to use the caffeine calculator
- 1Enter how many of each drink you have in a typical day.
- 2Add any other caffeine in milligrams from product labels.
- 3Enter your weight and the hours between your last caffeine and bedtime.
- 4Adjust the half-life if you are pregnant, smoke or take medicines that affect caffeine.
- 5Check your total against the daily limit and the amount left at bedtime.
Formula and method
Total caffeine is the sum of servings × typical caffeine per serving: 95 mg per 8 oz brewed coffee, 63 mg per espresso shot, 47 mg per cup of black tea, 28 mg per cup of green tea, 34 mg per 12 oz cola and 80 mg per 8.4 oz energy drink, plus any other milligrams you enter.
Caffeine is cleared by the liver with first-order kinetics, so a fixed fraction is removed per unit of time. After one half-life (t½, about 5 hours on average) half remains; after two, a quarter. The time to fall below 50 mg is t½ × log2(total ÷ 50). Treating everything as taken at the last drink gives a conservative bedtime figure.
- t
- Hours since the caffeine was consumed
- t½
- Elimination half-life in hours
- total
- Total caffeine consumed, mg
Worked examples
Two coffees, a tea and a cola
2 × 95 + 47 + 34 = 271 mg, about two-thirds of the 400 mg limit. Eight hours later, 271 × 0.5^(8/5) ≈ 89 mg is still in your system, and it takes about 12 hours to drop below 50 mg.
Energy drinks late afternoon
One coffee (95 mg), two small energy drinks (160 mg) and a 150 mg pre-workout make 405 mg — just over 400 mg. With only 4 hours to bed, about 233 mg is still active, which is likely to disturb sleep.
Pregnant, one coffee and one green tea
95 + 28 = 123 mg is within the 200 mg pregnancy limit. Because caffeine clears more slowly in late pregnancy (half-life around 10 hours here), about 71 mg is still present 8 hours later.
Frequently asked questions
How much caffeine is too much in a day?+
The FDA says up to 400 mg a day — about four cups of brewed coffee — is generally not associated with negative effects in healthy adults. Pregnant women are advised to stay under 200 mg a day, and teenagers should have much less.
What is the half-life of caffeine?+
In healthy adults it averages about 5 hours but ranges from roughly 2 to 10 hours. Smoking shortens it; pregnancy, oral contraceptives, liver disease and some medications such as fluvoxamine lengthen it considerably.
How long before bed should I stop drinking coffee?+
Research found that 400 mg taken even 6 hours before bed reduced sleep by about an hour. Many sleep experts suggest stopping caffeine 8 or more hours before bedtime, and earlier if you are sensitive.
How much caffeine is in a cup of coffee?+
An 8 oz (240 ml) cup of brewed coffee averages about 95 mg, but it can range from 70 to 140 mg. A single espresso shot has about 63 mg, and large coffee-shop drinks often contain 200–400 mg.
Does decaf coffee contain caffeine?+
Yes, a little. Decaffeinated coffee typically contains about 2–15 mg per 8 oz cup, so several cups a day can add up for very sensitive people.
This tool gives general estimates and is not medical advice. Talk to a doctor or qualified professional about your health, diet or training.