Skip to main content
Snerva

LIFESTYLE — CAFFEINE

How long does caffeine stay in your system?

A 2pm coffee still has measurable activity at midnight for most people. The math is unforgiving once you see it.

Most caffeine guidance is folklore. "Don't drink coffee after 2pm" is a useful rule of thumb, but the actual answer to how long caffeine affects you depends on a small number of variables that almost nobody applies to their own case.

This piece does the pharmacokinetics out loud. Once you can do the math, you can pick a cutoff that fits your body — not a generic one that fits no one.

A day-long curve showing caffeine's long half-life still active at bedtime12am6am12pm6pm12am
Marco Diversi
By Marco Diversi · Founder of SnervaPublished May 20, 2026

How caffeine actually moves through your body

Caffeine is a small, lipophilic molecule. It crosses the blood-brain barrier within minutes and binds to adenosine A1 and A2A receptors, blocking the inhibitory signal that adenosine sends to wakefulness-promoting neurons (Fredholm 1999). The subjective "alertness" of caffeine is the absence of adenosine pressure, not a stimulant push — a distinction that matters when you try to reason about residuals.

Peak plasma concentration arrives 30–60 minutes after oral intake (Tmax). Absorption is essentially complete; oral bioavailability sits near 100%, with no clinically meaningful first-pass loss.

From peak, caffeine clears via first-order kinetics — meaning a constant fraction is eliminated per unit time, not a constant amount. That's what creates the half-life behavior: a 200mg dose drops to 100mg in 5 hours, 50mg in 10 hours, 25mg in 15 hours.

Almost all caffeine metabolism happens through the hepatic CYP1A2 enzyme. CYP1A2 activity is highly variable between individuals — twin studies put the genetic contribution at roughly 50%. The other half is environmental: smoking induces CYP1A2 (~50% faster clearance), pregnancy suppresses it (up to 3× slower in the third trimester), oral contraceptives also slow it. We come back to these in the variability section.

The 5-hour rule, and why "6 hours before bed" still isn't enough

The 5-hour median half-life is the number to memorize. It generates the only useful arithmetic you need: roughly half the dose remaining after 5 hours, a quarter after 10, an eighth after 15.

Drake 2013 ran the controlled trial that everyone cites and few people read carefully. Subjects took 400mg of caffeine zero, three, or six hours before bedtime. The zero-hour and three-hour conditions wrecked sleep — predictably. The six-hour-before-bed condition still reduced total sleep time by 64 minutes versus placebo. Sleep onset latency climbed; wake-after-sleep-onset climbed; subjective sleep quality dropped.

The headline implication: "avoid caffeine within 6 hours of bedtime" is not a conservative rule. It's an aggressive one. For most adults, a meaningfully protective cutoff is 8–10 hours before bed — 1pm or 2pm for an 11pm bedtime, earlier if you're a slow metabolizer.

INTERACTIVE TOOL

Find your caffeine cutoff time

Work out the latest you can have caffeine without a meaningful dose still circulating at bedtime. Based on caffeine's roughly five-to-six-hour half-life.

Open the calculator →

Why your friend can drink espresso at 9pm and you can't

The 5-hour half-life is a median. Individual half-life in healthy adults runs from roughly 2 hours to 12 hours. Three categories are useful for self-calibration.

Fast metabolizers (≈25% of adults)

Half-life 2–4 hours. Usually carry the CYP1A2 *1F variant homozygous, or are smokers. Coffee at 6pm is genuinely tolerable; the metabolite levels at midnight are minimal. Caveat: even fast metabolizers can be acutely sensitive to caffeine — clearance and pharmacodynamic sensitivity are independent.

Average metabolizers (≈50%)

Half-life 4–6 hours. Most people sit here. The standard advice (cut caffeine 8 hours before bed) is calibrated for this group. A 2pm cup is the practical safe ceiling for an 11pm bedtime; a 3pm cup measurably fragments deep sleep.

Slow metabolizers (≈25%)

Half-life 7–12 hours. Often unaware they're in this group because subjective sleepiness still arrives at bedtime — but sleep architecture is degraded. Pregnant women in the third trimester, women on combined oral contraceptives, and people on certain SSRIs (fluvoxamine in particular) usually fall here. For this group, even a 10am coffee can have measurable bedtime residuals.

Modulators worth knowing: smoking accelerates clearance by ~50% (one of the few mechanisms by which quitting smoking can transiently worsen sleep). Oral contraceptives roughly halve CYP1A2 activity. Pregnancy slows clearance progressively across trimesters. Liver disease and alcohol both slow clearance. Some quinolone antibiotics (ciprofloxacin) inhibit CYP1A2 and can double caffeine half-life — relevant during short courses.

Cutoff times by target bedtime

Pick the bedtime row, read across to your metabolizer band, and use the resulting cutoff as your default. If you don't know your band, treat yourself as an average metabolizer (most are) and adjust later if sleep onset stays slow.

Last caffeine, by bedtime

BedtimeFastAverageSlow
10pm4pm2pm11am
11pm5pm3pm12pm
12am6pm4pm1pm
1am7pm5pm2pm

These cutoffs target residuals below ~30mg at bedtime, the rough threshold below which Drake-style sleep effects are not consistently detectable. They're not absolute. A small espresso (~64mg) at the cutoff is genuinely different from a large cold brew (~250mg) at the cutoff.

What this won't fix

Cutting afternoon caffeine helps if caffeine is part of your insomnia. If your sleep problem is sleep-onset anxiety, sleep-maintenance hyperarousal, an undiagnosed circadian phase delay, or a substance issue (alcohol, late nicotine, prescription stimulants), changing the coffee cutoff will produce a measurable but small effect — typically 10–20 minutes of sleep-onset latency reduction. Not transformative.

It also won't fix the dependence side of the equation. If you reach for a coffee at 7am because the morning otherwise hurts, you're probably running on net negative adenosine pressure from chronic short sleep. The fix there is total sleep time, not better caffeine timing.

And it won't undo a single late afternoon coffee on a single bad night. Sleep architecture is sensitive to the residual that hits the first 90 minutes — by 3am the caffeine is mostly cleared, but the early-night fragmentation has already cost you the deepest slow-wave.

The broader piece on caffeine and sleep covers the 2pm rule, the wired-but-tired phenomenon, and the morning-coffee-vs-cortisol question that most articles get wrong.

If your problem is waking at the same hour every night rather than slow sleep onset, the relevant piece is can't sleep at 3am.

Late-day caffeine compounds the 3am cortisol awakening pattern by raising sympathetic tone into the second half of the night; the two pieces fit together.

Caffeine and alcohol both interact with adenosine and both fragment sleep — alcohol's specific effect on sleep architecture covers the other half of the puzzle.

If you've cut caffeine and the racing thoughts persist, mind racing at bedtime covers the cognitive-arousal pattern that caffeine sometimes triggers but rarely causes alone.

When caffeine is dialed in but the brain still won't switch off in bed, stimulus control therapy is the protocol that rebuilds the bed-sleep association.

Chronic caffeine reliance is often a downstream symptom of sleep debt — sleep restriction therapy handles the root pattern.

Magnesium can blunt some of the residual sympathetic effects of late caffeine — see magnesium forms for sleep for which compound fits.

The full set of substance-and-sleep articles lives at the lifestyle and hygiene hub.

FAQ

Does decaf coffee count?

Decaffeinated coffee in the US contains roughly 2–5mg of caffeine per 8-ounce cup. One decaf is below the threshold for sleep effects; three decafs in the afternoon equals about one regular cup. Specialty "half-caf" drinks at chain coffee shops are closer to 60–80mg per medium — count them as regular coffee.

What about energy drinks, pre-workouts, and theine in tea?

Energy drinks deliver 80–200mg per can; some pre-workouts hit 300–400mg per serving and are the single most common cause of "I can't sleep at night" complaints in adults who exercise late. Black tea has 40–60mg, green tea 25–45mg, matcha 60–80mg. Theine is just caffeine — the same molecule, different historical name.

Is caffeine OK while breastfeeding?

Caffeine crosses into breast milk at roughly 1% of the maternal dose. Newborns metabolize caffeine extremely slowly (half-life >50 hours at birth, dropping to adult levels by ~5 months). The American Academy of Pediatrics considers up to 300mg/day generally compatible. If a baby seems unusually wakeful or fussy, dropping maternal caffeine for 5–7 days is a clean diagnostic test.

How long does caffeine withdrawal last if I stop?

Symptoms (headache, fatigue, irritability, low mood) typically start 12–24 hours after the last dose, peak at 24–48 hours, and resolve within 5–9 days (Juliano & Griffiths 2004). Tapering by 25% per week is more comfortable than cold turkey; cold turkey works but produces a worse week 1.

Does adenosine "build up" while I sleep — is morning coffee fighting that?

Adenosine accumulates during waking hours and is partially cleared during sleep, particularly slow-wave sleep. Morning coffee occupies adenosine receptors that already have low ligand binding — which is why morning caffeine produces the most alertness gain per milligram. Late-day caffeine occupies receptors that are now competing with rising adenosine pressure; the subjective effect is smaller, but the sleep cost is larger.

Sources

  1. Fredholm BB, Bättig K, Holmén J, Nehlig A, Zvartau EE. Actions of caffeine in the brain with special reference to factors that contribute to its widespread use. Pharmacological Reviews 1999.
  2. Drake C, Roehrs T, Shambroom J, Roth T. Caffeine effects on sleep taken 0, 3, or 6 hours before going to bed. Journal of Clinical Sleep Medicine 2013.
  3. Institute of Medicine. Caffeine for the sustainment of mental task performance. National Academies Press 2001 — chapter on CYP1A2 polymorphism and individual variation.
  4. Juliano LM, Griffiths RR. A critical review of caffeine withdrawal. Psychopharmacology 2004.
  5. Killgore WDS, Kahn-Greene ET, Grugle NL, Killgore DB, Balkin TJ. Sustaining executive functions during sleep deprivation: A comparison of caffeine, dextroamphetamine, and modafinil. Sleep 2009.