Sleep notes

When to Stop Drinking Coffee Before Bed

By ToSleep AI · 2026-09-15

Research reviewed September 15, 2026. Published by the developer of ToSleep AI; not clinically reviewed. The cited researchers are not affiliated with ToSleep and do not endorse it.

The short answer: In a 2023 meta-analysis of 24 studies, a regular coffee (about 107 mg of caffeine) needed to be finished at least 8.8 hours before bedtime to avoid losing sleep time. For a typical pre-workout supplement (about 217.5 mg), the figure was 13.2 hours. If you go to bed at 11 PM, that means your last coffee by about 2 PM. Gardiner et al., 2023

What does caffeine do to your sleep?

Researchers at Australian Catholic University and partner institutions pooled 24 studies that measured night-time sleep after caffeine. On average, caffeine:

  • cut total sleep time by about 45 minutes
  • lowered sleep efficiency by 7% (the share of time in bed actually spent asleep)
  • added about 9 minutes to the time it took to fall asleep
  • added about 12 minutes of being awake after first falling asleep

It also changed the type of sleep. Light sleep (N1) went up by about 6 minutes, while deep sleep (N3 and N4) went down by about 11 minutes. Gardiner et al., 2023

These are averages across studies, not a prediction for you. People process caffeine at different speeds, and the dose in a cup varies a lot.

So when should you have your last coffee?

The study worked out cut-off times by looking at how the timing of caffeine related to lost sleep:

Drink Caffeine used in the study Finish at least
Coffee (250 mL) 107 mg 8.8 hours before bed
Pre-workout supplement (one serve) 217.5 mg 13.2 hours before bed

A quick way to use this:

Usual bedtime Last regular coffee by Last pre-workout by
10:00 PM about 1:10 PM about 8:50 AM
11:00 PM about 2:10 PM about 9:50 AM
12:00 AM about 3:10 PM about 10:50 AM

Times are calculated from the study’s cut-offs and rounded. A strong café coffee or energy drink can contain more caffeine than the amounts studied, so an earlier cut-off would be sensible.

“But I can fall asleep fine after an espresso”

Falling asleep is only one part of the picture. In the pooled results, the time to fall asleep grew by just 9 minutes, while total sleep dropped by 45 minutes and deep sleep shrank. You can feel like you slept normally and still lose some of the deeper sleep.

Practical ways to cut back without giving up coffee

  • Move coffee earlier, rather than removing it. Count back 9 hours from the time you actually go to bed.
  • Watch the hidden caffeine. Some teas, colas, chocolate and pre-workout products count too.
  • Switch the afternoon cup to decaf if the ritual matters more than the effect.
  • Keep your bedtime steady. A cut-off only helps if you know roughly when bedtime is.

How ToSleep AI fits in

ToSleep AI suggests a bedtime based on when you need to wake up. Once you know that bedtime, you can count back about 9 hours for your last regular coffee. ToSleep AI is a wellness app for iPhone and Apple Watch, and sleep stages it shows are estimates, not lab measurements.

FAQ

Is 8.8 hours a strict rule? No. It’s the point at which the pooled studies stopped showing a loss of total sleep time for a 107 mg coffee. Your own sensitivity and the actual caffeine in your drink can move it either way.

Does decaf count? Decaf still has a small amount of caffeine, but far less than the doses studied here.

What about tea? The study did not give a separate cut-off for tea. Tea usually contains less caffeine per cup than coffee, but strength varies.

Wellness information, not medical advice. If you have ongoing trouble sleeping, talk to a doctor.

Sources

Wellness information, not medical advice.