You have two bad nights and they are not the same night.
On the first, you get into bed at 11 exhausted and lie there until 12:30. On the second, you fall asleep in ten minutes and then open your eyes at 3 a.m., fully awake, with the rest of the night gone. Both get described as "bad sleep," but they fail for different reasons, and the levers that fix them are different too. The earlier pieces in this series covered what deep sleep and cycles do inside a night, and how light and wake time set when the night happens. This one is about the numbers behind one question: which of the usual suspects actually costs you deep sleep, in what order, and what clock time should you act on.
Ranked by effect size for a normal office worker, the order is: caffeine by a wide margin, alcohol second, then body temperature and light, with exercise timing last — innocent for most people and only a real thief in one specific pattern.
Two failure modes, so you can map each thief to a symptom
I can't fall asleep. This is a sleep-onset problem. Falling asleep needs sleep pressure to be high enough, your core temperature to be falling, and your body clock to have opened the gate. Nothing in this article changes sleep pressure much except caffeine, which blocks the signal that pressure acts through.
I wake at 3 a.m. This is a second-half problem. The first half of the night is dominated by deep sleep (slow-wave sleep, SWS) and is hard to interrupt; the second half is dominated by REM and is much easier to break. Most of what wakes you at 3 a.m. does its damage by making the back half of the night shallower and more fragmented — which has almost nothing to do with how well you fell asleep.
Keep those two apart and the ranking stops being a list of generic advice.
1. Caffeine: the biggest thief, and the one you cannot feel
Caffeine's average half-life in healthy adults is about 5 hours, but the range across people is roughly 2 to 8 hours 1. That range matters more than the average, because it means the same afternoon coffee is a different drug for different people. Here is what is still in your body after a drink, by elapsed time:
| Time since drinking | Typical (5 h half-life) | Fast metabolizer (2 h) | Slow (8 h) |
|---|---|---|---|
| 6 hours | ~43% | ~13% | ~60% |
| 8 hours | ~33% | ~6% | ~50% |
| 12 hours | ~19% | ~2% | ~35% |
The mechanism is worth one sentence, because it explains why caffeine hurts deep sleep specifically: adenosine accumulates while you are awake and is the chemical that builds sleep pressure; caffeine does not remove it, it blocks the receptor. The pressure keeps building underneath while the signal never arrives, so sleep comes late, runs shallow, and the deep-sleep component suffers.
The best controlled test of this used 400 mg of caffeine — about two to three cups of brewed coffee — given as a pill at bedtime, 3 hours before, or 6 hours before, in 12 healthy normal sleepers, with objective monitoring at home 1. Compared with placebo:
- Total sleep time: 7.68 h on placebo → 6.50 h when caffeine was taken 6 hours before bed, 6.54 h at 3 hours, 6.60 h at bedtime. Even at 6 hours out, more than an hour of sleep was gone.
- Deep sleep (SWS): 71.5 min on placebo → 48.9 min at 6 hours before bed, 57.0 min at 3 hours, 56.7 min at bedtime. The reductions were statistically significant at the bedtime and 6-hour conditions, and did not reach significance at 3 hours despite a similar average.
- Sleep efficiency: 91% → 82% at 6 hours before bed.
- Time awake during the night: up to ~37 minutes more, at the 3-hour condition.
Now the part that makes caffeine the number-one culprit. Participants did not notice. Self-rated sleep quality and the sleep-diary measures showed no significant differences across conditions, while the monitor showed an hour of missing sleep 1. Caffeine taken in the afternoon arrives without any sensation attached to it — no racing feeling, no obvious "I'm wired." So if you are the person who says "caffeine doesn't affect me," that is the expected report even when your sleep is measurably one hour shorter and your deep sleep is 20 minutes lower.
What to do with this. For an 11 p.m. bedtime, a caffeine cutoff of 5 p.m. at the latest is the paper's own conclusion (their phrasing: avoid caffeine after 17:00), and that assumes a 5-hour half-life. If you suspect you are a slow metabolizer — you can still feel a morning coffee at 9 p.m., or your half-life is pushed up by genetics or medications — move the cutoff to noon or 1 p.m. and hold it for two weeks before judging. Also count the total, not the number of drinks: 400 mg is roughly one large premium coffee or two energy drinks, so a single big afternoon coffee already reproduces the study condition.
2. Alcohol: knocks you out in the first half, then takes the back half
Alcohol is the thief people defend, because it really does shorten the time to fall asleep. That effect is real, and it is also the whole trick.
A 2024 meta-analysis of 27 studies in healthy adults 2 found:
- REM sleep is cut. The proportion of the night spent in REM dropped by 2.8 percentage points, and the first REM period was delayed by about 18 minutes on average — with a clear dose response, reaching delays of an hour or more at high doses. Even a low dose (≤0.5 g/kg, roughly two standard drinks) reduced REM. Timing barely helped: each extra hour between drinking and bedtime bought back only about 0.06 minutes of REM.
- The knock-out effect needs a big dose. Shorter time to fall asleep and a faster slide into deep sleep appeared only at ≥0.85 g/kg, roughly five standard drinks.
- Deep sleep itself was not reduced. The proportion of the night in deep sleep was essentially unchanged (+0.4 pp). Some studies find more deep sleep in the first half after drinking 3.
So alcohol is not primarily a deep-sleep thief — but it still ruins nights, in a way the "more deep sleep" number hides. In a study of three consecutive nights of pre-sleep alcohol with full lab monitoring 4, alcohol increased the rate of deep-sleep accumulation early and decreased the rate of REM accumulation at the start of each night: total REM fell by about 11 minutes on the first night and about 4 minutes on the following nights, and the deep-sleep percentage that rose in the first third of the night fell in the second two-thirds. That second-half shallowing is exactly the 3 a.m. wake-up, and the reviews describe the pattern the same way: consolidated first half, more disruption in the second half 3.
What to do with this. Moving the drink earlier is not a fix — the timing data are nearly flat. Dose is the lever: keep it to one or two standard drinks if you drink at all, stop using alcohol as a sleep aid, and treat a night after four or five drinks as a night with a predictable 3 a.m. hole in it.
3. Body temperature: the shower is a tool if you time it right
Core body temperature is already falling before you fall asleep, and that fall is part of the signal. The practical version of this is the warm bath or shower effect: warming the skin drives blood to the hands and feet, which dumps heat and makes core temperature fall faster afterward.
A meta-analysis of 13 trials 5 found water at 40–42.5°C (104–109°F), scheduled 1–2 hours before bedtime for as little as 10 minutes, shortened the time to fall asleep — about 10 minutes faster on average, roughly a 36% relative reduction — and improved sleep efficiency and self-rated sleep quality. Another summary of the same literature puts the optimum at about 90 minutes before bed 6. A field study in real homes (ages 20s–50s) compared showering with long bathing 1.5–2 hours before bed: time to fall asleep was 12.3 minutes after a long bath versus 20.3 minutes after a shower alone 7.
The failure mode is the same tool used wrongly. A bath too close to bedtime, or hot enough to raise core temperature a lot, delays sleep: water at 41°C for 1.5 hours raised rectal temperature by about 1.8°C and produced delayed sleep onset and more awakenings 7. So the timing is not decoration; it is the mechanism. Overheating at bedtime is the thief.
For the room itself, the commonly recommended range is 65–68°F (18–20°C) 8, and the reason is the same curve: core temperature swings roughly 2°F across the night, and a warm room works against the drop you need at the start.
What to do with this. Shower or bathe so you are out of the water 60–120 minutes before bed, not 15 minutes before. Keep the bedroom at 18–20°C and your bedding breathable. None of this is a large effect — 10 minutes of falling asleep faster — but it is cheap and it stacks.
4. Light at night: modest for sleep, large for timing
Evening light suppresses melatonin, and it does not take much: brightness of about 8 lux — no more than a table lamp, roughly twice a night light — already has a measurable effect 9. Blue-rich light is the most disruptive at night; in one experiment, 6.5 hours of evening blue light suppressed melatonin for about twice as long as green light of similar brightness and shifted the body clock about twice as far (3 hours versus 1.5 hours) 9. Practical summaries of this literature land on the same instruction: avoid bright screens for the 2–3 hours before bed and keep late lighting warm and dim 910.
There is a second, simpler effect: light during the night, including a lit room, is associated with more awakenings and less time in the deeper stages — the downsides are largest in the hours before waking, which is another way of describing the 3 a.m. problem 10.
What to do with this. Dim the room after dinner, get screens out of the bedroom or at least at minimum brightness 2–3 hours before bed, and sleep in as close to darkness as you can stand. The payoff here is mostly on when you can sleep rather than a big gain in deep sleep — which is why light ranks below caffeine and alcohol on this list.
5. Exercise timing: usually innocent, with one exception
For a normal office worker, evening exercise is not the culprit. A meta-analysis of 23 studies in healthy adults found evening exercise actually increased deep sleep by about 1.3 percentage points and lengthened REM latency by ~7.7 minutes, with only one caution: vigorous exercise ending ≤1 hour before bedtime may delay falling asleep and cost sleep duration 11.
The most useful numbers come from a study of 14,689 physically active people across 4.08 million nights 12. Exercise ending 4 or more hours before sleep onset was associated with no change in sleep at all. Closer than that, timing and strain mattered together: high-strain exercise ending about 2 hours before habitual sleep onset was associated with a sleep onset 36 minutes later and a sleep duration about 22 minutes shorter than a light session. Exercise that ran past your usual sleep onset was worse still — up to 80 minutes later.
What to do with this. Finish hard or long workouts at least 4 hours before bed (for an 11 p.m. bedtime, that means by 7 p.m.). Light or moderate activity within a couple of hours of bed is fine, and easier on sleep than skipping it.
Your evening, as times you can act on
Which one is yours
The diagnosis is easier than it sounds, because the thieves announce themselves differently. Caffeine is silent: the night looks normal and the numbers are not. Alcohol is loud: fast sleep onset, then a 3 a.m. wake-up and a flat, unrefreshing morning. A mistimed shower or a warm bedroom shows up as lying awake at the start without mental alertness — tired, warm, and simply not asleep. Late hard training shows up as an hour of delay that disappears on days you train earlier.
Change one lever at a time, hold everything else steady for two weeks, and keep your wake time fixed — that is the anchor the rest of the system hangs on, as the previous piece in this series explained. Caffeine and alcohol move the numbers most; temperature, light and exercise timing move them less, but reliably, and they are the ones you control on the same evening.