Sleep
When to Stop Drinking Coffee Before Bed (By Dose, Not Guesswork)
"No coffee after 2 pm" is too simple. The right caffeine cutoff depends on how strong the drink is and how fast you clear it. Here's a cutoff table for common drinks, backed by sleep studies.
The short answer
- For a regular cup of coffee (~100 mg), stop at least 6–9 hours before bed. A 2023 meta-analysis puts it at 8.8 hours.
- Strong drinks need more time. A 200+ mg pre-workout or a big cold brew needs about 12–13 hours.
- Small doses matter less: in a 2025 trial, 100 mg had no measurable effect on sleep even 4 hours before bed.
- A useful rule: aim to have under 50 mg of caffeine left in your body at lights-out.
Most sleep advice says "no caffeine after noon" or "stop 6 hours before bed". Those rules are a decent start, but they treat a single espresso and a venti cold brew as the same thing. They aren't. One has about 63 mg of caffeine; the other can have over 300 mg.
The better way to think about your last coffee is in terms of dose, timing and your own half-life. Here's what the research says, and a cutoff table you can actually use.
What the sleep studies found
The classic "6 hours" study. In 2013, researchers gave people 400 mg of caffeine (about four cups of coffee) at bedtime, 3 hours before, or 6 hours before. All three disrupted sleep compared with a placebo, and even the 6-hour dose cut total sleep time enough that the authors recommended avoiding substantial caffeine for at least 6 hours before bed.
The 2023 meta-analysis. Pooling 24 studies, researchers found caffeine cut total sleep by 45 minutes, lowered sleep efficiency by 7%, and shaved 11 minutes off deep sleep. To avoid losing sleep, they calculated that a coffee (107 mg) should be drunk at least 8.8 hours before bed, and a standard pre-workout (217.5 mg) at least 13.2 hours before.
The 2025 dose-and-timing trial. The same research group gave 100 mg or 400 mg of caffeine 12, 8 or 4 hours before bed. The 100 mg dose had no significant effect on sleep at any time, even 4 hours before bed. The 400 mg dose delayed sleep when taken within 12 hours of bed and fragmented it within 8 hours. People also underestimated the damage: sleep measured worse than it felt.
Put together, the answer depends on how much caffeine you have, not just when.
The caffeine cutoff table
Here's how many hours before bed each drink needs to drop under 50 mg, using the same caffeine model as our app. The 50 mg line is a sensible target: it's about half a coffee, and roughly the level where the studies above stop seeing a clear effect.
| Drink | Caffeine | Fast (4 h) | Typical (5.5 h) | Slow (7.5 h) |
|---|---|---|---|---|
| Cola, 12 oz | 34 mg | any time | any time | any time |
| Black tea | 47 mg | any time | any time | any time |
| Single espresso | 63 mg | 1.5 h | 2 h | 3 h |
| Energy drink, 250 ml | 80 mg | 3 h | 4 h | 5.5 h |
| Drip coffee, 8 oz | 95 mg | 4 h | 5.5 h | 7 h |
| Latte, two shots | 126 mg | 5.5 h | 7.5 h | 10.5 h |
| Cold brew, 10 oz | 155 mg | 7 h | 9 h | 12.5 h |
| Pre-workout / big energy drink | 200 mg | 8 h | 11.5 h | 15.5 h |
| Grande brewed coffee (Starbucks) | 310 mg | 11 h | 14.5 h | 20 h |
Two things jump out. First, a small espresso after lunch is very different from a large filter coffee after lunch. Second, a slow metaboliser, including anyone on the pill or pregnant, needs to stop far earlier than the "6 hours" rule suggests. (Why that happens is in how long caffeine lasts.)
Work out your own cutoff
Choose a drink, when you'd have it and when you go to bed. The chart shows how much caffeine will still be active when you turn off the light.
Five ways to keep your coffee and your sleep
- Move the big drink earlier. Have your strongest coffee in the morning and make afternoon drinks smaller.
- Downsize after lunch. A single espresso (63 mg) instead of a large filter coffee (190+ mg) can move your safe cutoff by hours.
- Go half-caf or decaf in the afternoon. Decaf still has 2–15 mg, which is almost nothing at bedtime.
- Watch hidden caffeine. Iced tea, cola, pre-workout, dark chocolate and some painkillers all add up.
- Know your half-life. If a 3 pm coffee keeps you up, you're probably a slow metaboliser. Plan for a longer half-life rather than fighting it.
What if you work nights or go to bed early?
The rule works the same way, just measured from your bedtime, not the clock. If you sleep at 9 pm, a noon latte is already inside the 9-hour window. If you work nights and sleep at 8 am, your "afternoon" is around 11 pm. Research also suggests caffeine hits daytime recovery sleep harder than night sleep, so shift workers should be even more careful near the end of a shift.
Frequently asked questions
How many hours before bed should I stop drinking coffee?
For a regular 8 oz coffee (about 95–107 mg), aim for at least 6 hours and ideally around 8–9 hours. A 2023 meta-analysis recommends 8.8 hours for a standard coffee and 13.2 hours for a 217 mg pre-workout.
Is coffee at 3 pm too late?
For an 11 pm bedtime, one small coffee at 3 pm is usually fine for a typical metaboliser, since it drops under 50 mg by around 8:30 pm. A large coffee or cold brew at 3 pm, or any coffee if you're a slow metaboliser, will likely still be above 50 mg at bedtime.
Can I drink caffeine and still fall asleep?
Many people can, but falling asleep isn't the whole story. Studies show caffeine near bedtime reduces deep sleep and total sleep time even when people feel they slept fine.
How much caffeine is OK at bedtime?
There's no official number, but staying under about 50 mg of active caffeine at lights-out is a sensible target. In a 2025 trial, 100 mg taken 4 hours before bed had no measurable effect on sleep, and it would have been well under 100 mg by bedtime.
Does decaf coffee affect sleep?
Very little. Decaf has about 2–15 mg of caffeine per cup, far below the levels that disrupt sleep for most people. Very sensitive people may still want to avoid it late at night.
Sources
- Drake C, et al. Caffeine effects on sleep taken 0, 3, or 6 hours before going to bed. J Clin Sleep Med, 2013.
- Gardiner C, et al. The effect of caffeine on subsequent sleep: a systematic review and meta-analysis. Sleep Med Rev, 2023.
- Gardiner CL, et al. Dose and timing effects of caffeine on subsequent sleep: a randomized clinical crossover trial. Sleep, 2025.
- Carrier J, et al. Effects of caffeine are more marked on daytime recovery sleep than on nocturnal sleep. Neuropsychopharmacology, 2007.
- Mayo Clinic. Caffeine content for coffee, tea, soda and more.
- U.S. FDA. Spilling the Beans: How Much Caffeine is Too Much?
General wellness information, not medical advice. If you're pregnant, have a heart condition, or take medication that affects caffeine, check your limits with a doctor.