KnowledgeSleep & recovery
Does coffee in the afternoon ruin your sleep?
Often yes, but how much depends on the dose, how close to bedtime you drink it and your genes. Falling asleep anyway doesn't mean the sleep was left untouched.
Consistent evidenceHow we grade evidence
What the research says
Caffeine blocks adenosine, the signal that builds sleep pressure through the day, and that effect lingers. The half-life is around five hours in most people, so a cup at three in the afternoon still has active caffeine left at bedtime.
Drake and colleagues tested this directly in a double-blind trial: 400 mg of caffeine taken 0, 3 or 6 hours before bed. All three timings disrupted sleep measurably compared with placebo, and even the dose taken six hours before reduced total sleep time. The participants themselves didn't always notice the disruption, but the measurements did.
Clark and Landolt reviewed both population studies and controlled trials in a systematic review. The pattern was consistent: caffeine lengthens the time it takes to fall asleep, shortens total sleep time and lowers sleep efficiency. It also cuts into deep sleep. The effect tracks both dose and timing, and older adults and certain genetic variants are more sensitive.
A 2023 meta-analysis by Gardiner and colleagues pooled 24 studies and put numbers on it. On average roughly 45 minutes of sleep was lost, deep sleep fell, and it took longer to fall asleep. From this they derived rules of thumb: an ordinary cup of coffee should be taken at least just under nine hours before bed to avoid costing sleep time, and a caffeine-heavy pre-workout at least thirteen hours before.
The large caveat is the spread between individuals. Some break caffeine down quickly and sleep undisturbed after an afternoon cup, others feel a cup at lunch. The average numbers point one way, but your own threshold decides where the line sits for you.
Why the myth exists
The belief "I drink coffee in the evening and sleep fine" is hard to shift, and there is a logic behind it. You can't observe your own sleep. Falling asleep feels like a receipt that all is well, but the shortened deep sleep and the extra awakenings happen while you sleep and leave no memory. The next morning there is no clear experience to tie back to yesterday's cup, so tiredness gets blamed on stress or too little time in bed instead. Add the real genetic spread: someone who happens to metabolise caffeine quickly genuinely sleeps well and draws the reasonable but wrong conclusion that this holds for everyone. Habit reinforces the sense that nothing is happening, because the lightly disturbed sleep becomes the normal you compare against.
What it means for you
If you sleep poorly, late caffeine is one of the easier things to test. Move your last cup earlier, ideally to the morning or early afternoon, and keep it steady for a few days before you draw conclusions. Remember that pre-workout and energy drinks often hold more caffeine than a cup of coffee and so need an even larger margin. Don't treat falling asleep as proof the sleep was good. If you already sleep well, there's nothing here you need to change.
Sources
- Caffeine effects on sleep taken 0, 3, or 6 hours before going to bed (Drake et al., Journal of Clinical Sleep Medicine)
- Coffee, caffeine, and sleep: A systematic review of epidemiological studies and randomized controlled trials (Clark & Landolt, Sleep Medicine Reviews)
- The effect of caffeine on subsequent sleep: A systematic review and meta-analysis (Gardiner et al., Sleep Medicine Reviews)