There is no universal “last coffee” time. The sleep effect depends on the dose, how close it is to your bedtime, and how strongly you respond to caffeine.
It is 3 p.m. The afternoon slump has arrived, and another coffee sounds useful.
Bedtime is not until 11. Eight hours away.
Surely that is early enough.
Maybe. But caffeine creates an awkward mismatch between what you feel and what is still happening in your body. The obvious buzz can fade long before caffeine is gone, and controlled experiments have found measurable sleep effects surprisingly far from bedtime.
That has helped produce a familiar rule: stop caffeine six hours before sleep.
The evidence suggests something less tidy—and more useful.
A substantial dose can disrupt sleep six hours before bed. A high single dose has altered some aspects of sleep even when taken 12 hours beforehand. Yet in one recent experiment, a much smaller dose produced no statistically detectable sleep disruption even four hours before bed.
So the better question is not simply “What time should I stop drinking coffee?”
It is:
How much caffeine am I having, and how many hours remain before I want to sleep?
Six Hours Before Bed Is Not Always Early Enough
A widely cited experiment published in 2013 tested 400 milligrams of caffeine at bedtime, three hours before bed, and six hours before bed.
Sleep was disrupted at all three times.
Even when caffeine was taken six hours before bedtime, participants lost more than an hour of sleep according to objective recordings.
The finding was striking because six hours does not sound particularly late. For someone who goes to bed at 11 p.m., that means 5 p.m. For someone who sleeps at 9:30, it means 3:30.
A 2023 systematic review and meta-analysis of 24 studies reinforced the broader point. Across the studies, caffeine reduced total sleep time by about 45 minutes on average, lowered sleep efficiency, delayed sleep onset, increased time awake after falling asleep, and reduced deep sleep.
The researchers also modeled how long before bedtime different caffeinated products might need to be consumed to avoid reducing total sleep time. For a coffee containing about 107 milligrams of caffeine, the estimate was roughly 8.8 hours.
That does not mean everyone needs an 8-hour-and-48-minute caffeine cutoff.
It was a statistical estimate drawn from studies using different doses, participants, and protocols. Sleep does not suddenly become safe at 8 hours and 49 minutes and disrupted at 8 hours and 47.
More importantly, newer experimental research shows why one universal cutoff misses a major part of the story.
Dose Can Change the Answer Dramatically
A recent randomized crossover trial tested two caffeine doses: 100 milligrams and 400 milligrams.
Twenty-three healthy men received each dose either 12, eight, or four hours before their usual bedtime. Researchers then measured their sleep at home using physiological recordings as well as sleep diaries.
The difference between the doses was substantial.
The 100-milligram dose produced no statistically significant changes in the measured objective or subjective sleep outcomes, even when taken four hours before bedtime.
The 400-milligram dose behaved very differently. When consumed within 12 hours of bed, it delayed sleep initiation and altered sleep architecture. Within eight hours, sleep became more fragmented. Four hours before bed, the high dose also worsened perceived sleep quality and produced the clearest overall disruption.
This does not prove that 100 milligrams is harmless for everyone four hours before bed. The study was small, included only men ages 18 to 40, and tested specific doses under controlled conditions.
Nor is 400 milligrams a typical single cup of coffee. It is a high dose.
What the experiment demonstrates clearly is that dose changes the timing problem.
“Caffeine at 3 p.m.” is incomplete information.
A small coffee, a large brewed coffee, an energy drink, tea, espresso, and a high-dose pre-workout product can contain very different amounts of caffeine. Even coffees that look similar can vary substantially by serving size and preparation.
And afternoon caffeine does not necessarily arrive after the morning dose has completely disappeared.
What matters is not just when the last drink happened, but how much caffeine may still be in your system by bedtime.
Why Caffeine Can Still Matter Hours Later
Caffeine stays in the body long enough for an afternoon dose to remain relevant at night.
Its elimination half-life in healthy adults is commonly around several hours, although it varies substantially among people. A half-life is not the amount of time until caffeine disappears. It is approximately how long it takes for the amount in the body to fall by half.
Imagine someone consumes 200 milligrams of caffeine and, purely for illustration, has a five-hour half-life.
After about five hours, roughly 100 milligrams would remain.
Five hours later, roughly 50 milligrams.
Real metabolism is more complicated than that simple calculation, so it should not be used as a personal caffeine timer. But it explains why “I drank it hours ago” does not necessarily mean “it is gone.”
People also clear caffeine at different rates. Genetics contribute, but so can smoking, medications, hormonal factors, liver function, and other biological differences.
That helps explain why one person can have an after-dinner espresso and sleep apparently normally while another notices that a midafternoon coffee keeps them awake.
The same clock time can represent a different caffeine exposure in two different people.
Falling Asleep Does Not Tell You the Whole Story
Another common test is simple:
“Coffee doesn’t bother me. I can still fall asleep.”
But sleep onset is only one part of sleep.
Caffeine can affect total sleep time, how efficiently you remain asleep, how much you wake during the night, and the distribution of sleep stages. The 2023 meta-analysis found effects across several of these outcomes rather than only delayed sleep onset.
People do not always notice every change, either.
In the newer dose-and-timing trial, the 400-milligram dose caused objective sleep disruption when taken eight or 12 hours before bed even though participants did not consistently report poorer sleep quality at those earlier time points. The subjective effect became much clearer when the same high dose was taken four hours before bed.
The older six-hour experiment found a similar mismatch between measured sleep disturbance and what participants perceived.
That does not mean subjective sleep quality is irrelevant, or that every unnoticed change on a sleep recording matters clinically.
It means something narrower:
Being able to fall asleep after caffeine does not prove caffeine had no effect on your night.
You may fall asleep easily but sleep somewhat less. You may wake more often. Or caffeine may genuinely make little practical difference to you at that dose and time.
The evidence supports individual variation—not caffeine anxiety.
A Cutoff Window Makes More Sense Than a Cutoff Time
So is 3 p.m. too late?
That cannot be answered without knowing when you sleep.
For someone who goes to bed at 10 p.m., 3 p.m. is seven hours beforehand.
For someone whose bedtime is midnight, it is nine hours beforehand.
Then comes the dose.
Was the caffeine 60 milligrams? About 100? Two hundred? A large 400-milligram dose? Had there already been several caffeinated drinks earlier in the day?
Those are meaningfully different exposures.
The controlled evidence suggests a useful general pattern: the larger the dose and the closer it occurs to bedtime, the greater the potential for sleep disruption. High doses can remain relevant surprisingly far from sleep, while smaller doses may have much less effect.
That makes “no coffee after 2 p.m.” too rigid to be a universal biological rule.
A bedtime-based window is more sensible.
For someone who suspects caffeine is affecting sleep, the practical experiment is also fairly simple: keep the sleep schedule reasonably stable, move the final caffeine earlier or reduce the final dose, and see whether sleep changes in a way that actually matters—falling asleep more easily, waking less, sleeping longer, or feeling more refreshed the next day.
That is not a diagnostic test. Persistent poor sleep can have many causes besides caffeine.
But caffeine is unusually easy to manipulate. You can change the dose or timing without needing to guess at your personal half-life.
So How Late Is Too Late?
There is no scientifically defensible hour that applies to everyone.
The old six-hour rule captures something real: substantial caffeine close enough to bedtime can interfere with sleep, and six hours may not always provide enough separation.
But the newer evidence adds the missing variable.
A 100-milligram dose and a 400-milligram dose are not the same sleep experiment.
Neither are 3 p.m. for someone who sleeps at 10 and 3 p.m. for someone who sleeps at midnight.
So the most useful caffeine cutoff is not a fixed number on the clock. It is a window before your own bedtime, shaped by dose and individual sensitivity.
If sleep is a priority, larger doses deserve a wider margin. If you are particularly sensitive to caffeine, your margin may need to be wider still. And if moving caffeine earlier noticeably improves your sleep, that response is more useful than trying to force yourself into somebody else’s universal cutoff.
The question is not simply “Is afternoon coffee bad?”
It is “How much caffeine am I giving my body, and how much time am I giving it before sleep?”

