Biohacking
Caffeine and Sleep: When to Stop Drinking Coffee for Perfect Sleep
Why a 4 PM espresso and a 9 AM espresso aren't the same molecule. Inside the pharmacokinetics that decide whether your last cup will wreck your sleep — and how to time it.

Free online tool
Caffeine half-life
Coffee at 4 PM and coffee at 9 AM aren't the same molecule. Caffeine doesn't behave like a switch — it lingers in your bloodstream for hours, clearing out at a rate that depends on your genetics, hormones, age and habits. Understanding your personal half-life is the difference between a strong afternoon and a fragmented night.
This guide explains the pharmacokinetics behind every cup, the six factors that can change your individual half-life by 2× to 3×, and what the research actually says about caffeine and sleep — so you can use the calculator above to time your last cup with confidence.
How caffeine reaches your brain
Caffeine is absorbed almost completely (≈99% bioavailability) within 30 to 45 minutes of swallowing. It is lipid-soluble enough to cross the blood-brain barrier easily, where it blocks adenosine receptors — the molecule responsible for the buildup of sleep pressure throughout the day.
The result: you don't get a stimulant 'boost' so much as a temporary cancellation of fatigue your body has been accumulating. When caffeine wears off, that adenosine is still there, waiting — which is why heavy mid-day drinkers often crash hard in the late afternoon.
Key pharmacokinetic numbers
Peak plasma concentration
30–60 min after intake
Baseline half-life (healthy adult)
≈5 hours
Volume of distribution
≈0.5 L per kg body weight
Oral bioavailability
≈99%
Why your half-life isn't 5 hours
Five hours is the textbook average. Almost no one is exactly average. Six published modifiers can move your half-life from as low as 2.5 h (heavy smoker) to as high as 15 h (advanced liver disease) — a six-fold range that explains why your friend can drink an espresso at 8 PM and sleep fine while you're still wired at midnight from a 4 PM americano.
Documented half-life modifiers
Heavy smoking ×0.55
Cigarette smoke induces the CYP1A2 liver enzyme that breaks down caffeine, cutting half-life almost in half (Faber & Fuhr 2004, PMID 15289794).
Estrogen contraceptives ×1.80
Oestrogen-based oral contraceptives inhibit caffeine metabolism, nearly doubling half-life (Abernethy & Todd 1985, PMID 4029248).
Pregnancy 3rd trimester ×2.50
Caffeine clearance falls sharply in late pregnancy — half-life can reach 12+ hours (Knutti et al. 1981, PMID 7341280).
Age ≥65 ×1.20
Slower hepatic blood flow and reduced enzyme activity extend half-life by ~20% in older adults (Blanchard & Sawers 1983).
Liver impairment ×3.00
Cirrhosis and chronic hepatitis can triple caffeine half-life by impairing CYP1A2 capacity.
CYP1A2 slow variant ×1.50
Roughly 10% of the population carries the slow CYP1A2 polymorphism (Cornelis et al. 2006 JAMA, PMID 16522833), making them more susceptible to evening caffeine.
If two of these apply to you simultaneously (e.g. a female smoker on contraceptives), the modifiers multiply. Your real half-life can be very different from the textbook 5 hours — that is exactly what the calculator above accounts for.
What the science says about caffeine and sleep
The Drake et al. 2013 study in the Journal of Clinical Sleep Medicine settled an ongoing debate: even a 400 mg dose taken six hours before bed produced significant sleep disturbance — total sleep time dropped by more than one hour and sleep efficiency fell — despite participants reporting they 'didn't feel' the caffeine.
The 2017 systematic review by Clark and Landolt confirmed the dose-dependent pattern: residual plasma concentrations above roughly 3 mg/L at bedtime reliably reduce slow-wave sleep, while concentrations under 0.5 mg/L produce no measurable effect in most adults.
Bedtime concentration thresholds
< 0.5 mg/L
Minimal — no measurable effect
0.5–1.5 mg/L
Mild — possible delayed onset
1.5–3 mg/L
Moderate — measurable architecture loss
> 3 mg/L
Significant — Drake-grade disruption
How to use this strategically
The calculator at the top of this page applies your personal modifiers to predict bedtime concentration. Enter a typical dose (espresso ≈80 mg, drip coffee ≈95 mg, energy drink ≈80 mg, tea ≈47 mg), the time you consumed it, your weight, age, smoking status, hormonal context and liver health. The output is your residual mg/L at the chosen bedtime plus the cutoff hour at which residual drops below 0.5 mg/L.
Three rules of thumb
Stop 8 hours before bed if you have an average half-life
A 200 mg dose taken 8 hours before bed leaves a residual of ≈0.6 mg/L — barely mild.
Double the buffer if you metabolize slowly
If you're on hormonal contraceptives, you know you have the slow CYP1A2 variant, or your liver is compromised, give yourself 12+ hours.
Move large doses earlier, not later
If you need 400 mg today, take it at 9 AM. It'll mostly clear by midnight, even with average metabolism.
Your last coffee of the day matters more than how much total caffeine you drank. A morning latte and a 4 PM espresso of equivalent caffeine content do not cost the same in sleep currency.
When you should be especially careful
Pregnancy is the modifier that most often surprises people: in the third trimester, caffeine clearance falls so dramatically that the textbook 5-hour half-life can stretch to 12 hours or more. The American College of Obstetricians and Gynecologists recommends keeping intake under 200 mg per day during pregnancy, partly because the developing fetus clears caffeine that crosses the placenta even more slowly than the mother.
If you're on hormonal contraceptives containing estrogen, your half-life roughly doubles. Combined with a heavy afternoon habit, that's a recipe for chronic sleep debt that's hard to attribute to its cause.
This calculator estimates plasma concentration based on published pharmacokinetic models. It is an educational tool, not a medical diagnostic. If caffeine is interfering with your sleep despite reasonable timing, talk to a doctor — there may be an unrelated underlying cause.
Bottom line
Caffeine half-life is not a constant. Your genes, age, hormonal status, smoking habits and liver function combine to give you a personal number that may be very different from the textbook five hours. Use the calculator above to find yours, time your last dose accordingly, and your sleep will tell you the experiment was worth it.
Sources
- Drake C et al. (2013). Caffeine effects on sleep taken 0, 3, or 6 hours before going to bed. J Clin Sleep Med 9(11):1195-1200.
- Clark I, Landolt HP (2017). Coffee, caffeine, and sleep: A systematic review of epidemiological studies and randomized controlled trials. Sleep Medicine Reviews 31:70-78.
- Faber MS, Fuhr U (2004). Time response of cytochrome P450 1A2 activity on cessation of heavy smoking. Clin Pharmacol Ther 76(2):178-184.
- Abernethy DR, Todd EL (1985). Impairment of caffeine clearance by chronic use of low-dose oestrogen-containing oral contraceptives. Eur J Clin Pharmacol 28(4):425-428.
- Cornelis MC et al. (2006). Coffee, CYP1A2 genotype, and risk of myocardial infarction. JAMA 295(10):1135-1141.


