Health & Wellness

Caffeine Half-Life & Sleep Calculator

See how much caffeine is still in your system at lights-out.

Caffeine has a half-life of about 5 hours — meaning a 2 PM espresso still has 75 mg circulating in your bloodstream at 11 PM. The sleep disruption is invisible: you fall asleep fine, but your deep sleep is fragmented, leaving you tired the next day. This calculator traces the caffeine curve from your last sip to your bedtime and tells you when to stop.

Your caffeine today

Caffeine at bedtime
0 mg

Enter your caffeine intake to see how much is in your system at bedtime.

Note: All calculations run in your browser. Nothing is sent to a server, stored, or tracked.

How this calculator works

The math, in plain English

Caffeine works by blocking adenosine receptors in the brain. Adenosine is the chemical that builds up during wakefulness and makes you feel sleepy. When caffeine blocks the receptors, you do not feel the sleepiness — but the adenosine keeps accumulating. When the caffeine clears, all that accumulated adenosine hits at once, producing the afternoon crash.

The half-life

Caffeine's average half-life is 5 hours, but it varies enormously: 3 hours in fast metabolizers, 7+ hours in slow metabolizers, and up to 11 hours in pregnant women and people on oral contraceptives. The CYP1A2 gene determines your metabolism speed; genetic testing can identify your variant. Smokers metabolize caffeine 50% faster; pregnant women metabolize it 50% slower.

A worked example
200 mg coffee at 2 PM, 5-hour half-life, 11 PM bedtime. At 7 PM: 100 mg. At midnight (technically past bedtime): 50 mg. You still have 56 mg circulating when you try to sleep — enough to reduce deep sleep by 20% even if you fall asleep normally.

Why sleep disruption is invisible

Caffeine does not usually prevent sleep onset. Instead, it fragments deep sleep (stages 3 and 4) and reduces total sleep time by 10-30 minutes. You wake up feeling "fine" but slightly tired, reach for more coffee, and the cycle compounds. A 2013 study found that 400 mg of caffeine taken 6 hours before bedtime reduced sleep quality by 20% — even though subjects reported no sleep problems.

When to stop

The general rule: stop caffeine 8-10 hours before bedtime for normal metabolizers, 12+ hours for slow metabolizers. For a 11 PM bedtime, that means no caffeine after 1-3 PM. If you must have an afternoon coffee, switch to half-caf or decaf after 2 PM. The "safe cutoff" in this calculator is based on getting caffeine below 20 mg at your bedtime.

FAQ

Common questions

Why do I sleep fine after a 4 PM coffee?
You may be a fast metabolizer (CYP1A2 variant), or you may be sleep-deprived enough that even fragmented sleep feels "fine." Track your sleep with a wearable for a week while continuing afternoon caffeine, then quit afternoon caffeine for a week. The difference in deep sleep is often dramatic — even if you did not notice it subjectively.
Does caffeine affect everyone the same?
No — there is enormous genetic variation. About 10% of people are fast metabolizers who can drink espresso at 8 PM and sleep fine. About 10% are slow metabolizers for whom a single morning coffee disrupts sleep. The CYP1A2 gene test (available through 23andMe and others) tells you which group you are in. If you do not know, assume you are normal and stop caffeine 8 hours before bed.
Is caffeine bad for you?
For most adults, no — 400 mg/day (about 4 cups of coffee) is the FDA's safe upper limit. Caffeine is associated with reduced risk of Parkinson's, Alzheimer's, type 2 diabetes, and certain cancers. The risks are sleep disruption, anxiety, and dependency (withdrawal headaches). The dose makes the poison; the timing makes the difference.
What about decaf?
Decaf is not caffeine-free. A typical 8 oz decaf contains 2-7 mg (versus 95 mg for regular). For most people, decaf after 4 PM is fine. Swiss Water decaf has the lowest caffeine (1-3 mg); chemical-processed decaf has slightly more. If you are highly sensitive, even decaf after dinner may matter.
Can I build tolerance to caffeine's sleep effects?
Partially. Regular caffeine drinkers experience less subjective stimulation but the sleep disruption persists. Tolerance develops to the alertness effect (which is why you "need" coffee to feel normal) but not to the sleep-disrupting effect. Quitting caffeine for 2-3 weeks resets tolerance; sleep quality often improves dramatically in that period.

Disclaimer: This calculator is provided for educational and informational purposes only. It does not constitute financial, tax, legal, medical, or professional advice. Results depend on the accuracy of the inputs you provide and the assumptions documented above. Always consult a qualified professional before making decisions based on these calculations.