Caffeine and sleep: how many hours before bed to stop

Updated Well Day Media Editorial Team
A man yawning over a cup of coffee late in the afternoon
The short answerCaffeine shortens total sleep by about 45 minutes on average and lowers its quality. A meta-analysis recommends having a cup of coffee (about 100 mg of caffeine) at least 8 to 9 hours before bed. Even if you fall asleep easily after coffee, sleep depth and duration can suffer without you noticing.

Key points

How caffeine affects sleep

Caffeine blocks adenosine, a chemical that builds up while we are awake and creates “sleep pressure”. Caffeine has a half-life of about 5 hours, so half of an afternoon cup is still in your body in the evening.

What the research shows

Meta-analysis. Pooling 24 studies, researchers found that caffeine reduced total sleep time by about 45 minutes and sleep efficiency by 7%, increased the time to fall asleep and reduced deep sleep. To avoid these effects, they recommended a cutoff of about 8.8 hours before bed for a standard cup of coffee (107 mg) and about 13 hours for a large dose such as a pre-workout supplement (217.5 mg) (Gardiner et al., 2023).

Six hours is not enough. In a classic study, 400 mg of caffeine taken 6 hours before bed still reduced total sleep by more than an hour (Drake et al., 2013).

How much caffeine is in common drinks

Drink Caffeine (approx.)
Brewed coffee, 8 oz 80–100 mg
Large coffee-shop coffee, 16 oz 250–330 mg
Espresso, 1 shot 63 mg
Black tea, 8 oz 40–50 mg
Cola, 12 oz 30–40 mg
Energy drink, 16 oz 150–300 mg

Practical rules

  1. If you go to bed at 11 p.m., have your last coffee by about 2 p.m.
  2. Count all sources, including tea, soda, energy drinks and pre-workout products.
  3. Switch to decaf or herbal tea in the afternoon.
  4. Keep the total under 400 mg a day, the FDA’s level for healthy adults.

Individual differences

Genetics, age, pregnancy, smoking and some medications change how fast you clear caffeine. Limiting caffeine late in the day is a standard part of sleep hygiene (Irish et al., 2015).

Frequently asked questions

Does decaf affect sleep?

Decaf contains a small amount of caffeine (usually 2 to 15 mg per cup), which is unlikely to matter for most people.

What if I can sleep after an espresso?

Studies show caffeine can reduce deep sleep and total sleep even when you do not notice trouble falling asleep.

Sources

  1. Gardiner et al. (2023). The effect of caffeine on subsequent sleep: A systematic review and meta-analysis. Sleep Medicine Reviews 69:101764. doi:10.1016/j.smrv.2023.101764
  2. Drake et al. (2013). Caffeine Effects on Sleep Taken 0, 3, or 6 Hours before Going to Bed. Journal of Clinical Sleep Medicine 9(11):1195-1200. doi:10.5664/jcsm.3170
  3. Irish et al. (2015). The role of sleep hygiene in promoting public health: A review of empirical evidence. Sleep Medicine Reviews 22:23-36. doi:10.1016/j.smrv.2014.10.001

Prepared according to our evidence methodology and the principles of lifestyle medicine. For education only; it does not replace advice from your doctor.

Keep reading

Related topics from other pillars

Sleep tools