Most sleep experts recommend stopping caffeine at least 8 hours before bedtime, though some people need 10 hours or more. If you go to bed at 10 p.m., that means your last cup of coffee should be around 2 p.m. at the latest. The exact cutoff depends on how quickly your body processes caffeine, which varies surprisingly widely from person to person.
Why 8 Hours Is the Standard Guideline
Caffeine has an average half-life of about 5 hours in healthy adults. That means if you drink a cup of coffee with 100 mg of caffeine at 2 p.m., roughly 50 mg is still circulating at 7 p.m., and about 25 mg remains at midnight. Even that residual amount can interfere with sleep quality in ways you might not consciously notice.
The Sleep Foundation recommends a minimum 8-hour buffer between your last caffeine intake and bedtime. That window gives your body enough time to clear most of the caffeine from your system. But “most” isn’t all. If you’re sensitive to caffeine or struggling with sleep, extending that window to 10 hours or more often makes a noticeable difference.
What Caffeine Actually Does to Your Sleep
Throughout the day, a chemical called adenosine gradually builds up in your brain. This buildup is what makes you feel increasingly sleepy as the hours pass. Caffeine works by blocking the receptors that adenosine binds to, essentially masking the “I’m tired” signal your brain is trying to send. The wakefulness you feel after coffee isn’t new energy. It’s your brain being prevented from recognizing its own fatigue.
A large meta-analysis published in Sleep Medicine Reviews quantified exactly how much caffeine disrupts a night of rest. On average, caffeine consumed during the day reduced total sleep time by 45 minutes and sleep efficiency by 7%. It took 9 minutes longer to fall asleep, and people woke up for an additional 12 minutes during the night. Perhaps most importantly, deep sleep (the most restorative stage) decreased by about 11 minutes, while light sleep increased. You might sleep for what feels like a normal number of hours and still wake up less rested because the quality of that sleep was degraded.
Even 6 Hours Isn’t Always Enough
A well-known study published in the Journal of Clinical Sleep Medicine tested what happens when people consume caffeine at bedtime, 3 hours before bed, and 6 hours before bed. The results surprised even the researchers. Caffeine taken a full 6 hours before bedtime still significantly reduced deep sleep. Participants lost measurable amounts of restorative sleep even when they didn’t feel like the caffeine was still affecting them.
That’s a critical point: you can feel sleepy enough to drift off and still be getting lower-quality sleep because caffeine is interfering with your deeper sleep stages. The subjective sense that “caffeine doesn’t affect me” doesn’t always match what’s happening in the brain.
Your Genetics Change the Timeline
The 5-hour average half-life is just that: an average. Caffeine’s actual half-life ranges from 1.5 to 9.5 hours depending on the person. The primary reason for this wide range is genetic variation in a liver enzyme called CYP1A2, which is responsible for breaking down caffeine.
If you’re a fast metabolizer, your body clears caffeine quickly, and an afternoon coffee may not bother your sleep at all. If you’re a slow metabolizer, caffeine lingers in your system far longer than average, and even a lunchtime cup could still be active at bedtime. There’s no simple at-home test for this. The most practical approach is to track your own caffeine timing and sleep quality over a couple of weeks and look for patterns.
Pregnancy Dramatically Slows Caffeine Clearance
During pregnancy, the enzyme that processes caffeine becomes significantly less active. In the third trimester, caffeine’s half-life can extend to roughly 15 hours, about three times longer than normal. A morning coffee at 8 a.m. could still have half its caffeine circulating at 11 p.m.
This is one reason health organizations recommend pregnant women limit caffeine to 200 to 300 mg per day. But timing matters too. With a half-life that long, caffeine can accumulate if consumed frequently. Some researchers have suggested that during late pregnancy, a more pharmacologically sound guideline would be no more than one caffeinated beverage every 24 to 36 hours rather than simply capping the daily milligram total.
Hidden Caffeine Sources to Watch
If you’re cutting off caffeine at 2 p.m. but still drinking decaf coffee in the evening, you may be getting more caffeine than you think. Testing of decaffeinated coffee from various outlets found caffeine levels ranging from 0 to nearly 14 mg per 16-ounce serving. Decaf espresso from Starbucks contained between 3 and 16 mg per shot. That’s a fraction of a regular cup, but for someone who’s caffeine-sensitive, it’s enough to matter, especially if you’re having two or three cups.
Dark chocolate, certain teas, and some over-the-counter pain medications also contain meaningful amounts of caffeine. If you’ve moved your coffee cutoff earlier and still aren’t sleeping well, these hidden sources are worth examining.
How to Find Your Personal Cutoff
Start with the 8-hour guideline as a baseline. If you go to bed at 11 p.m., have your last caffeinated drink by 3 p.m. Give this a consistent two-week trial rather than judging by a single night, since sleep quality fluctuates for many reasons.
If you’re still not sleeping well after two weeks, push the cutoff back to 10 hours. Some people, particularly slow metabolizers, ultimately find that limiting caffeine to the morning hours (before 10 or 11 a.m.) produces the best results.
Pay attention to more than just whether you can fall asleep. The signs that caffeine is still affecting you are often subtle: waking up briefly during the night, feeling unrested despite a full 7 or 8 hours, or noticing that your sleep feels lighter than it should. These are the hallmarks of caffeine-disrupted deep sleep, and they can persist even when you have no trouble drifting off initially.

