You have a coffee after lunch and sleep fine. Or the opposite: one cup at five o'clock and you're tossing and turning until midnight. Why do people differ so much, and what do controlled studies say?
In short. In controlled studies, caffeine taken before bed on average delayed falling asleep and shortened sleep. A 2023 meta-analysis (24 studies) found total sleep reduced by about 45 minutes, and a 2025 meta-analysis (22 studies, 956 participants) by about 35 minutes. The effect depended on dose and timing, and people feel it differently.
How this is studied
Most of these studies are small experiments: healthy, mostly young adults receive a known dose of caffeine or a placebo, and their sleep is measured overnight with a device (polysomnography or a portable EEG) and a sleep diary.
For example, the 2013 study by Drake and colleagues included 12 good sleepers (aged 19–48) who took a 400 mg caffeine pill 0, 3 or 6 hours before bedtime. In a 2025 study by Gardiner and colleagues, 23 men (average age 25, usually drinking under 300 mg of caffeine a day) received 100 or 400 mg 12, 8 or 4 hours before bed.
Meta-analyses pool many such studies: Gardiner 2023 pooled 24, and Chang 2025 pooled 22 crossover trials with polysomnography (956 healthy adults).
What they found
- Sleep duration. Caffeine shortened total sleep by about 45 minutes (2023 meta-analysis) and about 35 minutes (2025).
- Falling asleep. It took about 9 minutes longer (2023) and about 8 minutes longer (2025).
- Sleep quality. Sleep efficiency fell (by roughly 7% and 4.7%), as did the share of slow-wave (deep) sleep. REM sleep did not change significantly in the 2025 meta-analysis.
- Time before bed. In Drake's study, 400 mg taken even 6 hours before bed objectively shortened sleep by more than an hour. According to the authors of the 2023 meta-analysis, a cup of coffee (about 107 mg per 250 ml) would need to be finished roughly 9 hours before bed to avoid reducing total sleep.
- Dose. In the 2025 Gardiner study, 100 mg did not significantly change sleep, objectively or subjectively, even 4 hours before bed, while 400 mg did. In the Chang 2025 meta-analysis, both low and high doses shortened sleep, but the difference between them was not statistically significant.
- Different people. A 2017 review by Clark and Landolt notes that older people's sleep may be more sensitive and that individual (including genetic) differences are large.
- You don't always feel it. In Drake's study, people who took caffeine 6 hours before bed did not notice a difference even though the device showed shorter sleep. The 2025 Gardiner study also found a mismatch between objective and subjective measures.
What the studies don't show
- Many participants were young, healthy men from Western countries. Results may not apply to children, pregnant women, older adults or people with sleep disorders.
- These are short-term experiments. They don't show what happens when you drink coffee or tea daily for years, or whether the body adapts.
- Doses are often high (400 mg is several cups of coffee at once), and the meta-analyses also include products such as pre-workout supplements. A cup of tea usually has far less caffeine: compare it with our caffeine calculator and the library pages on green and white tea.
- We read some of these sources only as abstracts, so we report only what the abstracts state.
What this means in practice
The research doesn't say "no caffeine after 2 p.m." It shows that the effect depends on dose, timing and the person. If you struggle to fall asleep, look at how much caffeine you get and when, then experiment: for example, have your last caffeinated drink earlier for a few days, or choose a tea with less caffeine.
Work out when to have your last cup
More help: the caffeine-in-body timer, the body effects page and the drink converter. If you decide to cut back, read about quitting coffee and withdrawal.
General information, not medical advice. If sleep problems persist, see a doctor.