
Quick Answer
Caffeine stays active for hours. A meta-analysis of 24 studies found it cut total sleep by about 45 minutes and reduced deep sleep. To avoid losing sleep, the authors estimated a standard cup of coffee should be finished at least 8.8 hours before bed. A large serving taken 6 hours before bed still disrupted sleep.
Key Takeaways
- Caffeine reduced total sleep time by about 45 minutes in a meta-analysis of 24 studies.
- It also reduced deep sleep and increased light sleep.
- The authors estimated a cup of coffee should be finished at least 8.8 hours before bed.
- Larger servings, like pre-workout drinks, needed about 13 hours.
- A large serving taken 6 hours before bed still disrupted sleep in a controlled study.
Coffee at 3 p.m. feels like a fair trade for getting through the afternoon. The cost shows up that night, often in ways you don’t feel, and you pay it back the next afternoon.
How Long Does Caffeine Affect Sleep?
Longer than most people expect. The problem isn’t the first cup. It’s the late one. In a controlled study, a large serving of caffeine taken at bedtime, 3 hours before bed, or 6 hours before bed disrupted sleep compared with placebo at every time point. The authors recommended avoiding substantial caffeine for at least 6 hours before bed (Drake and colleagues, Journal of Clinical Sleep Medicine, 2013).
What Does Caffeine Do to Sleep Quality?
A meta-analysis of 24 studies found that caffeine reduced total sleep time by about 45 minutes and sleep efficiency by 7%. It took 9 minutes longer to fall asleep, and time awake during the night rose by 12 minutes. Deep sleep decreased by about 11 minutes, while light sleep increased (Gardiner and colleagues, Sleep Medicine Reviews, 2023).
When Should You Have Your Last Cup?
The same meta-analysis estimated that to avoid losing sleep, a standard cup of coffee should be consumed at least 8.8 hours before bed. A standard serving of pre-workout supplement needed at least 13.2 hours.
| Caffeine Source | Estimated Cutoff Before Bed | Example for a 10:30 PM Bedtime |
|---|---|---|
| Standard cup of coffee | At least 8.8 hours | Before about 1:30 PM |
| Standard pre-workout serving | At least 13.2 hours | Before about 9:00 AM |
| Large serving (controlled study) | Disrupted sleep even at 6 hours | Avoid after about 4:30 PM at the very least |
Sensitivity varies from person to person, so use these as starting points. That doesn’t mean you have to give up coffee. It means timing matters.
Why Do Some People Feel Fine With Late Coffee?
You may fall asleep easily and still lose deep sleep. The meta-analysis found shifts from deep to light sleep that you may not notice, which can show up as feeling unrefreshed. See why you wake up tired and tired but wired.
How Do You Manage Afternoon Energy Without Caffeine?
Context matters. A wearable can show whether late caffeine is changing your sleep.
- Move your last coffee earlier by an hour each week.
- Take a short walk after lunch instead.
- Get outdoor light in the early afternoon.
- Track deep sleep and HRV for two weeks before and after.
For more, see the afternoon energy crash.
Frequently Asked Questions
How Many Hours Before Bed Should I Stop Caffeine?
A meta-analysis estimated at least 8.8 hours for a standard cup of coffee.
Does Caffeine Affect Deep Sleep?
Yes. Caffeine reduced deep sleep by about 11 minutes and increased light sleep in a meta-analysis.
Is Afternoon Coffee Bad for Sleep?
It can be. A large serving 6 hours before bed still disrupted sleep in a controlled study.
Does Decaf Affect Sleep?
Decaf contains much less caffeine, so it’s a better choice later in the day.
Why Can I Fall Asleep After Coffee but Still Feel Tired?
Caffeine can reduce deep sleep without stopping you from falling asleep.
Ready to Get Started?
Stop Guessing. Start Getting Answers.
If your sleep isn’t restoring you, find out what your biology is telling you.
Medically reviewed by Tracy Gapin, MD