How long caffeine stays in your body: half-life, bedtime and the 400 mg guide

What caffeine half-life means, why an afternoon drink is still with you at bedtime, where the 400 mg guide comes from, and what changes how fast you clear it.

Open the Caffeine calculator Free, in your browser, nothing uploaded.

Caffeine wears off much more slowly than the buzz suggests. The lift fades in an hour or two, but the caffeine itself lingers, and a mid-afternoon energy drink can still be in your blood at midnight. This article explains how the body clears caffeine, what the official daily guides say, and why the same drinks leave some people wide awake and others not. The numbers are estimates for healthy adults, not medical advice; if you are pregnant, on medicine or have a heart or liver condition, ask a doctor or pharmacist and check the official source. To plan when to go to bed, use the sleep calculator; to keep your fluids up without more coffee, try water intake; and to note how you slept against what you drank, keep a health log.

What it is

Your liver breaks caffeine down at a rate roughly in proportion to how much is left. That pattern, called first-order decay, means the amount halves over a fixed time, the half-life, whatever the starting dose:

amount left = dose × 0.5^(hours since the drink ÷ half-life)

For most healthy adults the half-life is about 5 hours, with a usual range of 3 to 7 hours. After one half-life half is left, after two a quarter, after three an eighth. Several drinks simply add up: each decays on its own clock.

Half-life varies more than most people think:

  • Smoking speeds clearance, so smokers often have shorter half-lives.
  • Pregnancy, especially late on, slows it a lot, and so do some hormonal contraceptives.
  • Some medicines (certain antidepressants and antibiotics among them) slow it sharply.
  • Liver conditions slow it.
  • Genes matter too: people differ in how active their caffeine-clearing enzyme is.

The 400 mg a day guide from the US FDA and the European Food Safety Authority (EFSA) is for healthy adults, with no more than 200 mg in one go. EFSA gives 200 mg a day in pregnancy and about 3 mg per kg of body weight a day for children and teenagers.

How to use it

  1. Check the two starting drinks or press Add a drink. Pick a type from the list, or type your own mg (a can’s label usually gives it).
  2. Set the time of each drink; the tool counts it as taken all at once.
  3. Set your Bedtime and the Half-life (5 hours unless you know yours is different).
  4. Tick Pregnant or advised to limit to compare with 200 mg instead of 400 mg.
  5. Read the bedtime level, the daily total and the curve. Copy result and Download CSV save them.

A worked example

A student has an espresso (63 mg) at 07:30, an energy drink (80 mg) at 15:00 and a cola (34 mg) at 19:00, and goes to bed at 23:30. Half-life 5 hours.

  • Espresso, 16 hours earlier: 63 × 0.5^(16 ÷ 5) = 6.9 mg.
  • Energy drink, 8.5 hours earlier: 80 × 0.5^(8.5 ÷ 5) = 24.6 mg.
  • Cola, 4.5 hours earlier: 34 × 0.5^(4.5 ÷ 5) = 18.2 mg.
  • Left at bedtime: about 50 mg, close to a whole cola still in the body.
  • Daily total: 63 + 80 + 34 = 177 mg, 44% of the 400 mg guide.

The total is well inside the guide, yet the bedtime level is not small. Most of it comes from the two afternoon and evening drinks, not the morning espresso. With a 3-hour half-life the bedtime level is about 25 mg; with 7 hours it is about 69 mg.

Checked with the tools

The calculator’s maths is inside its page (src/tools/caffeine-calculator/Tool.astro), so scripts/blog-figures/caffeine-calculator-guide.mjs copies its at() function line for line and runs the student’s day at half-lives of 3, 5 and 7 hours. The bedtime figures above come from that run, and the chart shows the whole day.

While checking we found that with a bedtime after midnight, a drink at, say, 00:30 was counted as if taken at 00:30 the morning before, almost a full day earlier. Drinks between midnight and 04:00 now belong to that same night when bedtime is after midnight, and a test checks it.

Espresso 07:30, energy drink 15:00, cola 19:00Espresso 07:30, energy drink 15:00, cola 19:00025507510006:0010:0014:0018:0022:0002:0006:00Time of dayCaffeine in the body (mg)bed 23:30Half-life 3 hHalf-life 5 hHalf-life 7 hfibub.com
Estimated caffeine in the body from 06:00 to 06:00 the next day for the student in the example (177 mg in all), at half-lives of 3, 5 and 7 hours, worked out with the calculator's own formula. An estimate, not medical advice.

Where it is used

  • Shift workers can see how a coffee before a night shift will sit at the morning bedtime.
  • Students in exam season can space drinks so the total stays under the guide.
  • Athletes who use caffeine before training can check what is left by evening.
  • People cutting down can try “no caffeine after 14:00” and watch the bedtime number fall.

Common mistakes

  • Trusting the label “a cup”. Coffee shop sizes often hold two or three times the 95 mg of a standard 240 mL mug. Type the real mg if you know it.
  • Forgetting hidden caffeine. Cola, iced tea, chocolate, pre-workout powders and some pain relievers contain it.
  • Judging by feel. Regular drinkers grow tolerant to the alertness, but caffeine can still make sleep lighter.
  • Using the adult guide for teenagers. For a 50 kg teenager, 3 mg per kg is 150 mg a day, well under 400.

Questions people ask

How long until caffeine is fully gone? In practice, about five half-lives, roughly a day at 5 hours, leaves around 3% of a dose.

Does exercise or water flush it out faster? Not noticeably. The liver sets the pace.

Is 50 mg at bedtime a problem? There is no official cut-off. Some people sleep fine; others notice lighter or shorter sleep. Trying earlier cut-off times is the simplest test.

Sources

  • Daily guide of 400 mg for healthy adults: US FDA, Spilling the Beans: How Much Caffeine Is Too Much? (fda.gov, checked 2026-12-05); EFSA Scientific Opinion on the safety of caffeine, EFSA Journal 2015;13(5):4102 (efsa.europa.eu, checked 2026-12-05): 400 mg a day, single doses up to 200 mg, and 200 mg a day for pregnant women, and 3 mg per kg of body weight a day for children and teenagers.
  • Typical caffeine per serving (brewed coffee about 95 mg per 240 mL, espresso shot about 63 mg, black tea about 47 mg, green tea about 28 mg, cola about 34 mg per 330 mL): USDA FoodData Central and the FDA page above. Energy drink about 80 mg per 250 mL follows the EU label limit of 32 mg per 100 mL. Real drinks vary a lot, so every number is editable.
  • Half-life: caffeine leaves the blood roughly in half every 5 hours in healthy adults (range about 3 to 7 hours; longer in pregnancy and with some medicines), after Institute of Medicine, Caffeine for the Sustainment of Mental Task Performance (2001) and the EFSA opinion. The tool uses simple first-order decay, with each drink taken in at once. Estimates, not medical advice. Check the official source.

If you are an author or publisher and want a credit or a passage changed or removed, tell us and we will act quickly.

Tools in this article

Read next