Skip to content
Popular Calculators
Browse Health calculators

Caffeine Calculator

Add up a day's caffeine from coffee, tea, cola and energy drinks, check it against the advised limit, and see how much is still active at bedtime.

Tablets, pre-workout, or a drink with a known amount.

For (optional)

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

DrinkTypical caffeine
Mug of brewed coffee (240 ml)95 mg
Single espresso63 mg
Mug of instant coffee60 mg
Mug of black tea47 mg
Can of cola (330 ml)34 mg
Energy drink (250 ml)80 mg
Energy drink (500 ml)160 mg
50 g dark chocolate40 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.

Frequently Asked Questions

How much caffeine is too much?

For healthy adults, up to about 400 mg a day, roughly four mugs of brewed coffee, is not associated with harm according to EFSA and the FDA. Single doses up to about 200 mg are also considered safe. People vary, and some notice jitteriness, a racing heart or poor sleep at much lower amounts.

How much caffeine is safe in pregnancy?

The usual advice is no more than 200 mg a day, about two mugs of instant coffee or one large brewed coffee. Caffeine is cleared more slowly in pregnancy and crosses the placenta, and higher intakes have been linked to lower birth weight, so staying within the limit is sensible.

How long does caffeine stay in your body?

Its half-life averages around five hours in healthy adults, meaning half is still active five hours later and a quarter after ten. The range between people is wide, from about 1.5 to 9.5 hours, and it is longer in pregnancy and with some medicines and shorter in smokers.

How much caffeine is in coffee and tea?

A 240 ml mug of brewed coffee averages about 95 mg, instant about 60 mg, a single espresso about 63 mg and a mug of black tea about 47 mg. Coffee-shop cups vary enormously and large sizes can contain 300 mg or more, so treat the typical figures as estimates.

How much caffeine can children have?

European guidance suggests no more than about 3 mg per kilogram of body weight a day for children and teenagers, so around 90 mg for a 30 kg child. Energy drinks are not recommended for children at all, and many carry warnings saying so on the can.

When should I stop drinking caffeine before bed?

Many people sleep better if their last caffeine is at least six to eight hours before bed. Research has found caffeine taken six hours before bedtime still reduced sleep time. Because of the long half-life, moving the last cup earlier often helps sleep more than cutting the total.

Last reviewed September 24, 2026 by the CalculatorPeak editorial team.