Caffeine Calculator

Add the coffee, tea and energy drinks you have had today and the time you had each one. The caffeine calculator shows how much caffeine is still in your body at bedtime, draws the curve through the day, and tells you the latest time you can have one more drink and still go to bed with little caffeine in your system.

Track your caffeine

What have you had today?
How fast you clear caffeine
Left at bedtime (10:30 PM) 23 mg about like a can of cola
Latest time for one more 12:50 PM
Today158 of 400 mg

Sleep researchers suggest finishing a regular coffee at least 8.8 hours before bed (Gardiner et al., 2023). For a 10:30 PM bedtime that is 1:42 PM.

An estimate for healthy adults, not medical advice. Caffeine clears more slowly in pregnancy, with some medicines and with liver conditions; ask your doctor if any apply.

How long does caffeine stay in your system?

For most healthy adults, half of the caffeine in a drink is still in the body about 5 hours later. That 5 hour figure is the half-life, and it varies a lot from person to person: the range in healthy adults runs from about 1.5 to 9.5 hours, according to the National Academies review of caffeine. Birth control pills can roughly double it, pregnancy and some medicines lengthen it, and smoking shortens it.

Because caffeine halves rather than disappearing at a set time, a strong morning coffee is still with you in the afternoon. Here is what is left of a 95 mg cup of drip coffee drunk at 8 AM:

TimeFast (3 h half-life)Typical (5 h)Slow (8 h)
1 PMabout 33 mgabout 50 mgabout 64 mg
6 PMabout 10 mgabout 25 mgabout 41 mg
11 PMabout 3 mgabout 13 mgabout 27 mg

The calculator uses the same three settings. If you do not know which one fits you, start with typical. If an afternoon coffee keeps you awake, try slow.

When should you stop drinking coffee before bed?

There is no single safe number, but the research points earlier than most people expect. A review of 24 studies by Gardiner and colleagues found that caffeine cut total sleep by about 45 minutes on average, and worked out that a regular coffee (about 107 mg) should be finished at least 8.8 hours before bed to avoid that. In an earlier sleep lab study, a large 400 mg dose disturbed sleep even when it was taken 6 hours before bedtime.

That is why the calculator gives you two answers:

  • Latest time for one more. The latest time you can have the drink you pick so that the caffeine in your body stays under your chosen level (25, 50 or 100 mg) for the first 3 hours of sleep. It counts everything you have already had today.
  • The 8.8 hour rule. The research-based cutoff for a regular coffee from that review, worked out from your bedtime. It ignores what you have already had, so it is a simple rule of thumb.

The 50 mg default is a rule of thumb, not a medical threshold. Some people sleep well with more and some notice far less, and many people sleep more lightly after late caffeine without noticing it.

How much caffeine is in coffee and other drinks?

These are the values the calculator uses. Real drinks vary with the beans, the brew and the cup size, so treat them as typical amounts. For more detail by brew method see how much caffeine is in a cup of coffee, caffeine in a shot of espresso and caffeine in a latte.

DrinkServingCaffeine
Drip coffee8 oz95 mg
Drip coffee12 oz143 mg
Drip coffee16 oz190 mg
Cold brew12 oz154 mg
Cold brew (Starbucks grande)16 oz205 mg
Instant coffee8 oz62 mg
Decaf coffee8 oz7 mg
Espresso1 shot63 mg
Espresso2 shots126 mg
Latte or cappuccino1 shot63 mg
Latte or cappuccino2 shots126 mg
Starbucks latte, grande16 oz150 mg
Americano2 shots126 mg
Black tea8 oz47 mg
Green tea8 oz28 mg
Cola12 oz can34 mg
Red Bull8.4 oz can80 mg
Dark chocolate1 oz24 mg

Brewed coffee varies the most: the FDA puts a 12 oz cup anywhere from 113 to 247 mg. The cold brew and latte figures for Starbucks are the ones it lists on its own menu. Have something else? Pick “Other” and type the caffeine from the label. Curious how low decaf goes? See does decaf coffee have caffeine.

How much caffeine is too much?

The FDA cites 400 mg a day as an amount not usually linked to harmful effects in healthy adults. That is about four 8 oz cups of drip coffee or six single espresso shots. The calculator’s meter shows how far today’s total is toward that number.

  • Pregnancy: the American College of Obstetricians and Gynecologists advises under 200 mg a day. Health Canada uses 300 mg for people who are pregnant, planning a pregnancy or breastfeeding.
  • Children and teens: Health Canada suggests no more than 2.5 mg per kilogram of body weight a day.
  • One sitting: European food safety advice puts the limit for a single dose at about 200 mg for adults, which is roughly one 16 oz drip coffee.

These are general guides. If you have a heart condition, anxiety, trouble sleeping or take regular medication, ask your doctor what suits you.

How the calculator works

  • Caffeine goes in over about an hour. Each drink is absorbed gradually and reaches its peak in your body about 70 minutes after you drink it, which is why the curve rises before it falls. The absorption rate comes from a study of caffeine in drinks.
  • Then it halves on a schedule. After that, the amount falls by half every half-life: every 3, 5 or 8 hours depending on the setting you choose.
  • Drinks add up. The curve is the sum of every drink, so a second coffee lands on top of what is left of the first.
  • The cutoff looks ahead. To find the latest time for one more, the calculator tries your next drink at every 5 minute step back from bedtime and keeps the latest time that holds the first 3 hours of sleep under your limit.
  • It shows the amount in your body, in mg. It does not use body weight, so it compares drinks and times rather than predicting blood levels.

It is an estimate for healthy adults and not medical advice. Want the full picture on drinks? Our guide to coffee drink types explains what is in each one, and the coffee calculator works out how much coffee to brew. See all our coffee tools.

Frequently Asked Questions About the Caffeine Calculator

How long does caffeine stay in your system?

Caffeine has a half-life of about 5 hours in most healthy adults, so half of a drink is still in your body 5 hours later and about a quarter after 10 hours. The half-life ranges from about 1.5 to 9.5 hours from person to person.

How many hours before bed should I stop drinking coffee?

A large review of 24 sleep studies suggests finishing a regular coffee at least 8.8 hours before bed. For a 10:30 PM bedtime that means about 1:45 PM. People who clear caffeine quickly may get away with later, but caffeine can make sleep lighter even when you fall asleep easily.

How much caffeine is too much in a day?

The FDA cites 400 mg a day for healthy adults, about four 8 oz cups of drip coffee. During pregnancy the advice is under 200 mg a day in the US and 300 mg in Canada.

Does caffeine affect sleep if I fall asleep fine?

It can. In sleep studies, caffeine shortened total sleep and made it lighter and more broken, and people often did not notice the change themselves.

What is the half-life of caffeine?

About 5 hours on average for healthy adults. It is shorter in smokers and longer in pregnancy, with birth control pills and with some medicines and liver conditions.

How much caffeine is in a cup of coffee?

About 95 mg in an 8 oz cup of drip coffee, 63 mg in a single shot of espresso and about 7 mg in an 8 oz cup of decaf. Larger cups scale up, so a 16 oz drip coffee has about 190 mg.