THE BALLAST PRINCIPLE

Caffeine Half-Life Calculator

Strong evidence

Caffeine half-life calculator: enter your coffee and timing to see how many mg are still in your system at bedtime, with fast/slow metabolizer settings.

For information, not medical advice. This tool is provided as-is for general wellness and educational use. It doesn't diagnose or treat anything, its results are estimates to sanity-check against your own judgment, and we accept no liability for decisions made from it. Everything runs on your device. If something feels off, talk to a professional.

Today's caffeine

at

18 mg at bedtime

Effectively clear — caffeine is unlikely to be a factor in tonight’s sleep.

Understand this tool — what it does and how to use it

What it is

How many milligrams of caffeine are still circulating at tonight’s bedtime, given everything you drank today and when.

How it works

Each dose decays exponentially — half clears every half-life (about 5 hours typically, 3 for fast metabolizers, 8 for slow). The tool decays each drink separately from the time you had it and sums the leftovers at bedtime.

Getting the most from it

  1. Log the whole day honestly, including the tea and the energy drink.
  2. Set the metabolizer speed that matches your lived experience with evening coffee.
  3. Experiment: move your last drink earlier and watch the bedtime number fall.

Reading your result

Under ~20 mg is effectively clear; 100+ mg means a full cup is still on board at lights-out — enough to thin the night’s deep sleep even if you fall asleep fine.

What it can't tell you

A population model, not a blood test — pregnancy and some medications can more than double clearance time. Use it to compare timings, not as a clinical readout.

What this calculator estimates

Add the drinks you've had today and when you had them, set tonight's bedtime, and the tool tells you roughly how many milligrams of caffeine are still in your bloodstream when you lie down. It does this by modeling exponential decay on each dose separately from the moment you drank it, then summing what's left.1

That's the number that matters for sleep. Not how much caffeine you consumed, and not whether you still feel it — but how much is chemically present at lights-out, quietly working against the deep sleep you're counting on.

The half-life, and why the afternoon coffee lingers

Caffeine's half-life in a typical adult is about 5 hours — the time to clear half a dose.1 The calculator's "typical" setting uses this. The catch with a five-hour half-life is how slowly the tail decays. Take a 140 mg drip coffee at 8 AM:

TimeCaffeine remaining (≈5 h half-life)
8:00 AM (drink)140 mg
1:00 PM70 mg
6:00 PM35 mg
11:00 PM~17 mg

That's from a morning coffee. Now picture the 2 PM pick-me-up so many of us reach for: at an 11 PM bedtime, well over half of it is still on board. You won't feel jittery — the subjective buzz fades long before the molecule does — but a controlled study found caffeine taken even 6 hours before bed measurably cut total sleep.2 The feeling of being "over it" is not the same as being clear of it.

This is why the tool's advice at higher levels is so specific: the highest-leverage move is usually the same total caffeine, but nothing after early afternoon.

Individual variation: CYP1A2 and the metabolizer setting

Here's why blanket rules fail. Most caffeine is broken down by a single liver enzyme, CYP1A2, and a common variation in the gene that codes for it splits people into fast and slow metabolizers.3 The spread is large:

  • Fast metabolizer (~3 h half-life): clears caffeine quickly; an afternoon coffee is often genuinely fine.
  • Typical (~5 h): the standard assumption.
  • Slow metabolizer (~8 h): caffeine hangs on; a lunchtime coffee can still be a third present at midnight.

The calculator lets you pick, because the same espresso is a nonevent for one person and a wrecked night for another.4 If you've never been sure which camp you're in, the tell is simple: people who "can drink coffee at dinner and sleep fine" are usually fast metabolizers; people wired by a 3 PM cup are usually slow. Set it honestly and the bedtime number will fit your actual experience.

Several things push clearance toward the slow end regardless of genes, and the tool notes them: pregnancy (which can more than double the half-life), oral contraceptives, and some medications all slow it down; smoking speeds it up. If any of those apply, lean slow and treat the estimate as a minimum.

The loop with sleep debt

Caffeine and sleep debt feed each other, and it's worth being clear-eyed about it. When you're short on sleep, caffeine blocks the adenosine that signals tiredness — so you feel capable while your reaction time and judgment are still impaired. It masks the debt; it never pays it.

Then the residue you can now see in this calculator lightens and fragments the night's sleep, which grows the debt, which sends you back to the pot tomorrow a little earlier and a little stronger. Round it goes.

If you recognize that pattern, the caffeine number here is only half the picture. Run your last seven nights through the sleep debt calculator to see what you're actually masking — the fix is often to pay down the debt so you need less caffeine, not to time the caffeine more cleverly. And once the last dose is early enough, the sleep cycle calculator helps you spend the recovered night well.

How to use the number

  • If bedtime shows "clear" (under ~20 mg): caffeine is unlikely to be tonight's problem. Look elsewhere — the scroll before bed, the racing mind, the room temperature.
  • If it shows light to moderate (~20–100 mg): you'll probably fall asleep, but the sleep may run lighter and more broken than it should. Nudge your last dose 2–3 hours earlier and re-check.
  • If it shows high (100 mg+): that's a full cup or more still circulating at lights-out — enough to delay sleep onset and cut deep sleep. Move the afternoon dose to the morning and watch the number collapse.

One honest limit: this is a population model, not a blood test. It can't see your exact enzyme activity, today's food, or the precise caffeine in a café's pour. Use it to spot patterns and compare timings — "my 3 PM coffee leaves 90 mg at bedtime, my noon one leaves 45" — rather than as a clinical readout. For that purpose, comparing your own scenarios, it's genuinely useful.

Caffeine is one of the few sleep levers you fully control, and it's the one most people are quietly getting wrong by an hour or two. This tool exists to find that hour.

Footnotes

  1. IOM, 2001 — caffeine pharmacology and half-life. 2

  2. Drake et al., 2013 — caffeine 6 hours before bed still reduced sleep.

  3. Cornelis et al., 2006 — CYP1A2 genotype and caffeine metabolism.

  4. Nehlig, 2018 — interindividual differences in caffeine metabolism.

Frequently asked questions

What is caffeine’s half-life?+

A half-life is the time it takes your body to clear half of a dose. For caffeine in a typical healthy adult it’s about 5 hours. So if you drink 140 mg at 8 AM, roughly 70 mg is left at 1 PM, about 35 mg at 6 PM, and around 17 mg at 11 PM. This slow decay is why an afternoon coffee can still be working at bedtime even when you feel wide awake and "over" it.

How does this caffeine calculator work?+

Pick your drinks and the times you had them, set tonight’s bedtime, and choose your metabolizer speed. The tool applies exponential decay to each dose from the time you drank it to bedtime, then adds the leftovers together. The result is the estimated milligrams of caffeine still circulating when your head hits the pillow — the number that matters for sleep.

What time should I stop drinking caffeine?+

A common, well-supported rule is nothing caffeinated within about 6 hours of bed, and for sleep-sensitive people, an early-afternoon cutoff — say 2 PM for an 11 PM bedtime. The calculator lets you test your own timing instead of guessing: move your last drink earlier and watch the bedtime number fall. The single highest-leverage change is usually keeping the same total caffeine but taking none of it after early afternoon.

Why does caffeine affect some people so much more than others?+

Largely genetics. The liver enzyme CYP1A2 does most of the work clearing caffeine, and a common gene variant makes people either fast or slow metabolizers. Slow metabolizers can take 8+ hours to clear half a dose; fast ones around 3. That’s why the calculator offers fast, typical, and slow settings — the same coffee can be harmless for one person and sleep-wrecking for another.

What else changes how fast I clear caffeine?+

Plenty. Pregnancy dramatically slows clearance (half-life can roughly double or more). Oral contraceptives and some medications also slow it. Smoking speeds it up. Liver health and age matter too. If you’re pregnant or on medication that interacts, lean toward the slow setting and treat the result as a floor, not a ceiling.

How does caffeine interact with sleep debt?+

They form a nasty loop. Caffeine masks sleep debt during the day, so you feel functional while still impaired — then its residue lightens and fragments the sleep you finally get, deepening the debt, which makes you reach for more caffeine tomorrow. Caffeine can hide the symptom but never pays the debt. If you’re leaning on it to get through, check the real balance with the sleep debt calculator.

References

  1. Institute of Medicine (US) Committee on Military Nutrition Research. Pharmacology of caffeine. In: Caffeine for the Sustainment of Mental Task Performance. National Academies Press; 2001. [link]
  2. Drake C, Roehrs T, Shambroom J, Roth T. Caffeine effects on sleep taken 0, 3, or 6 hours before going to bed. J Clin Sleep Med. 2013;9(11):1195-1200. [link]
  3. Cornelis MC, El-Sohemy A, Kabagambe EK, Campos H. Coffee, CYP1A2 genotype, and risk of myocardial infarction. JAMA. 2006;295(10):1135-1141. [link]
  4. Nehlig A. Interindividual differences in caffeine metabolism and factors driving caffeine consumption. Pharmacol Rev. 2018;70(2):384-411. [link]