CalcOpenly
English

Caffeine half-life calculator

How much caffeine is left in your body from up to three doses, based on its half-life, and when the level drops below an amount you choose.

Drafted with AI writing toolsUpdated Checked examples: 5

mg
FDA: 12 fl oz of brewed coffee has 113–247 mg, black tea 71 mg, green tea 37 mg. Enter 0 to skip a dose.
Times are read within the 24 hours that start at the first dose, so 01:00 after a 20:00 dose means the next night.
mg
mg
Read as the next time this clock time comes round after dose 1.
mg
h
About 5 h on average in healthy adults, ranging 1.5–9.5 h (Institute of Medicine, 2001); longer in pregnancy and with oral contraceptives, shorter in smokers.
Try
Caffeine left at the check time
mg
Caffeine left at the check time: 45 mg
Decimal places: 0; Nearest, ties to even
Below your level from
21:15
Time after the last dose
7 h 14 min
Total caffeine taken
221mg

At 22:00 about 45 mg of the 221 mg you had is still in your body. With a 5-hour half-life it drops below 50 mg at 21:15, 7 h 14 min after the last dose.

Caffeine in your body

050100150051015Hours after the first dose (08:00)Caffeine (mg)22:00: 45 mg50 mg
How it's calculated S
  1. Each dose halves every half-life

    C(22:00)=150⋅0.514/5+71⋅0.58/5=45.0 mgC(\text{22:00}) = 150 \cdot 0.5^{14/5} + 71 \cdot 0.5^{8/5} = 45.0\ \text{mg}

    Times are hours after the first dose at 08:00; doses after the check time are left out.

  2. Level right after the last dose

    Clast=136.3 mgC_{\text{last}} = 136.3\ \text{mg}
  3. Time to fall to 50 mg

    t=5×log⁡2136.350=7.23 h⇒21:15t = 5 \times \log_2\frac{136.3}{50} = 7.23\ \text{h} \Rightarrow \text{21:15}

    Rounded up to the next whole minute.

About the caffeine half-life calculator

Each dose is assumed to enter the body at once and then halve every half-life: the amount left from a dose is dose × 0.5^(hours since the dose ÷ half-life), and the calculator adds up to three doses. It also works out when the total falls below a level you choose, using time = half-life × log2(level after the last dose ÷ chosen level).

People use it to decide when to stop drinking coffee before bed. With the defaults, 150 mg at 08:00 and a 71 mg black tea at 14:00 leave about 45 mg at 22:00, and the level has been below 50 mg since 21:15.

The default half-life of 5 hours is the average for healthy adults, but it ranges from about 1.5 to 9.5 hours and changes with pregnancy, oral contraceptives and smoking. Blood levels actually peak 15 to 120 minutes after drinking, so the curve overstates the level in the first hour or two after each dose.

How long does caffeine stay in your system?

With the average 5-hour half-life, half of a dose is left after 5 hours, a quarter after 10 and an eighth after 15. The amount left is dose × 0.5^(hours ÷ half-life), so 200 mg at 08:00 leaves 50 mg at 18:00. In healthy adults the half-life ranges from about 1.5 to 9.5 hours.

How to work out caffeine left in your body

For one dose, raise 0.5 to the power of hours elapsed ÷ half-life and multiply by the dose. 200 mg after 10 hours at a 5-hour half-life is 200 × 0.5² = 50 mg; after 25 hours, 0.5⁵ leaves about 3%, or 6 mg.

For several doses, work out each one from its own time and add them. 150 mg at 08:00 and a 71 mg black tea at 14:00, checked at 22:00:

  1. First dose, 14 hours later: 150 × 0.5^(14 ÷ 5) = 21.5 mg.
  2. Second dose, 8 hours later: 71 × 0.5^(8 ÷ 5) = 23.4 mg.
  3. Total at 22:00: about 45 mg.

The later dose has had less time to fade, which is why an afternoon tea can matter more at bedtime than a larger morning coffee.

When will caffeine drop below a level?

Solve the decay for time: hours = half-life × log2(amount now ÷ target level). Just after the 14:00 tea the total is 136.3 mg, so falling to 50 mg takes 5 × log2(136.3 ÷ 50) = 7.23 hours, until just after 21:14.

Doses that cross midnight work the same way. 150 mg at 20:00 still leaves 65 mg at 02:00 and falls below 50 mg at 03:55. The 50 mg level is your own choice, not a medically validated point below which caffeine stops affecting sleep.

Caffeine in coffee, tea and energy drinks

The FDA gives these amounts for 12 fl oz servings:

  • Brewed coffee: 113–247 mg
  • Black tea: 71 mg
  • Green tea: 37 mg
  • Soft drinks: 23–83 mg
  • Energy drinks: 41–246 mg

An 8 fl oz decaf coffee has 2–15 mg. Brewing method and cup size change the dose, so use the label figure where there is one.

What changes caffeine's half-life

The 5-hour figure is an average. Half-lives in healthy adults run from about 1.5 to 9.5 hours (Antonio et al., 2024), longer in pregnancy and with oral contraceptives and shorter in smokers (Institute of Medicine).

One study measured a mean of 8.3 hours in pregnant women against 3.4 hours in other adults (Knutti et al., 1981). At 8.3 hours, the morning coffee and afternoon tea above leave 83 mg at 22:00 and stay above 50 mg until 04:05 the next morning.

The decay model also assumes each dose enters the body at once. Blood levels actually peak 15 to 120 minutes after drinking, so the estimate runs high in the first hour or two after each dose.

How late can you drink coffee before bed?

A 2023 meta-analysis of 24 studies (Gardiner et al.) puts the cut-off at least 8.8 hours before bed for a 107 mg cup of coffee and 13.2 hours for a 217.5 mg pre-workout drink.

Across those studies, caffeine cut total sleep by 45 minutes and added 9 minutes to the time taken to fall asleep. For a 23:00 bedtime, 8.8 hours means finishing that cup of coffee by 14:12.

How much caffeine is safe?

For most healthy adults, the FDA cites 400 mg a day, about two to three 12 fl oz cups of brewed coffee, as an amount not generally associated with negative effects.

The FDA estimates that toxic effects such as seizures can appear after rapidly consuming about 1,200 mg.

During pregnancy, the reference figure is 200 mg a day. The American College of Obstetricians and Gynecologists' Committee Opinion 462 (reaffirmed 2026) states that moderate intake, less than 200 mg a day, does not appear to be a major contributing factor in miscarriage or preterm birth.

Three worked cases

  • Default: 150 mg at 08:00 and 71 mg at 14:00, checked at 22:00.
  • Two half-lives: 200 mg at 08:00, checked at 18:00.
  • Overnight dose: 150 mg at 20:00, checked at 02:00.

All three use a 5-hour half-life and a 50 mg target level.

ScenarioRemaining at check (mg)Threshold clock timeEntered total (mg)
Default45.021:15221
Two half-lives50.018:00200
Overnight dose65.303:56 (+1 day)150

Threshold times are rounded up to the next minute: the overnight crossing falls at 03:55:29.

Entering doses and times

  • Doses are milligrams of caffeine, not milliliters of drink; enter 0 to skip one.
  • Clock times run for 24 hours from the first dose, so 01:00 after a 20:00 dose means the next night.
  • A dose after the check time counts toward the day's total but not toward the amount left at the check.

The sleep cycle calculator finds a bedtime from your alarm in 90-minute cycles. The blood alcohol calculator uses a different, straight-line elimination model for alcohol.

Worked examples

200 mg at 08:00, checked at 18:00 (two half-lives)

Dose 1
200 mg
Time of dose 1
08:00
Dose 2
0 mg
Dose 3
0 mg
Check the level at
18:00
Level to wait for
50 mg
Half-life
5 h
Caffeine left at the check time
50 mg
Below your level from
18:00
Time after the last dose
10 h

Checked against: 200 × 0.5^(10/5) = 50; threshold reached at 5 × log2(200/50) = 10 h

95 mg at 08:00 and 64 mg at 13:00, checked at 22:00

Dose 1
95 mg
Time of dose 1
08:00
Dose 2
64 mg
Time of dose 2
13:00
Dose 3
0 mg
Check the level at
22:00
Level to wait for
50 mg
Half-life
5 h
Caffeine left at the check time
32 mg
Below your level from
18:48
Time after the last dose
5 h 47 min 6 s
Total caffeine taken
159 mg

Checked against: 95·0.5^(14/5) + 64·0.5^(9/5) = 32.01997; 13:00 + 5·log2(111.5/50) h = 18:47:08, rounded up to 18:48

Evening dose checked after midnight

Dose 1
150 mg
Time of dose 1
20:00
Dose 2
0 mg
Dose 3
0 mg
Check the level at
02:00
Level to wait for
50 mg
Half-life
5 h
Caffeine left at the check time
65 mg
Below your level from
03:56 (+1 day)
Time after the last dose
7 h 55 min 29 s

Checked against: 150 × 0.5^(6/5) = 65.2913; 5·log2(3) = 7.9248 h after 20:00 = 03:55:29, rounded up to 03:56

Edge: already below the level at the last dose

Dose 1
40 mg
Time of dose 1
09:00
Dose 2
0 mg
Dose 3
0 mg
Check the level at
12:00
Level to wait for
50 mg
Half-life
5 h
Caffeine left at the check time
26 mg
Below your level from
09:00
Time after the last dose
0 s

Checked against: 40 × 0.5^(3/5) = 26.3902; 40 mg ≤ 50 mg from the start

Questions

How long does caffeine stay in your system?

With the average 5-hour half-life, half of a dose is still in your body after 5 hours, a quarter after 10 and about 3% after 25, so 200 mg of coffee at 08:00 leaves 50 mg at 18:00. Half-lives in healthy adults range from about 1.5 to 9.5 hours (Antonio et al., Journal of the International Society of Sports Nutrition, 2024), so the same cup can last several times longer in one person than in another.

How much caffeine is too much in a day?

For most healthy adults the FDA cites 400 mg a day, about two to three 12 fl oz cups of brewed coffee, as an amount not generally associated with negative effects. The FDA estimates that toxic effects such as seizures can appear after rapidly consuming about 1,200 mg. The calculator warns when the doses you enter add up to more than 400 mg.

How long before bed should you stop drinking caffeine?

At least 8.8 hours for a 107 mg cup of coffee and 13.2 hours for a 217.5 mg pre-workout drink, according to a 2023 meta-analysis of 24 studies in Sleep Medicine Reviews (Gardiner et al.). Across those studies caffeine cut total sleep by 45 minutes and added 9 minutes to the time taken to fall asleep. In an earlier trial, 400 mg taken 6 hours before bed still disrupted sleep (Drake et al., 2013).

How much caffeine is in coffee and tea?

The FDA gives 113 to 247 mg for 12 fl oz of brewed coffee, 71 mg for black tea, 37 mg for green tea, 23 to 83 mg for soft drinks and 41 to 246 mg for energy drinks of the same size; 8 fl oz of decaf has 2 to 15 mg. Brewing method and cup size change the dose, so use the label figure where there is one.

How much caffeine is safe during pregnancy?

Less than 200 mg a day. The American College of Obstetricians and Gynecologists' Committee Opinion 462 states that intake below 200 mg a day does not appear to be a major contributing factor in miscarriage or preterm birth. Caffeine is also cleared more slowly: one study measured a mean half-life of 8.3 hours in pregnant women against 3.4 hours in other adults (Knutti et al., 1981), so a longer half-life gives a more realistic curve.

About this calculator

C(t)=∑iDi(12)(t−ti)/t1/2(t≥ti)C(t) = \sum_i D_i \left(\tfrac12\right)^{(t - t_i)/t_{1/2}}\quad (t \ge t_i)

Sources

  1. Institute of Medicine (US) Committee on Military Nutrition Research. Caffeine for the Sustainment of Mental Task Performance (2001) — pharmacology of caffeine
  2. FDA — Spilling the beans: how much caffeine is too much?
  3. Antonio J et al. Common questions and misconceptions about caffeine supplementation. J Int Soc Sports Nutr 2024;21:2323919 (mean half-life about 5 h, range 1.5–9.5 h)
  4. Gardiner C et al. The effect of caffeine on subsequent sleep: a systematic review and meta-analysis. Sleep Med Rev 2023;69:101764

For information only, not medical advice. These formulas describe populations, not you; talk to a clinician before acting on a result.

Checked against references

This calculator includes 5 worked examples with independently sourced answers. They run in the test suite, and you can run them here too.

Put this calculator on your site

Paste this where you want the calculator to appear. It is free to use, it stays in step with corrections made here, and the credit line below it links back so your readers can find the full version.

Height
Preview the embed

Keep the credit line. It is the only condition, and it is what keeps these calculators free.