How Late Is Too Late for Caffeine? The Evidence
Share
You had one coffee after lunch and felt fine. Now it is past midnight, the room is dark, and your mind will not switch off. You blame a busy day, a late email, the noise outside. The more likely culprit is still working its way through your blood.
Caffeine is part of daily life for a lot of us, and we drink it without much thought about the clock. The dose matters, and so does the hour you take it. That second part is the one people miss. A pooled analysis of controlled sleep studies now gives a clear number for when to stop, and it is earlier than most people expect. Here is what the research shows, why an afternoon cup reaches into your night, and a simple cut-off you can follow.
What caffeine does to a night of sleep
In 2023 Gardiner and colleagues published a systematic review and meta-analysis in Sleep Medicine Reviews. They pooled 24 controlled crossover studies, the kind where the same person is tested with caffeine and again with a placebo, so each person acts as their own comparison. That design strips out a lot of noise and makes the average effect trustworthy.
Across those studies, caffeine cut total sleep time by 45 minutes and lowered sleep efficiency by 7 percent. Sleep efficiency is the share of time in bed actually spent asleep, so a drop there means more of the night lost to lying awake. People also took 9 minutes longer to fall asleep and spent 12 more minutes awake during the night after falling asleep.
The shape of sleep changed too, not only the amount. In the pooled data, light sleep rose while deep sleep fell by about 11 minutes a night. Deep sleep is the stage that does the heavy repair work on the body and helps memory settle, so losing some of it to lighter stages is a real cost even when the total hours look normal. You may still count a full night in bed and wake up feeling like you did not rest, because the sleep itself was shallower than it should have been.
Why a 3pm coffee still counts at midnight
The reason timing matters is how slowly the body clears caffeine. A 2026 review in Hereditas by Liu and Xu describes a half-life of roughly 4 to 5 hours in healthy adults. Half-life is the time it takes to remove half of what you drank. So if your afternoon cup carries the 107 mg used in the coffee studies, roughly half of that is still circulating five hours later, and a smaller amount lingers into the night, gently blocking the signals that make you feel sleepy.
The same review reports that a single enzyme, CYP1A2, handles more than 90 percent of that clearing work, and that its activity varies by up to 15-fold between people. That is why a friend can drink an espresso after dinner and sleep soundly while the same cup leaves you staring at the ceiling. Age, pregnancy, some medications, and your genes all shift how fast you process it. If evening coffee has not bothered your sleep, you are likely a fast clearer. Many people are not, and they underrate the effect because they do not feel wired at night and only notice it the next day, waking up less rested.
The cut-off that protects your sleep
To avoid losing sleep time, the Gardiner review found that a standard coffee, defined as 107 mg per 250 mL cup, should be taken at least 8.8 hours before bed. For a typical 11pm bedtime, that puts the last coffee at around 2pm. Stronger sources sit further out. A standard serving of pre-workout supplement at 217.5 mg should stop at least 13.2 hours before bed, which for the same bedtime means before 10am.
An older randomised trial by Drake and colleagues, published in the Journal of Clinical Sleep Medicine in 2013, points the same way from a different angle. They gave people 400 mg of caffeine at bedtime, 3 hours before, and 6 hours before, and tracked how they slept at home. Even the dose taken a full 6 hours before bed clearly disrupted their rest. The authors still supported the standard advice to avoid substantial caffeine for at least 6 hours before bed, and the newer coffee figure of nearly 9 hours sits further out again. Two independent lines of evidence land on the same practical message. Afternoon caffeine is not free.
If you train after work, this is the real squeeze. An evening gym session often pairs with a pre-workout or a strong coffee, and both land close to bedtime. The answer is not to drop the workout but to change the fuel. A caffeine-free pre-workout, a smaller dose, or a proper warm-up keeps the training without borrowing from your sleep. On the days you do reach for a lift, take it as early as you can and keep the amount modest, so the clock has time to work before your head hits the pillow.
A simple caffeine plan
You do not need to give up coffee. You need to move it earlier and watch the hidden sources. Work back from your bedtime and set one cut-off time, then keep the strong stuff for the morning.
Common mistakes
The first mistake is trusting how you feel. In the Drake trial, people did not report worse sleep even when monitors showed it was worse, so the damage runs quietly under your own awareness. The second is treating tolerance as clearance. Being able to fall asleep after coffee does not mean the caffeine has left your system, and the pooled data show lighter, more broken sleep even in habitual drinkers. The third is forgetting that a big afternoon dose behaves differently from a small one. The stronger the source, the further from bedtime it needs to sit.
Frequently asked questions
The bottom line
Caffeine helps you in the morning and works against you at night. The evidence is consistent. A pooled analysis of 24 controlled studies found that caffeine trims total sleep, lowers efficiency, and thins out deep sleep, and it points to a coffee cut-off of nearly 9 hours before bed. A separate trial found effects even 6 hours out. You do not have to quit. Set one cut-off time, keep strong doses for the morning, and let the evening belong to sleep. Your next good night may start with the cup you skip this afternoon.