ShiftVitals
Back to Sleep Hub

Sleep Tool

Caffeine Clearance Calculator

See when to stop caffeine for better sleep — with a personalized cutoff time and a visual decay chart based on half-life science.

Your caffeine inputs
Adjust wake time, drink type, and your last cup to see personalized clearance guidance.

Assumes an 25 mg sleep threshold and a 5-hour caffeine half-life. Bedtime is estimated from your wake time with 8 hours of sleep.

Caffeine clearance results
Estimated bedtime: 11:00 PM

Recommended last cup

1:22 PM

Your last cup at 3:00 PM may leave about 31.3 mg in your system at bedtime — above the sleep-friendly threshold.

Caffeine decay over the next 12 hours

How Long Does Caffeine Stay in Your System?

Caffeine is the world's most widely used stimulant — and one of the most common hidden causes of poor sleep. After you drink coffee, tea, or an energy drink, caffeine is absorbed quickly and peaks in the bloodstream within about 30 to 60 minutes. From there, your liver breaks it down over time.

The key concept is half-life: the time it takes for your body to eliminate half of the caffeine dose. For most healthy adults, caffeine's half-life is roughly 5 hours. That means a 95 mg drip coffee still leaves about 47 mg in your system five hours later, and about 24 mg after ten hours. For sleep-sensitive people, even 25–50 mg near bedtime can delay sleep onset or reduce deep sleep quality.

ShiftVitals models this decay curve so you can see how much caffeine may remain at your estimated bedtime — not just a generic "stop at 2 PM" rule.

Why timing matters more than total daily caffeine

Two people can drink the same amount of caffeine and sleep very differently. What matters is when the last meaningful dose enters your system relative to your target sleep window. Morning coffee is usually fine for evening sleep; a late-afternoon espresso often is not.

Factors that slow caffeine clearance include pregnancy, oral contraceptives, certain medications, liver conditions, and genetic differences in the CYP1A2 enzyme. If you are a slow metabolizer, you may need an earlier cutoff than this calculator suggests.

Common Caffeine Amounts by Drink

| Drink | Typical caffeine (mg) | | --- | --- | | Espresso (1 shot) | 63 | | Drip coffee (8 oz) | 95 | | Black tea (8 oz) | 47 | | Energy drink (standard can) | 150 | | Decaf coffee (8 oz) | 2–15 |

Use these ranges as estimates — actual caffeine content varies by brand, brew method, cup size, and preparation.

How to use this calculator

  1. Enter your usual wake-up time so we can estimate tonight's bedtime (assuming 8 hours of sleep).
  2. Choose your drink type or closest match.
  3. Set the time of your last cup to see whether caffeine may still be active when you try to fall asleep.

The chart shows caffeine declining over the next 12 hours, with a dashed sleep threshold line at 25 mg — a practical target used by many sleep coaches for caffeine-sensitive adults.