Free · No sign-up · Real exponential decay

That coffee is still in your system at bedtime.

Enter your dose, when you had it, and your personal half-life. SleepShift plots the exact decay curve and tells you the moment your caffeine drops to a sleep-safe level — and whether it'll be low enough by the time you want to sleep.

Quick presets:
Average adult half-life is ~5 hours (range ~4–6). It's longer with some medications, pregnancy, or liver issues; shorter for smokers.

Cut caffeine before bed

Disclosure: the links below are affiliate links. If you buy through them, SleepShift may earn a commission at no extra cost to you. We only list categories we'd genuinely point a friend toward. We are not doctors; this tool is for general guidance, not medical advice.

Quality decaf

Crave the ritual, not the buzz? Good decaf lets you have an evening cup without the bedtime tax.

See picks

Herbal sleep teas

Caffeine-free blends — chamomile, valerian, lemon balm — make an easy evening swap.

Compare

A caffeine tracker app

Want to log every cup automatically? Some apps and wearables estimate your live caffeine level.

Browse

Magnesium & sleep aids

If caffeine timing's dialed in and you still struggle, some try magnesium. Ask a clinician first.

See picks

How the caffeine half-life calculator works

Caffeine leaves your body following first-order exponential decay — your liver clears a roughly constant fraction of it per unit time, not a fixed amount. The key number is the half-life: the time it takes for half the caffeine to clear. For a typical adult that's about 5 hours, though it ranges from roughly 4 to 6 hours and can be much longer in pregnancy, with certain medications (like some birth control), or with liver conditions.

The math is simple and exact:

remaining = dose × 0.5 (hours elapsed ÷ half-life)

So with a 5-hour half-life, a 200 mg coffee leaves about 100 mg after 5 hours, 50 mg after 10 hours, and 25 mg after 15 hours. This calculator runs that formula minute by minute, draws the curve, and finds when you cross a sleep-safe threshold — we use the lower of 50 mg or 25% of your dose, since even moderate caffeine close to bedtime can fragment sleep.

Why caffeine wrecks sleep even when you fall asleep fine

Caffeine works by blocking adenosine, the molecule that builds up while you're awake and creates sleep pressure. Even if you nod off, lingering caffeine reduces deep slow-wave sleep and can cut total sleep time — research has shown a dose as late as six hours before bed measurably disrupts sleep. You may not notice it as trouble falling asleep, just as feeling less rested the next day.

Practical takeaways

A note on safety

This calculator estimates using a single half-life and assumes the full dose is absorbed promptly. Real absorption peaks around 30–60 minutes and individual metabolism varies widely. It's general guidance, not medical advice. The FDA cites up to ~400 mg/day as generally safe for most healthy adults, but that's not universal — talk to a clinician about your own limits, especially if pregnant, on medication, or managing a heart condition.

Frequently asked questions

How long does caffeine stay in your system?
With a ~5-hour half-life, half remains after 5 hours, a quarter after 10, an eighth after 15. It takes roughly a full day to clear almost completely. Enter your dose above for an exact curve.
What is the half-life of caffeine?
About 5 hours on average for healthy adults, ranging from roughly 4 to 6. It's longer in pregnancy, with some medications, and with liver impairment; shorter in smokers.
How many hours before bed should I stop caffeine?
A common guideline is 8–10 hours. Even caffeine 6 hours before bed has been shown to reduce sleep quality, so earlier is safer if you're sensitive.
Why does the calculator use a 50 mg threshold?
It uses the lower of 50 mg or 25% of your dose as a "sleep-safe" point. Below roughly that level, caffeine's effect on most people's sleep is small — but sensitivity varies.
Is SleepShift free?
Completely. No account, no app to install — it runs entirely in your browser.