Last updated: August 24, 2026
How to Use This Calculator
- Enter your bedtime — when you actually plan to fall asleep, not when you get into bed.
- Pick what you drink — the calculator uses the caffeine content of that drink (a coffee is 95mg; espresso 63mg; energy drink 100mg).
- Set how many — more drinks = more caffeine = earlier cutoff.
- Adjust your sensitivity — 5 hours is average. If coffee has always kept you up, use 6-7 hours (slower metabolism); if you can nap after espresso, use 4 hours.
- Find your cutoff — the calculator shows your last safe caffeine time and how much caffeine is still active at bedtime.
What Is Caffeine Half-Life?
Caffeine half-life is the time your body takes to eliminate half of the caffeine you consumed. The average is about 5 hours, meaning after 5 hours, half the caffeine from your drink is still circulating in your system.
| Time after caffeine | Caffeine remaining (from 95mg coffee) |
|---|---|
| 0 hours (drink time) | 95 mg |
| 5 hours (1 half-life) | 47.5 mg |
| 10 hours (2 half-lives) | 23.8 mg |
| 15 hours (3 half-lives) | 11.9 mg |
| 20 hours (4 half-lives) | 5.9 mg |
Even small amounts matter: even 24 mg of caffeine — about a quarter of a coffee — can reduce deep sleep and make it harder to fall asleep. That's why a 3 PM coffee can still affect a 10 PM bedtime.
How Much Caffeine Is in Your Drink?
| Drink | Serving | Caffeine (mg) |
|---|---|---|
| Brewed coffee | 8 oz | 95 |
| Espresso | 1 shot (1 oz) | 63 |
| Energy drink | 12 oz | 80-120 |
| Black tea | 8 oz | 47 |
| Green tea | 8 oz | 28 |
| Cola | 12 oz | 22-34 |
Why Caffeine Affects People Differently
Caffeine sensitivity varies dramatically from person to person due to:
- Genetics — The CYP1A2 gene controls how fast you metabolize caffeine. "Fast metabolizers" clear it in ~3 hours; "slow metabolizers" take up to 10 hours.
- Oral contraceptives — Can double your caffeine half-life, keeping it active much longer.
- Pregnancy — Slows caffeine metabolism significantly, extending half-life.
- Age & liver function — Older adults and those with liver issues metabolize caffeine more slowly.
- Habit — Regular caffeine users develop tolerance, but the half-life stays similar — you just notice the effects less.
If you're unsure, start with a 5-hour half-life and adjust based on how well you actually sleep after caffeine.
5 Tips to Protect Your Sleep From Caffeine
- Set a personal cutoff and stick to it — Find your latest time with this calculator, then make it a daily rule. Consistency trains your body to wind down.
- Watch "hidden" caffeine — Chocolate, decaf coffee (still ~7mg), pre-workout, and some teas contain caffeine people forget to count.
- Switch to herbal tea after lunch — Caffeine-free options like chamomile and peppermint satisfy the ritual without the stimulant.
- Consider decaf for your second cup — If you drink coffee all day, make the afternoon cups decaf (only ~7mg) to keep the routine but drop the caffeine.
- Don't rely on "feeling tired" — Caffeine masks sleepiness; you can feel wired yet still be accumulating sleep debt that hits later.
Frequently Asked Questions
How many hours before bed should I stop caffeine?
Most experts recommend 8-10 hours before bed. Given a ~5-hour half-life, caffeine 8 hours before sleep still leaves a meaningful active amount at bedtime that reduces total sleep and quality.
Is it just coffee I need to worry about?
No — tea, energy drinks, cola, chocolate, and even decaf coffee contain caffeine. Energy drinks are especially tricky because many contain 100mg+ per serving and are consumed in the afternoon.
Can I have caffeine if I'm a "fast metabolizer"?
Yes, some people metabolize caffeine in ~3 hours (a "4-hour half-life" in our calculator). But even fast metabolizers should still avoid large doses late in the day — you'll get a faster result with our sensitivity slider.
Does caffeine affect deep sleep even if I fall asleep fine?
Yes. Caffeine reduces slow-wave (deep) sleep and overall sleep quality, even when you fall asleep normally. You may sleep lighter and wake more often without realizing why.
Should I quit caffeine entirely?
Not necessarily. Moderate morning caffeine is fine for most people. The key is timing — enjoy your coffee early, respect your cutoff, and your sleep will thank you. See our full sleep toolkit for more sleep-optimization tools.
Sources: National Sleep Foundation, 2013 J. Clin. Sleep Med. caffeine & sleep study, FDA caffeine guidance, Mayo Clinic. Individual metabolism varies — consult a healthcare provider.