Sleep science
Caffeine and Sleep: How Late Is Too Late for Coffee?
Caffeine can cut into your sleep long after the buzz has faded, even when you fall asleep without trouble. In one small study, a large dose taken six hours before bed reduced total sleep by more than an hour. A sensible starting rule is to stop at least six hours before bedtime, earlier if you are sensitive.
Key takeaways
- Caffeine blocks a sleepiness signal for hours; it hides tiredness rather than removing it.
- In one small study, a large dose taken six hours before bed cut total sleep by more than an hour.
- Start with a cutoff at least six hours before bedtime, and move it earlier if you are sensitive.
- Tea, cola, energy drinks, chocolate and pre-workout powders all count toward the total.
- Coffee can get you through a short night, but it does not pay back the sleep you lost.
What does caffeine actually do to your sleep?
From the moment you wake up, a chemical signal of sleepiness called adenosine slowly builds in your brain. The longer you are awake, the stronger this sleep pressure becomes, and by bedtime it is a large part of what lets you drop off. Caffeine works by blocking the receptors that detect that signal. You feel more alert, but the pressure has not gone anywhere; it is simply hidden.
Your body clears caffeine slowly, over many hours, so a cup in the afternoon can still be active at night. When it is, it can make you take longer to fall asleep, sleep more lightly and wake more often, sometimes without you noticing anything but a less refreshing night.
How late is too late for caffeine?
The clearest evidence comes from a small study that gave people 400 mg of caffeine, a large dose, either at bedtime, three hours before or six hours before. Even taken six hours before bed, it reduced total sleep by more than an hour.1 That result is often cited as the basis for the popular six-hour rule.
Keep its limits in mind. It was one small study using a single large dose, so it cannot tell you what your afternoon cup does to you. What it does show is that caffeine’s effect on sleep can last far longer than the alertness you feel, and that six hours is a minimum rather than a guarantee.
In practice, a fixed cutoff time is easier to stick to than counting back from bed. If you go to bed at 11 p.m., six hours puts your last coffee at 5 p.m. at the latest. If you are sensitive or already sleep poorly, try a cutoff around lunchtime.
Why can some people drink espresso after dinner?
People differ widely in how quickly they clear caffeine and how strongly they respond to it. Several things play a part:
- Genes. Inherited differences in the liver enzymes that break caffeine down make some people fast processors and others slow ones.
- Habit. Regular coffee drinkers build some tolerance to the alerting effect. Feeling less wired does not necessarily mean the effect on sleep has gone too.
- Pregnancy and some medications. Both can slow how quickly the body clears caffeine. A doctor or pharmacist can tell you whether a medicine you take does this.
- Smoking. It tends to speed up caffeine clearance, so people who quit may find coffee affects them more.
- Age. Many people find caffeine bothers them more as they get older, and sleep itself changes too: deep sleep declines across adulthood while lighter sleep and night-time awakenings increase.2
So a friend’s late espresso tells you little about yours. The way to find out where you sit is to test it.
Where is caffeine hiding in your day?
Coffee gets the blame, but it is rarely the only source. Amounts vary with brand, brew and serving size, so treat this as a rough guide and check labels.
| Source | Caffeine | Easy to miss because |
|---|---|---|
| Brewed coffee, espresso, cold brew | High, and varies a lot with size and strength | A large café serving can hold far more than a mug at home |
| Energy drinks and caffeine shots | Moderate to very high | Some cans contain as much as a strong coffee, or more |
| Pre-workout powders | Often high | An evening workout means a large dose late in the day |
| Black, green and matcha tea, yerba mate | Moderate, usually less than coffee | It feels like a gentle drink, and the cups add up |
| Cola and some other soft drinks | Low to moderate | It often comes with dinner |
| Chocolate and coffee-flavored desserts | Low, more in dark than in milk chocolate | It does not feel like a caffeinated food |
| Some over-the-counter pain relievers | Varies | Caffeine sits in the ingredient list, not on the front of the box |
| Decaf coffee | Very low, but not zero | Several cups can add up for very sensitive people |
For sleep, the timing of the last dose matters most. A cola with dinner may be trivial for one person and enough to keep a sensitive sleeper awake.
How to find your own caffeine cutoff
Because people differ so much, the most useful number is your own, and a simple two-week experiment is usually enough to find it.
- Week one: keep your normal habits and note, each day, when you had your last caffeine and roughly how much.
- Week two: move your cutoff earlier, to six hours before bed, or to lunchtime if you already stop six hours before. You can keep your morning coffee as it is.
- Keep everything else steady: the same bedtime and wake time, similar evenings and no other new sleep changes mixed in.
- Compare the two weeks on how long you seem to take to fall asleep, how often you wake, how long you sleep and how alert you feel in the afternoon.
A tracker can help with the comparison, but judge it on the broad numbers. Consumer trackers estimate sleep from movement and heart signals rather than brain activity, and their stage estimates are less reliable than total sleep time.3 For more on what the numbers can and cannot tell you, see how accurate sleep tracking apps really are.
Can coffee make up for a short night?
Coffee can get you through a morning after a bad night, and caffeine is one of the countermeasures researchers discuss for the grogginess right after waking.4 It acts too slowly to clear the very first minutes, though, as the guide to sleep inertia explains. And it cannot replace the sleep itself. It hides the pressure to sleep; it does not discharge it.
That matters because short sleep is easy to underestimate. In one experiment, two weeks of six hours in bed produced attention deficits comparable to up to two nights of total sleep deprivation, while participants largely did not feel that impaired.5 Caffeine makes that mismatch easier to miss, because it masks the sleepiness that would otherwise tell you something is wrong.
It can also become a loop: a short night leads to extra coffee later in the day, and the next night is shorter or lighter again. Breaking it means protecting the next night rather than reaching for another cup. The article on sleep debt and whether you can catch up covers how to pay it down, and if you need an afternoon lift, a short nap is often the better tool, as described in the power nap guide.
Where to start today
- Pick a caffeine cutoff at least six hours before your usual bedtime, and write it down.
- Check your afternoons and evenings for hidden sources: tea, cola, energy drinks, pre-workout, chocolate.
- Keep the cutoff for two weeks on a steady schedule, then compare how you slept.
- If you still feel you need coffee just to function, look at how much you sleep before you look at your mug.
If you have trouble sleeping on most nights for weeks, or caffeine leaves you with a racing heart or anxiety, talk to a doctor, as you should if you are pregnant or have a heart condition and are unsure how much caffeine is right for you. If late evenings on your phone are part of the picture, read whether screens before bed really hurt your sleep.
Frequently asked questions
How many hours before bed should I stop drinking coffee?
A practical starting point is at least six hours, because one study found that a large dose of caffeine taken six hours before bed still cut total sleep by more than an hour. If you are sensitive to caffeine or sleep poorly, try stopping earlier, around lunchtime, and see whether your nights improve over a week or two.
Can you drink coffee and still fall asleep fine?
Many people can, and that is part of the problem. Falling asleep easily does not mean the caffeine has left your system, and it can still make your sleep shorter or lighter. People who are short on sleep are also poor judges of how impaired they are, so feeling fine is not a reliable test.
Does decaf coffee have caffeine?
Yes, a little. Decaffeination removes most of the caffeine but not all of it, so decaf still contains a small amount. One cup in the evening is unlikely to matter for most people, but several cups, or decaf on top of other sources such as tea or chocolate, can add up if you are very sensitive.
Why does coffee make me tired instead of awake?
Caffeine works by blocking a sleepiness signal that keeps building while you are awake. When it wears off, that built-up pressure is still there, which can feel like a crash. If you regularly feel tired despite coffee, short or broken sleep is the likelier cause, and persistent daytime sleepiness is worth discussing with a doctor.
Sources
- Drake C, Roehrs T, Shambroom J, Roth T. Caffeine effects on sleep taken 0, 3, or 6 hours before going to bed. Journal of Clinical Sleep Medicine, 2013. doi.org/10.5664/jcsm.3170
- Ohayon MM, Carskadon MA, Guilleminault C, Vitiello MV. Meta-analysis of quantitative sleep parameters from childhood to old age in healthy individuals. Sleep, 2004. doi.org/10.1093/sleep/27.7.1255
- Depner CM, et al. Wearable technologies for developing sleep and circadian biomarkers: a summary of workshop discussions. Sleep, 2020. doi.org/10.1093/sleep/zsz254
- Hilditch CJ, McHill AW. Sleep inertia: current insights. Nature and Science of Sleep, 2019. doi.org/10.2147/NSS.S188911
- Van Dongen HPA, Maislin G, Mullington JM, Dinges DF. The cumulative cost of additional wakefulness. Sleep, 2003. doi.org/10.1093/sleep/26.2.117
This article is for general information only and is not medical advice. WakeUp 2day is not a medical device and does not diagnose, treat or prevent any condition. If you are worried about your sleep or your health, talk to a doctor.