Home › Health & Education › Caffeine Calculator

Caffeine Calculator

Use this free caffeine calculator to see how much caffeine you have had today and how much is still in your system right now. Add each drink, say how many you had and how long ago, and the calculator totals your caffeine, applies the half-life decay to estimate what remains, and tells you when your level will drop below 50 mg. It is a simple way to check whether that afternoon coffee is going to cost you sleep.

For each drink, enter how many you had and how many hours ago you had them. Leave drinks you did not have at 0.

125 mg still in your system
Total consumed: 190 mg (48% of the 400 mg daily guidance) · Drops below 50 mg in about 6 h 38 min

How it works

Caffeine does not leave your body all at once. It fades gradually, and the standard way to describe that fade is the half-life: the time it takes for half of the caffeine in your system to be broken down. For most adults the half-life is about 5 hours, though it ranges from roughly 4 hours for fast metabolizers to 6 hours or more for slow metabolizers, and it can be longer during pregnancy or when certain medicines slow the liver down.

The calculator first totals the caffeine you consumed. Each drink has a standard caffeine amount: brewed coffee 95 mg, an espresso shot 63 mg, black tea 47 mg, green tea 28 mg, an energy drink 80 mg, a cola 34 mg, and a chocolate bar 20 mg. Two cups of brewed coffee, for example, add up to 190 mg. These are typical values; a strong brew or a large serving can hold more, and a weak tea can hold less.

Next, the calculator applies exponential decay to each drink separately, because drinks taken at different times have decayed by different amounts. The formula is: remaining = dose × 0.5^(hours since the drink ÷ half-life). A 190 mg dose taken 3 hours ago with a 5-hour half-life leaves 190 × 0.5^(3 ÷ 5) = 190 × 0.66 = about 125 mg. After one full half-life, half remains; after two half-lives, a quarter remains; after three, an eighth.

Finally, the calculator works out when your level will fall below 50 mg, the point where most people stop feeling a clear stimulant effect. It solves the same decay formula in reverse: hours to 50 mg = half-life × log₂(remaining ÷ 50). If your remaining level is already below 50 mg, it simply says you are already under that mark. The daily-limit comparison shows your total against 400 mg, the level generally considered safe for healthy adults, or 200 mg, the usual guidance during pregnancy.

Two practical rules follow from the math. First, caffeine stacks: a second coffee before the first has worn off pushes your level higher than either cup alone, which is why three cups spread across a morning can leave more in your system at dinner than you expect. Second, timing matters more than most people think. A coffee at 4 in the afternoon still leaves about a quarter of its caffeine in your body at midnight, so if sleep matters, the last cup belongs in the early afternoon.

Worked example

Someone drinks two cups of brewed coffee 3 hours ago and nothing else, with a 5-hour half-life.

Step 1: Total caffeine — 2 × 95 mg = 190 mg.
Step 2: Decay factor — hours ÷ half-life = 3 ÷ 5 = 0.6, and 0.5^0.6 = 0.66.
Step 3: Remaining now — 190 × 0.66 = 125.4 mg, about 125 mg still in the system.
Step 4: Share of the daily guidance — 190 ÷ 400 = 48% of the 400 mg adult guidance.
Step 5: Time to drop below 50 mg — 5 × log₂(125.4 ÷ 50) = 5 × 1.33 = 6.63 hours, about 6 hours and 38 minutes from now.

Even though the coffee was three hours ago, about two-thirds of its caffeine is still active. If this person goes to bed in 6 hours, their level will only just be falling below 50 mg at bedtime, which is why a morning coffee is a safer habit than an afternoon one.

FAQ

How long does caffeine stay in your system?

Caffeine has a half-life of about 5 hours for most adults, which means half of it is still in your system 5 hours after you drink it, and a quarter is still there after 10 hours. A 200 mg coffee at 8 in the morning leaves about 100 mg at 1 in the afternoon and about 50 mg at 6 in the evening. The exact half-life varies from about 4 to 6 hours between people.

How much caffeine is in a cup of coffee?

A standard 8-ounce cup of brewed coffee has about 95 mg of caffeine. A single shot of espresso has about 63 mg, black tea has about 47 mg, green tea has about 28 mg, a typical energy drink has about 80 mg, a cola has about 34 mg, and a chocolate bar has about 20 mg. Brewing strength, bean type, and serving size all move these numbers up or down.

How much caffeine is safe per day?

For most healthy adults, up to 400 mg of caffeine per day is generally considered safe, which is roughly four cups of brewed coffee. More than that can cause jitteriness, a fast heartbeat, anxiety, and trouble sleeping. Pregnant people are usually advised to stay under 200 mg per day. Children, teens, and people with heart conditions should keep their intake much lower.

When should I stop drinking caffeine before bed?

Most sleep experts suggest stopping caffeine 8 to 10 hours before bedtime. Because caffeine has a half-life of about 5 hours, a coffee at 4 in the afternoon still leaves roughly a quarter of its caffeine in your system at midnight. If you sleep at 11 at night, aim for your last caffeinated drink by mid-afternoon, and use this calculator to see when your level drops below 50 mg.

Why does caffeine affect people differently?

Caffeine is broken down by a liver enzyme, and the speed of that enzyme varies a lot between people because of genetics, age, smoking, and medicines. Fast metabolizers may clear caffeine in about 4 hours, while slow metabolizers can take 6 hours or more, which is why the same coffee can keep one person awake all night and barely affect another. Body weight also matters, since the same dose is more concentrated in a smaller body.

Disclaimer: This calculator gives an estimate only and is not medical advice. Caffeine amounts and half-lives vary by person, drink, and serving size. If you are pregnant, have a heart condition, or take medicine that affects caffeine metabolism, talk to a doctor before changing your caffeine intake.