
Caffeine and Sleep: When to Stop Drinking Coffee
How caffeine really works: adenosine blockade, half-life and CYP1A2 genetics, EFSA safe limits, and the evidence-based cut-off time from a 2023 meta-analysis.
Enter your dose and bedtime to see how much caffeine is still in your body when you lie down, and the latest hour you can drink it. Calibrated to a 2023 meta-analysis.
Updated: July 31, 2026 · 🔒 Your data never leaves your browser
For a standard 5-hour half-life, 200 mg of caffeine — a large coffee, a double espresso or two energy drinks — needs about 13 to 14 hours to fall below the level at which studies can still detect an effect on sleep. Drunk at 2 pm, it is still working at midnight.
Or pick a drink
Still in your body at bedtime
What this means: Enough to delay sleep onset and cut slow-wave sleep. Even if you fall asleep quickly, the architecture of your sleep changes.
How the level falls
Half-life. Half the dose is gone by 19:00, and a quarter is still there at 00:00.
⏰ Your cut-off for this dose
To be under 30 mg by bedtime, this dose needs to be finished by 09:19 — 13.7 h before sleep. You are already past that time.
These are averages. Real clearance depends on your CYP1A2 genotype, medication and liver health, and varies several-fold between people.
Caffeine is almost completely absorbed from the gut, peaks in the blood 30 to 60 minutes after you drink it, and is then cleared at a constant proportional rate. That last property is what makes the arithmetic simple: every half-life, whatever is left gets halved again.
The calculator uses the standard one-compartment decay:
Remaining = dose × 0.5 ^ (hours ÷ half-life)
At a 5-hour half-life, 200 mg becomes 100 mg after five hours, 50 mg after ten, and 25 mg after fifteen. There is no point at which caffeine abruptly "wears off" — the phrase describes the moment you stop noticing it, which arrives long before the molecule is gone.
Most caffeine calculators pick a threshold that sounds sensible and never justify it. This one derives it.
The 2023 meta-analysis by Gardiner and colleagues pooled controlled trials to answer a practical question: how many hours before bed does a given dose need to be taken so that sleep is not measurably affected? Two of their answers are 8.8 hours for 100 mg and 13.2 hours for 217 mg.
Put both through the decay equation with a 5-hour half-life and you get the amount still circulating at those cut-offs:
| Dose | Published cut-off | Still in the body at that point |
|---|---|---|
| 100 mg | 8.8 h before bed | 29.5 mg |
| 217 mg | 13.2 h before bed | 34.8 mg |
Two very different doses and two very different cut-off times converge on roughly 30 mg. That is the threshold the calculator uses, which is why its answers track the published guidance instead of competing with it.
The five-hour figure is a population average that hides a very wide spread. The reported range in healthy adults is 2 to 10 hours, and the main driver is the CYP1A2 gene, which controls the liver enzyme responsible for about 95% of caffeine clearance.
Читайте также: Caffeine and Sleep: When to Stop Drinking Coffee
"How long will 200 mg keep me awake" is the most common version of this question, and it deserves a precise answer, because the honest one is not the one people expect.
At a 5-hour half-life, 200 mg falls below 30 mg after 13.7 hours. Drink it at 2 pm and it is still above the threshold at midnight. Drink it at 9 am and you are clear by around 10:45 pm.
But "keep you awake" is the wrong frame. You will very likely fall asleep. The 2013 study by Drake and colleagues gave people 400 mg at bedtime, three hours before bed and six hours before bed, and measured sleep objectively. All three conditions disrupted sleep — including the dose taken six hours ahead, which participants did not perceive as having any effect at all. What caffeine takes from you at that distance is not consciousness. It is deep sleep.
It does not know your genotype, so the half-life you pick is a category rather than a measurement. It does not model tolerance, adenosine receptor upregulation, or the interaction with alcohol. It assumes a single dose rather than a day of sipping — for several drinks, add up the doses and use the time of the last one, which slightly understates the total.
And it says nothing about whether caffeine is a problem for you. If you sleep seven to eight hours, wake unprompted and function without a morning dose to feel normal, the number in this calculator is a curiosity. If you need coffee to start and cannot switch off at night, it is the loop worth breaking — and moving the cut-off earlier is the cheapest intervention available.
Around 13–14 hours for a typical adult. After 5 hours you still have 100 mg on board — a full cup of coffee's worth — and after 10 hours, 50 mg. The 2023 meta-analysis by Gardiner and colleagues found that doses of 217 mg needed to be taken 13.2 hours before bed to avoid measurable disruption to sleep. That does not mean you lie awake for 13 hours; it means the dose is still shortening your deep sleep at the point you go to bed.
Five hours is the population average, not your number. The reported range in healthy adults is 2 to 10 hours, driven mostly by the CYP1A2 gene. Smoking nearly halves the half-life, hormonal contraceptives roughly double it, and by the third trimester of pregnancy it can exceed 15 hours. The calculator lets you pick the closest profile, but only a genuine test would give you your own figure.
It is reverse-engineered from the evidence rather than picked by feel. The 2023 meta-analysis puts the practical cut-off at 8.8 hours for 100 mg and 13.2 hours for 217 mg. Run both through a 5-hour half-life and the amount left at bedtime is 29.5 mg and 34.8 mg — essentially the same number. So a single 30 mg threshold reproduces both published cut-offs.
It means it does not affect how quickly you fall asleep, which is the one part of sleep you can actually perceive. Controlled studies consistently show reduced slow-wave sleep and lower delta power in people who report no difference at all. Your sense of how you slept is a poor instrument for measuring how you slept.
EFSA considers up to 400 mg a day safe for healthy adults, and up to 200 mg in a single dose. During pregnancy and breastfeeding the limit is 200 mg a day in total. For children and adolescents the reference point is roughly 3 mg per kg of body weight.
No, and no calculator honestly can. Tolerance to the alerting effect develops within days, but tolerance to the sleep-disrupting effect is much less complete — which is why habitual drinkers still show measurably worse sleep architecture. Assume the pharmacokinetics apply to you regardless of how many years you have been drinking coffee.

How caffeine really works: adenosine blockade, half-life and CYP1A2 genetics, EFSA safe limits, and the evidence-based cut-off time from a 2023 meta-analysis.

Sleep hygiene rules sorted by strength of evidence: what genuinely improves sleep, what is oversold, and why chronic insomnia needs CBT-I instead.

How chronic insomnia is diagnosed, why your compensations keep it going, and what CBT-I involves — the first-line treatment recommended by the AASM and the ACP.