Caffeine Calculator

Caffeine is the world’s most popular stimulant, and most of us have no idea how much we take in. This calculator adds up caffeine from the drinks you have, compares the total with the 400 mg a day the U.S. FDA says is not generally associated with negative effects in healthy adults, and — importantly for sleep — estimates how much is still in your system at bedtime using the half-life, the time it takes your body to clear half of the caffeine. Amounts per drink use the midpoints of the FDA’s published ranges per 12-ounce serving; real drinks vary a lot, so enter label values in the “other” box when you know them.

How to use the caffeine calculator

  1. Enter how many 12-ounce servings of each drink you have in a day. Use the “other” box for espresso, pills or chocolate (label amounts are best).
  2. Enter the time of your last caffeine and your usual bedtime.
  3. Pick a half-life: 5 hours is typical, but it varies by person, medication, pregnancy and genetics.
  4. Read your total, the share of 400 mg, the cup equivalent and the amount left at bedtime, then adjust your cut-off time if needed.

Formula

Total caffeine = Σ (servings × caffeine per serving) + other. The FDA’s ranges per 12 fl oz are about 113–247 mg for brewed coffee, 71 mg for black tea, 37 mg for green tea, 23–83 mg for caffeinated soft drinks and 41–246 mg for energy drinks; this tool uses the midpoints for coffee, soda and energy drinks. Caffeine remaining = total × 0.5^(hours since last drink ÷ half-life). The estimate assumes everything was taken at the time of your last drink, so it overstates what remains if you drank earlier.

Worked examples

Two coffees at midday

Two 12-oz brewed coffees plus 40 mg from other sources is 400 mg — 100% of the 400 mg guidance. With the last drink at noon and bed at 10 p.m. (10 hours), about about 100 mg remains.

An afternoon coffee

One coffee (180 mg) at 5 p.m. with bed at 11 p.m. leaves about about 78 mg at bedtime — roughly the amount in a weak tea, which can still disturb sleep in sensitive people.

A slow metaboliser

With a 7-hour half-life the same 180 mg at 5 p.m. leaves about 99 mg at 11 p.m.

Practice problems

Try these yourself first, then check your answer. The answers come from the calculator above.

  1. Three 12-oz coffees and a 12-oz energy drink, last one at 15:00, bedtime 23:00, half-life 5 hours. Total caffeine and how much is left at bedtime?
    Show answer

    Total caffeine today: 684 mg · Share of the 400 mg adult guidance: 171% · Still in your system at bedtime (8 h after your last drink): about 226 mg

Common mistakes to avoid

  • Assuming all coffees are equal. A 12-oz brewed coffee can contain anywhere from about 110 to 250 mg.
  • Forgetting hidden sources: energy shots, pre-workout powders, chocolate, some pain relievers.
  • Treating 400 mg as a target. It is a general guide for healthy adults; sensitivity varies widely.
  • Using caffeine late in the day. Even if you fall asleep, residual caffeine can reduce deep sleep.
  • Ignoring pregnancy, breastfeeding and medical advice. The FDA recommends talking to your health care provider if you are pregnant, trying to become pregnant or breastfeeding.

Frequently asked questions

How much caffeine is too much?

The FDA cites 400 mg a day — roughly two to three 12-ounce cups of coffee — as an amount not generally associated with negative effects for healthy adults, though sensitivity varies.

How long does caffeine stay in your system?

Its half-life is commonly cited as about 3–7 hours (around 5 on average), so a coffee at 4 p.m. can still have a quarter to half of its caffeine at bedtime.

How many cups of coffee is 400 mg?

About two to three 12-oz cups of brewed coffee, depending on strength.

When should I stop drinking caffeine?

Many people sleep better with a cut-off 8–10 hours before bed; the calculator shows how much remains at your bedtime.

Is caffeine safe in pregnancy?

Guidance varies; speak to your health care provider about your own limit.

Is this medical advice?

No. It is an educational estimate with typical values; check labels and speak to a doctor about your own health.

Health information, not medical advice. This calculator is for education and general planning only. It cannot assess your individual health. Speak to a doctor or registered dietitian before changing your diet or exercise, and see our disclaimer.

Sources and further reading

Reviewed September 26, 2026 by the SolveCalcPro editorial team. Found a mistake? Tell us; see our editorial policy.