Sleep  ·  September 22, 2026  ·  4 min

Caffeine and sleep: when to stop drinking coffee before bed

Caffeine has a half-life of 5 to 6 hours, so a 4 p.m. coffee lingers well into your evening. Why to cut it off 8 to 10 hours before bed, and what that changes.

Caffeine and sleep: when to stop drinking coffee before bed

The short answer: stop drinking coffee 8 to 10 hours before you go to bed. Caffeine has a half-life of about 5 to 6 hours — the time it takes your body to clear half of it. In other words, a coffee at 4 p.m. still leaves half its dose active in your blood at 9 or 10 p.m., and a good quarter of it 10 to 12 hours later. That's not nothing: it's enough to degrade your night without even keeping you from falling asleep.

In practice, if you're aiming for bed around 11 p.m., your last coffee lands somewhere around 1 to 3 p.m. That sounds early. Yet it's the setting that best protects your recovery — and one of the easiest to change.

What is caffeine's half-life, and why 8 to 10 hours?

Half-life is the time after which half of a substance is left. For caffeine, count on 5 to 6 hours in the average adult. Run the numbers on an espresso at 4 p.m., which contains about 80 mg of caffeine according to the European Food Safety Authority (EFSA):

A 2023 meta-analysis (24 studies) put a number on this threshold: to avoid losing sleep, a cup of coffee (107 mg) should be drunk at least 8.8 hours before bed, and a serving of pre-workout (217.5 mg) at least 13.2 hours before. The EFSA, for its part, notes that a single 100 mg dose close to bedtime can already disrupt sleep in some adults.

Hence the simple rule: last coffee 8 to 10 hours before bed. And watch out for the sources people forget to count — tea, sodas, dark chocolate, pre-workout and some painkillers contain it too. Green tea or matcha, with their reputation for being “gentle,” can pack as much as a weak coffee; decaf isn't completely caffeine-free, but its dose stays low enough to go unnoticed in the evening for most people.

How does caffeine actually affect your brain?

Caffeine doesn't give you energy: it masks fatigue. Over the course of the day, a molecule called adenosine builds up in your brain and creates sleep pressure — that urge to sleep that rises hour after hour. Caffeine slips onto the same receptors and blocks the signal without making the adenosine go away. It keeps piling up behind the scenes. When the caffeine wears off, the whole backlog hits you at once — the familiar crash. Blocking that signal too late in the evening keeps your sleep pressure from doing its job at the right time.

Why can some people sleep after an espresso?

Because how fast you clear caffeine is largely genetic. A single liver enzyme, CYP1A2, handles 95% of caffeine clearance, and variants of its gene make you a “fast” or “slow” metabolizer. Fast metabolizers clear caffeine in a few hours and can have a coffee after dinner with no apparent harm. Slow metabolizers hold on to it much longer: for them, a simple afternoon coffee is enough to shave time off the night. Age, pregnancy, some medications and smoking shift things further. You don't know your profile on paper — but your sleep does. Test it: cut coffee at noon for two weeks and see whether your nights change. One clue you're a slow metabolizer: an afternoon coffee leaves your heart beating a little fast or your mind racing at bedtime. If that's you, move your cutoff even earlier — better one less coffee than one less night of sleep.

Can caffeine hurt your sleep even if you fall asleep fine?

This is the most common mistake. Plenty of people fall asleep easily after a late coffee and conclude caffeine doesn't bother them. Except falling asleep isn't the same as sleeping well. Even when it doesn't delay sleep onset, leftover caffeine cuts into deep sleep — the most restorative stage, concentrated early in the night — and fragments the rest. Across the studies in the 2023 meta-analysis, caffeine shortened the night by 45 minutes on average, removed about 11 minutes of deep sleep and added 12 minutes of wakefulness during the night. And in a 2013 trial, a high dose (400 mg) taken 6 hours before bed still clearly disrupted sleep. You get a night of normal length but degraded quality, and you wake up needing… a coffee. The loop is closed. If you really want to get more deep sleep, late caffeine is the first lever to cut — right after alcohol. And if you're getting your 7 to 9 hours but still feel drained, too much coffee masking a sleep debt is one of the most common causes of lasting fatigue.

Key takeaways

Frequently asked questions

How long before bed should you stop drinking coffee?

About 8 to 10 hours before bed. Caffeine has a half-life of 5 to 6 hours: a 4 p.m. coffee still leaves half its dose active in the evening. If you go to bed around 11 p.m., your last coffee should be in the early afternoon.

Does caffeine reduce deep sleep?

Yes, even when it doesn't delay falling asleep. Leftover caffeine cuts into deep sleep and fragments the night: you sleep a normal length of time, but the quality is worse.

Why can some people sleep after drinking coffee?

Because how fast caffeine is cleared is largely genetic. Fast metabolizers clear it in a few hours; slow metabolizers keep it much longer and find their night disrupted by a simple afternoon coffee.

Sources

  1. Gardiner C, Weakley J, Burke LM, et al. The effect of caffeine on subsequent sleep: A systematic review and meta-analysis. Sleep Med Rev. 2023. doi:10.1016/j.smrv.2023.101764
  2. Drake C, Roehrs T, Shambroom J, Roth T. Caffeine effects on sleep taken 0, 3, or 6 hours before going to bed. J Clin Sleep Med. 2013. doi:10.5664/jcsm.3170
  3. European Food Safety Authority. Caffeine (Scientific Opinion on the safety of caffeine). 2015. efsa.europa.eu
  4. Nehlig A. Interindividual Differences in Caffeine Metabolism and Factors Driving Caffeine Consumption. Pharmacol Rev. 2018. doi:10.1124/pr.117.014407
  5. Reichert CF, Deboer T, Landolt HP. Adenosine, caffeine, and sleep-wake regulation: state of the science and perspectives. J Sleep Res. 2022. doi:10.1111/jsr.13597
Go further

What this article explains,
the app measures for you.

Ecleptic brings your sleep, nutrition and training together in one score, every morning. The iOS beta is open to a small circle.

Request access