Caffeine and sleep: how many hours before bed to stop
Sleep
Key points
- Caffeine shortens total sleep by about 45 minutes and reduces deep sleep.
- Have a regular cup of coffee at least 8 to 9 hours before bed.
- A large dose even 6 hours before bed cut sleep by more than an hour.
- Sensitivity to caffeine varies widely between people.
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
- If you go to bed at 11 p.m., have your last coffee by about 2 p.m.
- Count all sources, including tea, soda, energy drinks and pre-workout products.
- Switch to decaf or herbal tea in the afternoon.
- 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
- 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
- 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
- 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
Keep reading
Sleep A bedtime routine for better sleep: what really helps
Which sleep hygiene habits are backed by research, why screens delay sleep, a 60-minute wind-down routine and when a routine alone is not enough.
Sleep Sleeping through stressful times: how to recover when nights are restless
How stress, emergencies and anxious news cycles disrupt sleep, and habits that help you recover: a steady wake time, daylight, limiting news and relaxation.
Sleep · Guide Sleep: how much do adults need and why it matters for health
How much sleep adults need according to sleep medicine experts, how short and very long sleep are linked to health and what works for insomnia.
Related topics from other pillars
Nutrition Coffee: benefits, limits and who should cut back
What an umbrella review of more than 200 meta-analyses found about coffee and health, the safe caffeine limit for adults and who should drink less.
Physical ActivityExercise and sleep: how physical activity helps you sleep
What a meta-analysis of 66 studies found about exercise, sleep duration and sleep quality, and whether evening workouts keep you awake.
Sleep tools
How much sleep do you need? Recommendations by age
Recommendations from the American Academy of Sleep Medicine and the National Sleep Foundation.
QuizSocial jet lag calculator
The difference in your sleep midpoint between workdays and days off.
QuizWhen should you stop drinking coffee? Calculator
According to a meta-analysis, have a regular coffee at least about 8.8 hours before bed.
PDF · DiaryTwo-week sleep diary
Record bedtime, wake time, awakenings, caffeine, alcohol and how you feel.
PDF · TrackerMonthly 24-hour sleep tracker
A visual sleep rhythm tracker that shows your schedule and social jet lag.
PDF · ChecklistBedtime routine checklist
A step-by-step wind-down routine with a weekly tracker.