Free tool HalfLifeCoffee No sign-up · 100% in your browser

Caffeine cutoff calculator

Enter your bedtime and each drink to get your last-coffee time — plus a decay curve with an estimate of how much caffeine remains in your system at bed. Keep scrolling for the full guide: how caffeine half-life works, how long a 200 mg coffee takes to wear off, and what the 2-hour coffee rule is really worth.

01

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.

The caffeine left in your system when you go to bed is what the cutoff is designed around.
Next cup — what are you drinking?
Typical values: brewed ≈95 mg/8 oz (National Coffee Association); ranges 80–180 for brewed, 64–90 espresso, 25–45 green tea (Canadian Nutrient File). Custom: mg
Healthy adults average ≈5–6 h (one study mean 5.7 h); the Sleep Foundation gives a 2–12 h range because genetics, age, pregnancy and liver health change it.
A fixed dose 6 hours before bed measurably reduced total sleep (Drake et al., J. Clin. Sleep Med.). Pick your own ceiling.
Your caffeine cutoff
—

Enter your bedtime and cup size.

Bedtime11:30 PM
Doses logged today2
Caffeine at bedtime— mg

Today's doses (edit the examples, add your own)
    Values are typicals — real cups vary widely. When in doubt, enter the label's number.

    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

    remaining(t) = dose × ½^((t − T) ÷ H) cutoff = bedtime − H × log₂(dose ÷ target)

    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.
    Disclaimer: estimates only — your real half-life ranges 2–12 hours by person (Sleep Foundation), and this is not medical advice. If you have a sleep disorder or a medical condition, talk to a clinician.
    Private by design. This calculator runs entirely in your browser: your bedtime and doses are never uploaded, stored, or shared.
    A

    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.

    B

    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:

    Elapsed
    200 mg becomes
    Plain English
    0 h
    200 mg
    The cup you just drank.
    5.5 h
    100 mg
    Half gone — still a full cup of coffee.
    11 h
    50 mg
    Like a fresh espresso still working you.
    16.5 h
    25 mg
    Like a strong green tea.
    22 h
    12.5 mg
    Nearly all gone.
    27.5 h
    ~6 mg
    Essentially cleared (~3% left).

    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.

    C

    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.

    D

    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, which 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:

    Brewed coffee (8 oz)
    ~95 mg
    range 80–180 (NCA, Canadian Nutrient File)
    Espresso (1 shot)
    ~64 mg
    range 64–90 (Canadian Nutrient File)
    Instant coffee (8 oz)
    ~90 mg
    range 76–106 (Canadian Nutrient File)
    Black tea (8 oz)
    ~47 mg
    range 43–60 (Canadian Nutrient File)
    Green tea (8 oz)
    ~28 mg
    range 25–45 (Canadian Nutrient File)
    Energy drink (16 oz)
    ~160 mg
    varies hugely by brand; 80–160+ typical — check the can
    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.