Caffeine and Bedtime Calculator

Estimate how much caffeine from your drinks is left at bedtime and when it falls to a level you choose, using an adjustable half-life.

drinks
hours
mg

Result

Fill in the fields above, then press Calculate.

The caffeine calculator estimates how much caffeine from your drinks is still in your body at bedtime, and when it will fall to a level you choose. Enter up to four drinks with the time you had each one, set your bedtime and, if you want, your own caffeine half-life. It works as a caffeine half-life calculator too: change the half-life and watch the amount left change.

Choose how many caffeinated drinks to include, then pick each drink (brewed coffee, espresso, black tea, cola, energy drink or a custom amount in milligrams) and the time you had it, in 24-hour format. Enter your bedtime, a caffeine half-life (5 hours is the default planning figure) and the level in milligrams you would like to be under. The result shows the caffeine left at bedtime and the time it falls to your chosen level.

Examples

A typical day: coffee at 8:00 AM, espresso at 1:00 PM, cola at 4:00 PM

Bedtime 11:00 PM, half-life 5 hours. The three drinks add up to 200 mg, and about 43.3 mg is still in the body at bedtime. The level falls to 25 mg at 2:58 AM (next day).

One afternoon coffee at 2:00 PM, bedtime 10:00 PM

A 95 mg coffee taken 8 hours before bed leaves 31.3 mg at a 5-hour half-life, about 33% of the dose. It falls to 25 mg at 11:38 PM.

The same coffee with a longer half-life of 8 hours

With a slower 8-hour half-life the same coffee leaves 47.5 mg at 10:00 PM, one full half-life of decay. It falls to 25 mg at 5:24 AM (next day).

Caffeine left from a 100 mg drink by hours since drinking (5-hour half-life)

Hours since the drinkCaffeine leftShare left
0 h100 mg100%
1 h87.1 mg87%
2 h75.8 mg76%
3 h66 mg66%
4 h57.4 mg57%
5 h50 mg50%
6 h43.5 mg44%
8 h33 mg33%
10 h25 mg25%
12 h19 mg19%
15 h12.5 mg13%
20 h6.3 mg6%
24 h3.6 mg4%

Caffeine half-life calculator: mg left from a 100 mg drink by half-life

Half-lifeAfter 4 hoursAfter 8 hoursAfter 12 hours
3 h39.7 mg15.8 mg6.3 mg
4 h50 mg25 mg12.5 mg
5 h57.4 mg33 mg19 mg
6 h63 mg39.7 mg25 mg
8 h70.7 mg50 mg35.4 mg

Typical caffeine in the drink presets (approximate)

DrinkServingTypical caffeine
Brewed coffee8 fl oz cupabout 95 mg
Espresso1 shot (1.5 fl oz)about 65 mg
Black tea1 cupabout 47 mg
Cola12 fl oz canabout 40 mg
Energy drink8 fl ozabout 85 mg

Frequently Asked Questions

How long does caffeine stay in your body?
It depends on the person. The Sleep Foundation says caffeine has a half-life of anywhere between 2 and 12 hours. This calculator defaults to 5 hours and lets you change it. With a 5-hour half-life, half of a dose is left after 5 hours, a quarter after 10 hours and an eighth after 15 hours.
What is a caffeine half-life calculator?
It works out how much caffeine remains after a given time, using the half-life: the time the body takes to clear half of it. Set the half-life field to the figure you want to test, for example 3 hours for faster clearance or 8 hours for slower, and the amount left at bedtime updates. The second table above shows the amounts for a 100 mg drink at several half-lives.
How do I find my own caffeine half-life?
There is no simple home test, and the calculator cannot measure it. A practical approach is to try a few values and see which timing matches how caffeine affects your sleep. The Sleep Foundation says the half-life differs with factors such as pregnancy, smoking and genetics. A clinician or pharmacist can talk through your own situation, including any medicines you take.
When should I stop drinking caffeine before bed?
The Sleep Foundation suggests a minimum of eight hours before bedtime. This calculator takes a different, personal approach: it shows how much is left at your bedtime and when the level reaches a target you set. Both are planning aids, and people differ in how much caffeine affects their sleep.
Why does the half-life differ between people?
The Sleep Foundation lists pregnancy (a half-life about twice as long in later stages), frequent smoking (up to 50% shorter) and genetics among the factors, and medications can change it as well. That is why the half-life is an input here. If any of these apply to you, adjust the field and speak to a clinician for personal guidance.
What does the FDA say about daily caffeine?
For most adults, the FDA has cited 400 milligrams a day, about two to three 12-fluid-ounce cups of coffee, as an amount not generally associated with negative effects. It also gives ranges for common drinks, for example 113 to 247 mg in a 12-ounce brewed coffee and 41 to 246 mg in a 12-ounce energy drink. This calculator is about timing before bed, not about daily totals, and individual needs differ.
Where do the drink amounts come from?
The presets use typical figures from the Harvard T.H. Chan School of Public Health Nutrition Source: about 95 mg in an 8-ounce cup of brewed coffee, 65 mg in an espresso shot, 47 mg in a cup of black tea, 40 mg in a 12-ounce cola and 85 mg in 8 ounces of energy drink. Real products vary, so use the custom amount when you know the number.
Does the calculator count a drink I had yesterday?
No. All drinks are taken as one day, so caffeine from the day before is not counted. Late-evening caffeine the night before can still matter for the next day, which is one reason the half-life is worth testing.

Related Information

Related sleep tools

Key Terms

Half-life
The time the body takes to clear half of the caffeine in it. After two half-lives a quarter is left.
Exponential decay
A steady proportional fall: the same share is cleared in each equal period of time.
Milligram (mg)
The unit used for caffeine amounts. A thousandth of a gram.

Sources

  1. Sleep Foundation: Caffeine and Sleep — Sleep Foundation
  2. Harvard T.H. Chan School of Public Health: Caffeine, The Nutrition Source — Harvard T.H. Chan School of Public Health
  3. FDA consumer update: Spilling the Beans — U.S. Food and Drug Administration

Quick Tips

  • •The Sleep Foundation suggests stopping caffeine a minimum of eight hours before bedtime; for a 10 PM bedtime that means nothing after 2 PM. Use the calculator to see what your own drinks leave behind.
  • •Moving a drink earlier in the day lowers the amount left at bedtime more than shrinking the drink does.
  • •If caffeine seems to affect you for longer than the calculator suggests, try a longer half-life and see how the timing changes.
  • •Check labels for products with caffeine, such as pre-workout drinks, tea, chocolate and some medicines, and add them with the custom amount.