Coffee and Sleep: How Late Is Too Late for Caffeine?
Caffeine six hours before bed cut measured sleep by more than an hour in one study — and the sleepers did not notice. Why it lasts so long, why some people are hit harder, and when to stop.
Key takeaways
- In a 2013 study, 400 mg of caffeine taken six hours before bed reduced objectively measured sleep by more than an hour, and the participants did not notice the loss.
- Even a single 100 mg dose — about one cup of filter coffee — close to bedtime may delay sleep and shorten it in some adults, according to the European Food Safety Authority.
- Caffeine keeps you awake by blocking adenosine, the chemical that builds sleep pressure during the day. It hides the tiredness rather than removing it.
- One liver enzyme, CYP1A2, handles about 95% of caffeine metabolism, and how fast it works varies widely with genetics, smoking, hormones and liver health.
- A practical rule for most people: no caffeine within six hours of bed, and more like eight or more if you are sensitive. For an 11 p.m. bedtime, that means stopping by mid to late afternoon.
On this page
Stop drinking caffeine at least six hours before bed, and closer to eight or more if you are sensitive to it. That is earlier than most people assume, and the clearest evidence for it comes from a study whose most striking finding was that the people losing sleep did not know it.
The six-hour study
In 2013 Christopher Drake and colleagues published a study in the Journal of Clinical Sleep Medicine that tested caffeine at different times before bed. Participants took 400 mg of caffeine — roughly four cups of filter coffee — either at bedtime, three hours before, or six hours before, and on another night a placebo. Their sleep was measured objectively with a portable sleep monitor, and also by their own reports.
Caffeine disrupted sleep at all three times. Even taken six hours before bed, it cut objectively measured sleep by more than an hour.
And the participants did not notice. Their own reports of how they had slept did not reflect the lost hour. The American Academy of Sleep Medicine, which publishes the journal, summarised the conclusion bluntly: caffeine should generally be avoided after 5 p.m. to allow healthy sleep.
Two caveats make the study more useful rather than less. First, 400 mg is a large dose, so a single afternoon cup is likely to have a smaller effect. But second, smaller doses still matter: the European Food Safety Authority's 2015 safety assessment concluded that a single dose of 100 mg — about one cup of filter coffee — close to bedtime may delay sleep and shorten it in some adults.
How caffeine keeps you awake
From the moment you wake up, a chemical called adenosine builds up in your brain. The longer you are awake, the more there is, and the more strongly it binds to its receptors and makes you feel sleepy. This rising "sleep pressure" is one of the two main systems that decide when you fall asleep.
Caffeine works by sitting in those adenosine receptors without activating them. Adenosine cannot get in, so its signal is muffled and you feel more alert.
What caffeine does not do is remove adenosine. The sleep pressure keeps building behind the block. That is why the tiredness can arrive all at once when the caffeine wears off, and it is why caffeine still present at bedtime interferes with the very process that is supposed to put you to sleep.
Why it lasts so long — and longer for some people
Caffeine is cleared slowly. Its half-life — the time your body takes to remove half of it — is several hours, which means a meaningful fraction of a mid-afternoon coffee is still circulating at bedtime. The caffeine guide covers the typical numbers.
The range between people is wide, and a 2018 review in Pharmacological Reviews by Nehlig sets out why. A single liver enzyme, CYP1A2, is responsible for about 95% of caffeine metabolism, and how quickly it works varies with:
- Genetics. Common variants in the CYP1A2 gene make some people fast metabolisers and others slow ones.
- Smoking, which speeds caffeine clearance up.
- Hormones. Pregnancy and some oral contraceptives slow it down substantially.
- Liver health and age, among other factors.
There is a second layer of difference. Variations in the adenosine A2A receptor, caffeine's main target in the brain, affect how strongly a given dose acts on someone. So two people can drink the same coffee at the same time and have very different nights — one because the caffeine lingers, the other because it hits harder.
"But I sleep fine after coffee"
Maybe you do. Some people genuinely tolerate evening caffeine well.
But "I fall asleep fine" is not the same claim. Caffeine can leave sleep shorter and lighter even when you drift off without trouble, and the Drake study is a warning that people are poor judges of this. If you sleep fine yet wake unrefreshed, an experiment costs little: move your last coffee to before lunch for a week and see whether mornings change.
A practical cutoff
Count back from your usual bedtime.
| Bedtime | Six hours before | Eight hours before |
|---|---|---|
| 10 p.m. | 4 p.m. | 2 p.m. |
| 11 p.m. | 5 p.m. | 3 p.m. |
| Midnight | 6 p.m. | 4 p.m. |
Six hours is a reasonable minimum for most people. Eight or more is wiser if you are sensitive, pregnant, sleep badly, or take an oral contraceptive. If you want something warm in the evening, decaf contains only a few milligrams of caffeine per cup, a small fraction of a regular coffee.
Remember the caffeine that is not coffee. Tea, cola, energy drinks, pre-workout supplements, some painkillers and dark chocolate all contribute, and they count towards the same total.
The cycle to watch for
The common trap is not a single late coffee. It is a loop: poor sleep makes the afternoon harder, so the coffee comes later and stronger, which makes the next night worse.
Coffee in the morning is not the problem here, and there is good evidence that moderate coffee drinking is safe for most adults — the coffee and health guide goes through it. The fix for the loop is usually timing rather than abstinence: keep your coffee, and move the last one earlier.
Frequently asked questions
How long before bed should I stop drinking coffee?
At least six hours for most people, and eight or more if you are sensitive to caffeine or sleep poorly. In a 2013 study, caffeine taken six hours before bed still cut sleep by more than an hour. For an 11 p.m. bedtime, that means no coffee after about 5 p.m. at the latest.
Why can I fall asleep after drinking coffee?
Falling asleep is only part of sleep. Caffeine can shorten and lighten sleep even when you drift off easily, and people are poor judges of it: in the 2013 study, participants who lost more than an hour of measured sleep did not report sleeping worse.
Does decaf coffee affect sleep?
Very little for most people. Decaf still contains a small amount of caffeine, typically a few milligrams per cup, against roughly 95 mg in regular filter coffee. Very sensitive sleepers may prefer to avoid even that in the evening.
How long does caffeine stay in your system?
Several hours, and the range between people is wide. Caffeine is broken down mainly by one liver enzyme whose speed depends on genetics, smoking, hormones, pregnancy and liver health. Smokers clear it faster; pregnancy and some oral contraceptives slow it down considerably.
Why does coffee affect some people’s sleep more than others?
Two reasons. People break caffeine down at very different speeds, so it lingers longer in some than others. And variations in the adenosine receptor that caffeine blocks make some people more sensitive to the same dose. Your own experience is a better guide than anyone else’s rule.
Is it bad to drink coffee in the morning after a poor night’s sleep?
Not in itself, and it may help you function. The trap is the cycle: tiredness leads to more and later coffee, which worsens the next night’s sleep. If you are leaning on afternoon coffee to get through the day, moving your cutoff earlier is usually the better fix.
Sources
- 1.Late afternoon and early evening caffeine can disrupt sleep at night (on Drake et al., Journal of Clinical Sleep Medicine). American Academy of Sleep Medicine (2013)
- 2.Scientific Opinion on the safety of caffeine. European Food Safety Authority, EFSA Journal 13(5):4102 (2015)
- 3.Interindividual Differences in Caffeine Metabolism and Factors Driving Caffeine Consumption (Nehlig). Pharmacological Reviews 70(2) (2018)
Keep reading
Health & Science
Is Coffee Good for You? What the Evidence Actually Shows
Moderate coffee drinking is linked to lower risk of several diseases and appears safe for most adults. But most of that evidence is observational and rated low quality — here is what it can and cannot tell you.
5 min read
Health & Science
Does Coffee Dehydrate You? What Hydration Studies Actually Found
No. In three controlled studies, coffee hydrated about as well as water, and varying the caffeine content made no measurable difference. Where the myth came from, and the few cases worth caution.
4 min read
Health & Science
How Much Caffeine Is in Coffee? A Cup-by-Cup Guide
An average 240 ml cup of brewed coffee has about 95 mg of caffeine — but the real range is huge. Here is how much is in espresso, cold brew, instant and decaf, and how much is too much.
3 min read