☕ Quick answer

Stop caffeine 8–10 hours before bed. Caffeine's average half-life is about 5 hours — a coffee at 3 PM still leaves ~24 mg active in your system at 10 PM. A 2013 study found caffeine even 6 hours before bed reduced total sleep by over 1 hour. Enter your bedtime below to get your personal last-call time.

Science: caffeine half-life 3-10h (avg ~5h); 2013 J. Clin. Sleep Med. study (sleep reduction >1h at 6h before bed).

☕ Your caffeine & sleep
1
5.0h

Enter your bedtime, what you drink, and how sensitive you are — then click "Find My Caffeine Cutoff" to see your last safe caffeine time.

Last updated: August 24, 2026

How to Use This Calculator

  1. Enter your bedtime — when you actually plan to fall asleep, not when you get into bed.
  2. Pick what you drink — the calculator uses the caffeine content of that drink (a coffee is 95mg; espresso 63mg; energy drink 100mg).
  3. Set how many — more drinks = more caffeine = earlier cutoff.
  4. 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.
  5. 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 caffeineCaffeine 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?

DrinkServingCaffeine (mg)
Brewed coffee8 oz95
Espresso1 shot (1 oz)63
Energy drink12 oz80-120
Black tea8 oz47
Green tea8 oz28
Cola12 oz22-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

  1. 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.
  2. Watch "hidden" caffeine — Chocolate, decaf coffee (still ~7mg), pre-workout, and some teas contain caffeine people forget to count.
  3. Switch to herbal tea after lunch — Caffeine-free options like chamomile and peppermint satisfy the ritual without the stimulant.
  4. 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.
  5. 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.

On this page