CalcOpenly

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.

Updated Checked against 5 worked examples

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
Shown to 0 decimal places, half-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.

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: Python 3.8 decimal: 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: Python 3.8 decimal: 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: Python 3.8 decimal: 150 × 0.5^(6/5) = 65.2913; 5·log2(3) = 7.9248 h after 20:00 = 03:55:25, rounded up

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: Python 3.8 decimal: 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.

How accurate is the caffeine half-life calculator?

Accuracy depends on your inputs and the method's assumptions. Decimal arithmetic uses 50 significant digits, but estimates, numerical methods and source data can be less precise; the displayed rounding does not remove those limits. It is checked against 5 worked examples whose answers come from independent sources; for example, “200 mg at 08:00, checked at 18:00 (two half-lives)” is checked against Python 3.8 decimal: 200 × 0.5^(10/5) = 50; threshold reached at 5 × log2(200/50) = 10 h.

Where does the method come from?

Institute of Medicine (US) Committee on Military Nutrition Research. Caffeine for the Sustainment of Mental Task Performance (2001) — pharmacology of caffeine; FDA — Spilling the beans: how much caffeine is too much?; 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); Gardiner C et al. The effect of caffeine on subsequent sleep: a systematic review and meta-analysis. Sleep Med Rev 2023;69:101764.

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

5 worked examples with independently sourced answers ship with this calculator. They run in the test suite; you can run them here too.

Related calculators

Allow optional Google Analytics to measure page visits? Calculators work either way. Privacy and choices

Optional analytics: off.