The calculator
Bedtime in, last-coffee time out, with an optional log of everything you drank today and a live decay curve. Set your own half-life and bedtime target, or just use the defaults (5.5 h half-life, 50 mg at bed). All of it runs 100% in your browser, no sign-up, nothing uploaded.
Enter your bedtime and cup size.
Your caffeine decay curve
Stacked exponential decay of every logged dose against your bedtime target. All computed on your device, nothing leaves the page.
The math it uses
where H is half-life in hours, T is when the drink is finished, and target is the maximum caffeine you accept at bedtime. Multiple doses sum: each dose decays independently from its own finish time.
How to use your cutoff
- The cutoff is per drink. A 160 mg energy drink cuts off hours earlier than a 64 mg espresso shot; pick your actual cup above.
- Use the dose log before your afternoon order. If you're already over your bedtime target, the calculator tells you; that's the afternoon decision made for you.
- Know you're slow or fast? Set your own half-life. Afternoon-anything wrecks some sleepers because they clear caffeine near the 12-hour end of the range; fast metabolizers sit near 3–4 hours.
- It's an estimate, not a prescription. The model simplifies real caffeine absorption, and nothing here is medical advice.
Caffeine half-life, explained
A caffeine half-life is the time your body takes to clear half of the caffeine in your blood. In healthy adults it averages roughly 5–6 hours (one clinical study reported a mean of 5.7 hours). That's the number the calculator defaults to.
But the same cup isn't the same for everyone. The Sleep Foundation cites a 2–12 hour range: your genes, age, whether you're pregnant, medications you take, and your liver health all move the number. Some people clear caffeine near the fast end; others are up at the slow end wondering why a noon coffee still has them wired at midnight.
One more wrinkle people miss: one half-life doesn't mean "worn off." After one half-life, half the dose is still active; after two, a quarter is still there. It takes about five half-lives (~27–30 hours at the default 5.5 h) before caffeine is essentially gone (about 3% remaining).
And that matters for sleep. A study published in the Journal of Clinical Sleep Medicine (Drake et al.) found that a fixed dose of caffeine taken 6 hours before bed still measurably reduced total sleep; the researchers recommend avoiding substantial caffeine for a minimum of 6 hours prior to bedtime.
Peak blood levels arrive 1–2 hours after ingestion, so the "finish your drink" time you enter in the calculator is the right anchor: the decay curve starts there.
How long does 200 mg of caffeine take to wear off?
Here's a 200 mg dose (a strong coffee or a standard energy drink) dying out at a 5.5-hour half-life:
Computed at the 5.5 h default; the curve compresses or stretches with your own half-life. Drag it in the calculator and watch.
The practical version: a 2 PM 200 mg coffee leaves ~69 mg in your system at 10:30 PM, more than a full espresso shot in bed with you. Move it to 4 PM and ~88 mg is still there, nearly half the original cup. (Model estimates at 5.5 h.) The decay chart at the top runs the same calculation on your own doses.
What is the 2-hour coffee rule?
The 2-hour coffee rule is a popular guideline: stop all caffeine at least 2 hours before you go to bed. It's one of the most-asked caffeine questions online, Google's own "People also ask" box features it alongside these calculator queries.
The honest verdict: it's better than nothing, but weak against the evidence. At a 5.5-hour half-life, a 200 mg coffee 2 hours before bed leaves ~155 mg in your system at lights-out, over three-quarters of the original cup still circulating.
The evidence-backed rule is harsher: 6 hours or more. The Drake et al. sleep study found measurable sleep reduction even at the 6-hour mark, so six hours is a minimum, not an ideal. And if you're a slow metabolizer toward the 12-hour end of the range, even early-afternoon coffee can linger.
So treat the 2-hour rule as the floor and the calculator as your personal version: pick your bedtime, your cup, and the amount you're willing to have left at bedtime, and it gives you your cutoff, not a slogan.
Frequently asked questions
Real answers, all sourced, mirrored in the page's schema for search engines.
What is a caffeine cutoff time?▼
Your caffeine cutoff is the latest time you can have caffeine so that what remains by bedtime stays under a limit you choose. With a ~5.5-hour half-life, coffee roughly halves every 5.5 hours, so a 200 mg coffee at 6 PM is still ~100 mg at 11:30 PM. Enter your bedtime in the calculator to get your own.
How does this calculator work?▼
It uses the standard exponential decay of a chosen half-life: remaining = dose × ½^((now − drink time) ÷ half-life). Your cutoff is solved backwards from bedtime: drink late enough that decay leaves no more than your target at bed. Logged doses each decay independently and sum together on the curve.
Is 6 hours before bed really enough?▼
Six hours is the evidence-backed minimum: Drake et al.'s study in the Journal of Clinical Sleep Medicine found that caffeine 6 hours before bed "has important disruptive effects on sleep," even for people who fall asleep fine. Slow metabolizers, up to a 12-hour half-life, typically need a wider margin. That is why the calculator lets you set your own target and half-life.
How long does 200 mg of caffeine take to wear off?▼
At a 5.5-hour half-life: ~100 mg after 5.5 hours, ~50 mg after 11, ~25 mg after 16.5, and effectively gone (~3% left) after about 27–30 hours. See the full decay table; plug your real bedtime into the calculator for your personal numbers.
How much caffeine is in coffee, tea, and energy drinks?▼
Cups vary widely, always check the label, but as typicals:
How much caffeine is safe per day?▼
The U.S. FDA advises that up to 400 mg per day is generally acceptable for healthy adults, roughly four 8-oz cups of brewed coffee. Guidance is stricter during pregnancy: Health Canada lists 300 mg/day for pregnant and breastfeeding people (Health Canada).
Does this tool save or upload my data?▼
No. Every calculation runs in your browser on your device, your bedtime and doses are never uploaded, stored on a server, or shared. Close the tab and it's gone.
Is this medical advice?▼
No. It produces mathematical estimates from a half-life you choose, and real half-life spans 2–12 hours by person. If you have a sleep disorder or a medical condition, talk to a clinician.
Caffeine guides
Deeper explainers on caffeine, half-life, and sleep; each one links back to the free calculator above.
- How long does 200mg of caffeine last? · hour-by-hour breakdown of a 200 mg dose.
- The 8–10 hour coffee rule, explained · the simple math behind the popular guideline.
- Caffeine half-life chart by drink · how long coffee, tea, and energy drinks take to clear.
- Does coffee before bed really ruin sleep? · the honest answer, without the hype.
- Best time to drink coffee in the morning · why your first cup can wait an hour.
- How to flush caffeine out of your system · myths vs. what actually helps.
- Can you drink decaf coffee at night? · the honest math on 2–7 mg before bed.
- Why am I so sensitive to caffeine? · genes, tolerance, and what to do about it.
- Is coffee good for your liver? · what a 13-year study found, and why decaf counts too.