Caffeine Half-Life Calculator

How much of today's caffeine is still in your system at bedtime, and the latest hour you could have had it.

In short

Caffeine has a half-life of about five to six hours, so half of an afternoon coffee is still in your system five hours later and a quarter after ten. A 200 mg coffee at 4pm leaves roughly 100 mg at 9pm, which is about the amount in a fresh espresso, and that is enough to measurably reduce deep sleep.

What you drank

Still in your system at bedtime

—

—
Total today
—
Cut-off time
—
Fully cleared by
—
Of the 400 mg limit

Through the day

Caffeine in common drinks

Last reviewed

Runs entirely in your browser. Nothing you type here is uploaded, stored or logged.

Half-life, and why it matters more than the dose

Caffeine is eliminated by first-order kinetics, which means a constant proportion is removed per unit time rather than a constant amount. The half-life for a typical healthy adult is around five to six hours.

remaining = dose × 0.5 ^ (hours elapsed ÷ half-life)

Work through a 200 mg coffee at 4pm with a 5.5 hour half-life:

9:30pm   (5.5 h)   100 mg    still a full espresso
3:00am  (11 h)      50 mg
8:30am  (16.5 h)    25 mg    before you have had today's

The uncomfortable implication is that if you drink coffee daily, you probably never return to zero. There is a residual level from yesterday sitting underneath today's dose.

What it does to sleep

The most quoted study on this gave participants 400 mg at three points before bed: zero, three and six hours. All three conditions reduced total sleep time significantly compared with placebo, including the dose taken a full six hours before bedtime, which cut sleep by more than an hour.

The finding that should change behaviour is what participants reported. Their own assessments of sleep disruption did not match the objective measurements. People taking caffeine six hours before bed largely did not notice the effect, while the recordings showed it clearly.

So "caffeine doesn't affect my sleep" is not good evidence that caffeine is not affecting your sleep. It is exactly what the affected group reported.

The damage is concentrated in deep slow-wave sleep, the stage that does most of the physical recovery. Total time in bed can look normal while the composition is worse, which produces the pattern of sleeping eight hours and waking unrefreshed.

How caffeine actually works

It does not create energy. It blocks the perception of tiredness.

Adenosine accumulates in the brain through the day and binds to receptors that promote sleepiness. Caffeine is shaped closely enough to adenosine to occupy those receptors without activating them, so the tiredness signal is muted while the underlying sleep pressure keeps building.

When the caffeine clears, all that accumulated adenosine is still there and binds at once. That is the afternoon crash, and it is why a second coffee to fix it works and a third works less well.

Tolerance, and what a morning coffee is really doing

With regular use the brain increases its number of adenosine receptors, so a given dose blocks a smaller proportion of them. This is why the effect fades over a few weeks of daily use.

The consequence is more interesting than it first sounds. In a habitual drinker, overnight abstinence produces mild withdrawal: headache, fog, low alertness. The morning coffee relieves that withdrawal and returns you to baseline, rather than lifting you above it.

Studies comparing habitual consumers on caffeine against non-consumers find much smaller differences in alertness than either group expects. The lift is genuine mainly for people who have not built tolerance, and after a break of a week or two, which is roughly how long receptor levels take to normalise, it returns.

Why your friend can drink espresso at 10pm

Metabolism varies enormously, and most of it is one enzyme.

  • CYP1A2 genotype. Fast metabolisers clear caffeine in as little as two to three hours. Slow metabolisers take eight or more. This is a single common variant and it splits the population substantially.
  • Smoking roughly halves the half-life by inducing the same enzyme, which is why people who quit often find their usual coffee intake suddenly feels excessive.
  • Pregnancy can extend the half-life to 10 to 15 hours in the third trimester, which is a large part of why the guideline is halved to 200 mg.
  • Oral contraceptives can roughly double it.
  • Liver function and some medications, including certain antibiotics and antidepressants, slow it further.

If coffee after lunch reliably wrecks your night while a colleague drinks it at nine, you are probably not being precious. You are probably a slow metaboliser.

Practical adjustments

Set a cut-off and treat it as fixed. Eight to ten hours before bed is a reasonable default. Use the figure above rather than a rule of thumb if your intake is large.

Delay the first cup. Cortisol is naturally high on waking, so caffeine then adds relatively little. Waiting an hour or two after getting up produces a more noticeable effect from the same dose.

Watch the hidden sources. Green tea, cola, energy drinks, dark chocolate, pre-workout supplements and some painkillers all contain caffeine, and a large energy drink can carry more than two coffees.

Taper rather than quit abruptly. Withdrawal headaches peak at 24 to 48 hours and can last a week. Reducing by a quarter every few days avoids most of it.

Frequently asked questions

How long does caffeine stay in your system?

The half-life is about five to six hours for most adults, so half remains after five hours, a quarter after ten and an eighth after fifteen. Full clearance takes over 24 hours, which is why a late-afternoon coffee can still be measurable at bedtime.

When should I stop drinking coffee?

A common rule is eight to ten hours before bed, though it depends on the dose. A controlled trial found 400 mg taken six hours before bed reduced total sleep time by over an hour, and participants did not notice the disruption. For a 10pm bedtime, stopping by early afternoon is a reasonable target.

How much caffeine is safe?

Health authorities generally put the limit at 400 mg a day for healthy adults, about four cups of filter coffee. Pregnancy guidance is 200 mg. Adolescents are usually advised to stay under about 100 mg, and children considerably less.

Why does caffeine stop working?

Regular use increases the number of adenosine receptors, so more caffeine is needed for the same effect. Once tolerance is established, much of what a morning coffee does is relieve overnight withdrawal rather than provide a genuine lift above baseline.

Does caffeine affect everyone the same way?

No, and the differences are large. A variant of the CYP1A2 gene splits people into fast and slow metabolisers, with half-lives ranging from roughly two hours to over eight. Smoking halves the half-life; pregnancy and some oral contraceptives can double or triple it.

Is caffeine bad for you?

For most healthy adults, moderate intake appears neutral to mildly beneficial, and coffee consumption is associated with slightly lower all-cause mortality in large observational studies. The clearest downside is sleep disruption, which is real, dose-dependent and frequently unnoticed by the person experiencing it.