Let Me Sleep

Free tool

Caffeine calculator: when should I stop drinking coffee?

Add today's drinks and your bedtime. You'll see roughly how much caffeine is still in your system when the lights go out, and the latest time a cup is likely to leave your night alone.

last cup?

Today's drinks

Still in your system at bedtime
0 mg
Suggested last cup for tonight
5:00 PM
At least 6 hours before bed. Earlier if you're sensitive.

An estimate, not a measurement. Caffeine content varies a lot between drinks, and the half-life varies between people from roughly 2 to 10 hours.

The short answer

If you only read one thing

Stop caffeine at least 6 hours before bed. In a well-known study, 400 mg of caffeine taken 6 hours before bedtime still cut total sleep by around an hour. A 2023 review suggests a regular cup of coffee is best finished closer to 9 hours before bed.

How caffeine affects your sleep

Through the day your brain builds up a chemical called adenosine, which is a big part of why you feel sleepy by evening. Caffeine blocks the receptors adenosine acts on. It doesn't remove the tiredness; it hides it until the caffeine wears off.

The catch is how slowly it wears off. Caffeine's half-life, the time your body takes to clear half of it, averages around 5 hours in healthy adults but ranges from roughly 2 to 10 hours. With a 5-hour half-life, half of a 3 PM coffee is still circulating at 8 PM and a quarter at 1 AM.

Across studies, caffeine makes people take longer to fall asleep, wake more in the night, and lose deep sleep. The 2023 meta-analysis found it cut total sleep time by about 45 minutes on average. Many people don't notice, which is why "coffee doesn't affect me" is worth testing rather than trusting.

When to stop drinking coffee before bed

  • 6 hours is the rule most sleep clinicians use, based on the 2013 Drake study.
  • About 9 hours for a standard coffee (around 100 mg) is what the 2023 meta-analysis suggests to avoid shortening sleep. For a strong pre-workout drink (around 200 mg), it's longer still.
  • Earlier still if you clear caffeine slowly. Pregnancy and some hormonal contraceptives slow it down a lot, and some people are simply slow metabolizers.

For a typical 11 PM bedtime, that puts the last coffee somewhere between 2 PM and 5 PM. Lunchtime is a safe default if you're struggling with sleep.

How much caffeine is in common drinks?

These are typical amounts. Real drinks vary a lot by brand, bean and brew time.

DrinkTypical caffeine
Brewed coffee, 8 oz (240 ml)80–100 mg
Espresso, single shotabout 60–65 mg
Black or green tea, 8 oz30–50 mg
Cola, 12 oz can30–40 mg
Energy drink, 8 oz40–250 mg
Decaf coffee, 8 ozabout 2–15 mg

The FDA considers up to about 400 mg a day generally safe for healthy adults. That's a daily limit for safety, not a sleep target. For sleep, timing matters more than the total.

What to drink in the afternoon instead

  • Decaf coffee, which still has a small amount of caffeine, so keep it to a cup.
  • Herbal teas like rooibos, peppermint or chamomile, which have none.
  • A short walk outside. Daylight and movement help with the 3 PM slump more than you'd think, and they help your body clock at night too.

Build the cutoff into your evening

A cutoff only helps if you remember it. In Let Me Sleep, "Last coffee before…" is the first item on your wind-down checklist, set from your own sleep window, so the reminder moves when your bedtime does.

Sources

  1. Caffeine effects on sleep taken 0, 3, or 6 hours before going to bed (Drake et al., 2013), Journal of Clinical Sleep Medicine
  2. The effect of caffeine on subsequent sleep: a systematic review and meta-analysis (Gardiner et al., 2023), Sleep Medicine Reviews
  3. Spilling the beans: how much caffeine is too much?, U.S. Food and Drug Administration

Want this as a plan you can follow tonight?

Let Me Sleep turns these ideas into a personal 6-week program: a sleep window, a wind-down checklist and one five-minute lesson a day. Free to download.