TrackCaffeine

Metabolism & sleep

Caffeine calculator: how much is in your system right now

This calculator uses the same first-order elimination model as the CoffeeLog app: each dose decays on its own curve with a half-life you can set between 1 and 12 hours (the population average is about 5.7 hours). Add every drink with the time you had it, and it sums the curves to show your real total — not a single label number.

In your system now mg
At bedtime mg
Latest cup before bed
Caffeine remaining over time

Log it in one tap in CoffeeLog →

Estimates for general information, not medical advice.

How to use it

  1. Pick a drink or enter a custom mg amount, and the time you had it.
  2. Add more drinks for the day with the “add another drink” button.
  3. Set your personal half-life and your bedtime.
  4. Read how much caffeine is in your system now, at bedtime, and your latest safe cup.
0 56 112 168 224 MG 100 mg · sleep threshold 5.7 h 200 mg 0 h +3 h 139 +6 h 96 +9 h 67 +12 h 46 HOURS AFTER THE DRINK · HALF-LIFE 5.7 H
A single 200 mg dose on the 5.7-hour half-life this tool uses. The dashed line is the 100 mg sleep threshold; where the curve crosses it is the number every calculator here is really computing. Free to reuse with a link to this page.

The math behind the curve

Caffeine follows first-order elimination, meaning a fixed fraction leaves your body each hour rather than a fixed amount. The formula is simple: mg remaining = dose × 0.5^(minutes ÷ half-life). With the population-average half-life of 5.7 hours (342 minutes), a 200 mg dose falls to about 138 mg after 3 hours, 96 mg after 6 hours, and 46 mg after 12. The calculator runs this for every drink you add and sums the results at the moment you ask, which is why a coffee at 8 am and an energy drink at 2 pm produce a single, accurate total rather than two separate guesses.

Why your half-life is not average

The 5.7-hour figure is a population mean; your real value can sit anywhere from roughly 1.5 to over 10 hours. Smoking roughly halves it, so smokers clear caffeine fast. Pregnancy can double or triple it. Oral contraceptives, some antidepressants and liver-affecting medications slow it down, while a genetic variant in the CYP1A2 enzyme makes some people fast metabolizers and others slow. The slider lets you match your own experience: if coffee keeps you up far longer than friends, set a longer half-life and watch the bedtime number climb.

From numbers to better sleep

The most useful output is the latest-cup time. It solves the inverse problem — given your bedtime and the caffeine already in you, how late can one more standard cup go before it pushes you over the ~100 mg level that disturbs many people's sleep. Doing this by hand every day is tedious, so the CoffeeLog app keeps the same curve live on your phone and warns you as the cutoff approaches.

How do I add several drinks and why isn't summing milligrams the same as summing curves?

Add each drink as a separate dose and the calculator computes the remaining milligrams from each dose at the moment you ask, then sums those remaining amounts to give a single total. Summing curves is not the same as summing milligrams because each dose decays exponentially from its own start time, so two identical doses taken hours apart leave different amounts at any later moment.

Summing curves is adding the milligrams remaining from each dose at a single time; summing milligrams is adding the original doses and pretending they decay as one lump. "Summing curves" is the process of adding time-dependent remainders from separate doses, and that is what the calculator uses.

Worked example: a 96 mg drip coffee at 08:00 and a 160 mg energy drink at 14:00 — what is left at 23:00 using the population-average half-life of 5.7 hours? The calculator uses the model mg remaining = dose × 0.5^(hours ÷ 5.7). For the 96 mg drip coffee taken at 08:00, the interval to 23:00 is 15.0 hours, so the arithmetic is 96 mg × 0.5^(15.0 ÷ 5.7) = 96 mg × 0.5^2.63157895 ≈ 96 mg × 0.1615 = 15.50 mg. For the 160 mg energy drink taken at 14:00, the interval to 23:00 is 9.0 hours, so the arithmetic is 160 mg × 0.5^(9.0 ÷ 5.7) = 160 mg × 0.5^1.57894737 ≈ 160 mg × 0.3350 = 53.60 mg.

The two remainders add as a curve-sum, not a dose-sum: 15.50 mg + 53.60 mg = 69.10 mg remaining at 23:00. All milligram values above are drawn from the open dataset pages: Drip coffee (96 mg) and Monster Energy (160 mg), and the elimination model and 5.7-hour population mean are described on the site method page (about). If you had instead added 96 mg + 160 mg = 256 mg and applied one decay from 08:00, you would get a different, incorrect remainder because the 160 mg dose did not begin decaying until 14:00; summing original milligrams ignores the staggered start times and over- or underestimates the true total depending on timing.

This is why the Caffeine Comparison and the calculator both present curves and reported remainders for each drink before summing them: each Cold brew (200 mg), Red Bull (250 ml, 80 mg) or Starbucks Cold Brew (Grande, 205 mg) contributes a time-shifted exponential tail rather than a single proportional share of a lumped dose.

How can I find my own half-life from my experience rather than guessing?

You can estimate your own caffeine half-life by comparing two events where you know dose sizes and the time between them and by measuring an observable effect or a late residual (for example, sleep disturbance or heart-rate readings). Half-life is the time it takes for half of a substance to be eliminated, and the calculator lets you adjust the slider until the curve matches your observed pattern.

Start with two clear, documented occasions: note the exact doses and times (use values from the dataset like Drip coffee, 96 mg or Cold brew, 200 mg) and an outcome you can link to caffeine level — for example, the time a night’s sleep was shortened or the time you still felt jittery. Use the calculator to reproduce the symptom: if you observed a known remaining amount (or a threshold effect) at a known time, adjust the half-life until the computed remainder matches your observation.

One concrete method is pharmacokinetic back-calculation: if you slept later and estimate that ~100 mg or more in the evening disturbed your sleep on a particular night, use the calculator to add the drinks you had that day and slide the half-life until the computed remaining caffeine at bedtime lines up with the disturbance; the half-life you set is then your best empirical estimate. The site’s Latest Cup Before Bedtime calculator can also be used in reverse: set your bedtime and observed intolerance, then change the half-life until the calculator reproduces the threshold that matches your experience.

Keep in mind the quality of this personal estimate depends on accurate records and consistent conditions; food, fasting, alcohol and concurrent medications can change absorption and elimination between the test nights. If you repeatedly see that a given evening dose pushes you over the same sensitivity threshold despite similar context, the half-life you derive from those nights is likely a stable personal parameter and can be used in daily planning and in the Safe Daily Limit calculator.

What does the calculator assume and how does that affect accuracy?

The calculator assumes instantaneous absorption into the bloodstream and first-order elimination from that moment, which makes the model simple and deterministic. Absorption phase is the period after ingestion when a substance moves from the gut into the bloodstream, and by omitting a separate absorption phase the calculator reads somewhat high for the first 30–45 minutes after ingestion.

Because we do not model absorption kinetics, the calculator treats a drink taken now as if its full labeled milligrams are already subject to elimination; as a result, the plotted remainder immediately after ingestion is higher than the true blood level would be during the absorption rise and early distribution. The practical effect is that the first 30–45 minutes after a drink are a conservative overestimate of circulating caffeine for most beverages; that overestimate is preferable for planning sleep but reduces precision when you want to model seconds-to-minutes effects such as immediate alerting.

Other simplifications the calculator makes include: single-compartment kinetics (the body is treated as one well-mixed space), no dose-dependent saturation of metabolism, and no explicit accounting for mixed formulations (sustained-release products or chewing gum release faster or slower than liquid drinks). Those simplifications keep the tool transparent and easy to use; the trade-off is loss of a few percentage points of accuracy for complex cases, but the first-order model captures the dominant behaviour for the bulk of ordinary drinks listed in the dataset (dataset and the drink index at Caffeine In).

How should the bedtime figure change my decision about one more cup?

The bedtime figure tells you how much caffeine the model expects to be present at your stated bedtime for the half-life you've chosen; use it as a decision threshold, not as a guarantee of effect. If the bedtime figure is near or above the level that you know disturbs your sleep, you should consider delaying or skipping the cup — the Drake et al. sleep study found that 400 mg taken six hours before bedtime reduced total sleep time by over an hour (Drake et al., 2013), and the U.S. Food and Drug Administration cites 400 mg/day as a guidance for healthy adults (Drake et al., 2013; FDA, 400 mg/day).

Use the bedtime figure together with your personal sensitivity: if the calculator shows, for example, 120 mg at bedtime and past experience says 120 mg keeps you awake, that is actionable information to stop drinking earlier. Latest-cup calculations in the site’s Latest Cup Before Bed tool invert the problem — they answer directly how late you can take a standard cup without exceeding a chosen bedtime threshold — and the Safe Daily Limit tool helps you keep total daily intake within guidelines.

Remember that the bedtime figure is model-based and depends on the half-life you choose; if you have reason to believe your metabolism is faster (smoking) or slower (pregnancy, some drugs), adjust the half-life slider before relying on the bedtime number. The calculator is informational and not medical advice: use it to inform choices and consult clinical guidance where needed.

Who is the population-average half-life wrong for?

The population-average half-life of 5.7 hours is wrong for identifiable groups, and you should not use the default if you belong to any of them. CYP1A2 is a liver enzyme that metabolizes caffeine, and genetic variants in CYP1A2, smoking, pregnancy, oral contraceptives and specific medications change elimination speed enough that the average is a poor personal estimate.

Smokers typically clear caffeine faster; smoking roughly halves the half-life in many studies, so the population mean underestimates clearance for smokers. Pregnancy commonly prolongs half-life, often doubling or more, so the population mean underestimates caffeine persistence in pregnant people; oral contraceptives and some antidepressants slow elimination and produce longer half-lives than the average, and specific CYP1A2 genetic variants make some people fast metabolizers and others slow.

If you take medications that affect the liver (CYP1A2 inhibitors or inducers), check the medication literature because the interaction can move your half-life well outside the 1.5–10+ hour span seen in population surveys; the site’s guides include some specifics and links to primary sources where interactions are documented (pregnancy guide, pre-workout guide). When you know you are in one of these groups, change the half-life slider from the default 5.7 hours to match published guidance or your own empirical estimate and then use the calculators for planning.

For quick reference, check these dataset pages when planning changes: Espresso (double, 126 mg), Latte (large, 2 shots, 126 mg), Monster Energy (160 mg), Red Bull (250 ml, 80 mg) and Cold brew (200 mg) for representative doses, then run your scenarios in this calculator and the linked tools for bedtime and safe daily limits (Latest Cup, Safe Daily Limit, Caffeine Comparison). For regulatory limits and sleep impact primary literature see the FDA and Drake sources cited above (FDA, 400 mg/day; Drake et al., 2013).

Frequently asked questions

How is caffeine in the body calculated?

Each dose follows first-order decay: mg remaining = dose × 0.5^(minutes ÷ half-life). The calculator adds up every dose at the time you ask, the same way the CoffeeLog app does.

What is the half-life of caffeine?

On average about 5.7 hours in healthy adults, meaning half the caffeine is gone after ~5.7 hours. It varies widely — smoking, some medications and genetics can move it from roughly 1.5 to 10+ hours.

How much caffeine is too much before bed?

Many people sleep poorly with more than about 100 mg still in their system at bedtime. The calculator marks the latest time you can have a standard cup and still stay under that line.

Is this medical advice?

No. It is an estimate for general information using population-average pharmacokinetics. Individual metabolism varies; talk to a professional for medical concerns.

CoffeeLog · iOS

Track this automatically with CoffeeLog

This site answers the question once. CoffeeLog answers it every day — logging what you drink, showing caffeine fade in real time, and telling you the last cup you can have before it reaches your sleep.

Read next

  1. Last cup before bedCalculators
  2. Safe daily caffeine limitCalculators
  3. Compare two drinksCalculators
  4. Drip coffee — 96 mgCaffeine in…
  5. Red Bull (250 ml) — 80 mgCaffeine in…
  6. Monster Energy — 160 mgCaffeine in…
  7. Espresso (single) — 63 mgCaffeine in…
  8. The caffeine datasetOpen caffeine dataset

TrackCaffeine provides general reference information about caffeine. It is not medical advice. Caffeine values are public-source estimates, not exact measurements.

Track caffeine automatically Get the app