Most people track caffeine by counting cups. That number tells you almost nothing useful. What matters is how much caffeine is currently active in your bloodstream — and that depends on what you drank, when you drank it, and how fast your body processes it. The good news: this is a solved problem in pharmacology. The maths is well understood. Here's exactly how it works.

Why "number of coffees" is a useless metric

A single espresso contains roughly 63mg of caffeine. A large Starbucks filter coffee can contain 330mg. A standard energy drink sits around 160mg. The range across common drinks is enormous — more than 5-fold. Counting "cups" without knowing milligrams is like counting "glasses of alcohol" without distinguishing between a shot of vodka and a glass of beer.

Worse, even knowing total milligrams consumed in a day isn't enough. Caffeine stacks and decays simultaneously. Three coffees spread across 10 hours produce a very different blood level profile to three coffees drunk in two hours. The only way to know your current caffeine level is to model the pharmacokinetics properly.

The pharmacokinetic model: what actually happens

When you drink caffeine, two things happen in sequence: absorption and elimination. They follow different mathematical rules.

Phase 1: Absorption (0 to ~45 minutes)

Caffeine is absorbed through the gastrointestinal tract — primarily the small intestine — with near-100% bioavailability. This means almost all the caffeine you consume ends up in your blood; virtually none is wasted. Absorption is rapid: it begins within minutes of drinking and reaches peak plasma concentration in roughly 30–45 minutes for most people.

During absorption, blood caffeine rises roughly linearly. If you drank 200mg, you're gaining approximately 4.4mg per minute in blood concentration during those 45 minutes. Food in the stomach slows this down; an empty stomach speeds it up.

Phase 2: Elimination (peak onwards)

Once absorption is complete, caffeine is metabolised primarily by the liver enzyme CYP1A2. This follows first-order kinetics, which is a fancy way of saying the rate of elimination is proportional to the current concentration. The result is exponential decay.

The key parameter is the half-life: the time for blood concentration to fall by 50%. For healthy non-smoking adults, this averages 5.7 hours. (See our full guide on caffeine half-life for the variables that affect your personal figure.)

The caffeine level formula

To calculate the caffeine remaining from a single dose at any point in time, you need two phases:

During absorption (t < 45 min):
C(t) = Dose × (t / 45)

After peak (t ≥ 45 min):
C(t) = Dose × (0.5) ^ ((t − 45) / 342)

where t = minutes since drinking, 342 = half-life in minutes (5.7h × 60)

For multiple drinks, you simply sum the active caffeine from each dose at the current time. This is the superposition principle — each dose's decay curve is independent, and the total is the sum. This is what a proper caffeine calculator does, and it's why tracking individual drinks with timestamps is far more accurate than counting total daily intake.

A worked example: a typical weekday

Let's run through a realistic scenario: you drink an espresso (63mg) at 7:30am, a large filter coffee (250mg) at 10:00am, and a can of Coke (34mg) at 2:30pm. What does your caffeine level look like at 10pm?

Drink Dose Time drunk Hours elapsed by 10pm Active at 10pm
Espresso 63mg 7:30am 14.5 hrs ~10mg
Filter coffee 250mg 10:00am 12 hrs ~42mg
Coke 34mg 2:30pm 7.5 hrs ~14mg
Total active caffeine at 10pm ~66mg

66mg at 10pm — with a midnight bedtime, that's a meaningful amount. Sleep researchers generally cite 30mg as the threshold above which sleep architecture is measurably disrupted. You're well above that, and you'd have no idea without running these numbers.

The stacking trap: Each of those drinks felt fine individually. The espresso was hours ago. The Coke was "just a Coke." But their residuals accumulate. This invisible accumulation is the reason many people with good sleep hygiene still sleep badly — they're not accounting for caffeine that doesn't feel active but pharmacologically still is.

What affects the calculation for you personally

The formula above uses a 5.7-hour half-life. Your actual half-life could be anywhere from 2.5 to 10+ hours. The main variables:

  • Genetics: The CYP1A2 gene variant rs762551 splits people into fast metabolisers (~3–4h half-life) and slow metabolisers (~7–9h). Roughly half the population carries the slow variant.
  • Oral contraceptives: Oestrogen inhibits CYP1A2. Women on the pill often have a half-life of 10–12 hours.
  • Smoking: Induces CYP1A2, cutting half-life to around 2.5–3.5 hours.
  • Age: Liver metabolism slows with age; older adults typically process caffeine more slowly.
  • Pregnancy: Half-life can extend to 15+ hours in the third trimester.

If you're a slow metaboliser, the 10pm figure from the example above would be considerably higher. Running the same scenario with an 8-hour half-life gives a 10pm total of approximately 120mg — double the standard estimate.

What counts as "too much" right now?

Peak blood caffeine (right after absorption) of around 1–3 mg/kg of body weight produces the focus and alertness most people are after. Above 6 mg/kg, anxiety, tremor, and elevated heart rate become common. The FDA's 400mg/day guideline is a reasonable rough limit, but it's a daily total — it doesn't account for timing or body weight.

For sleep, the relevant number isn't your total intake but your active level at bedtime. Even 50mg at midnight can measurably reduce slow-wave sleep and REM sleep duration. You can consume 600mg before noon and be fine at midnight; you can consume 100mg at 8pm and still have 50mg active when you lie down.

How to do this calculation automatically

Doing this by hand every day isn't realistic. The calculation involves running an exponential decay formula for each drink you've consumed, at every point in time, and summing them. It's straightforward maths but impractical without tooling.

Caffiend automates exactly this. Log each drink with a timestamp (or just tap when you drink it) and the app maintains a real-time caffeine curve — current blood level, projected decay over the next 12 hours, and a sleep predictor that tells you when you'll drop below your target threshold. It uses the full pharmacokinetic model: the 45-minute absorption ramp, the 5.7-hour exponential decay, and properly stacks multiple concurrent doses.

Track Your Caffeine Level Right Now

Caffiend runs the full pharmacokinetic calculation for every drink you log. See your live caffeine level, your projected curve, and exactly when you'll be clear for sleep.

Open the Caffeine Calculator →