The Caffeine GuideEnjoy it and sleep well
A half-drunk mug on a nightstand beside an analog alarm clock
Sleep and timing

When should I stop drinking coffee before bed?

By GyroscopeUpdated November 14, 20268 sources
On this page
  1. The latest time for each drink
  2. Where the 40 mg line comes from
  3. Can I have a small cup closer to bed?
  4. Find your own time

It depends on the size of the drink more than the time. Stop an 8 oz coffee about 7 hours before bed, a 16 oz coffee about 12 hours before, and a single espresso or a tea about 4. For an 11pm bedtime that’s 4pm, 11am and 7pm.

Most advice gives one time for everyone, like no coffee after 2pm, or nothing within 6 hours of bed. One time can’t fit both a single espresso (63 mg) and a CELSIUS (200 mg), which has three times the caffeine and takes about 8 hours longer to fall to the same level.

We’d have the big drinks in the morning and keep anything after lunch to one small cup. In a 2025 trial, a small dose 4 hours before bed did nothing measurable to sleep, while a big dose still cut deep sleep when it was taken 12 hours before. Then we’d check it against your own nights for two weeks, because people clear caffeine at very different speeds.

The latest time for each drink

Last drinkCaffeineAsleep at 10pmAsleep at 11pmAsleep at midnight
Single espresso63 mg6pm7pm8pm
Black tea, 8 oz47 mg6pm7pm8pm
Red Bull, 8.4 oz80 mg4:15pm5:15pm6:15pm
Coffee, 8 oz95 mg3pm4pm5pm
Monster, 16 oz160 mg11:15am12:15pm1:15pm
Coffee, 16 oz190 mg10am11amnoon
CELSIUS, 12 oz200 mg9:40am10:40am11:40am
Pre-workout scoop, average254 mg7:55am8:55am9:55am

Each time keeps you under 40 mg when you fall asleep, on the average half-life of 5 hours, and assumes it’s your only caffeine that afternoon. On the pill, late in pregnancy or as a heavy smoker, your times move, and the half-life calculator shows how far.

Where the 40 mg line comes from

A 2023 review of 24 sleep studies worked out that a coffee (107 mg) should be had at least 8.8 hours before bed, and a standard pre-workout serving (217.5 mg) at least 13.2 hours before. They’re different drinks with different times, but on a 5 hour half-life both leave about 35 to 39 mg at bedtime. That’s where we drew our lower line, at 40 mg.

Our upper line is 80 mg. In the 2025 trial, 400 mg taken 12 hours before bed leaves about 84 mg at bedtime, and it still cut about 21 minutes of deep sleep. The trial’s 100 mg dose at 4 hours leaves about 64 mg and showed nothing measurable, so between 40 and 80 is a gray zone.

Can I have a small cup closer to bed?

The arithmetic says a cup of green tea could go almost right up to bedtime. But none of the trials tested a small dose closer than 4 hours before bed, so every time in the table stops at 4 hours.

Find your own time

Put your drinks and your bedtime into the cutoff clock below. It stacks every drink in your day, so a morning coffee moves your afternoon cutoff too. Then try it for two weeks, one week as you are and one with your last cup moved earlier, and compare your mornings or your tracker. The quiz gives you your own cutoff and the one change for tonight.

When should I stop?

A cup of black coffee

When you fall asleep at 11:00pm

83 mgA measured cost

You'll fall asleep with about a cup of coffee in you.

0501001502002506am9amnoon3pm6pm9pmmidnight3am40 mg80 mg83 mg
  • A cup of black coffeeBrewed coffee, 8 oz95 mg
  • A big paper cup of coffeeBrewed coffee, 16 oz190 mg

Your last drink, a 16 oz coffee at 3:00pm

Under 40 mg at sleep
by 8:10am
Under 80 mg
by 2:45pm

The full clock, with the band, 3am and the table by drink.

8 sources
  1. Gardiner C and others, Dose and timing effects of caffeine on subsequent sleep: a randomized clinical crossover trial, Sleep, 2025doi.org
  2. Gardiner C and others, The effect of caffeine on subsequent sleep: a systematic review and meta-analysis, Sleep Medicine Reviews, 2023doi.org
  3. Antonio J and others, Common questions and misconceptions about caffeine supplementation: what does the scientific evidence really show? Journal of the International Society of Sports Nutrition, 2024doi.org
  4. USDA FoodData Central, SR Legacy: brewed coffee (171890), espresso (171891), brewed black tea (173227) and brewed green tea (171917)fdc.nal.usda.gov
  5. Red Bull, How much caffeine is in a can of Red Bull? checked 2026-11-14redbull.com
  6. Monster Energy, 16 fl oz can, label photographed November 2025 (caffeine from all sources 160 mg per can), Open Food Facts 0070847811169, checked 2026-11-14world.openfoodfacts.org
  7. CELSIUS Sparkling Fantasy Vibe, 12 fl oz can, label photographed November 2025 (caffeine content 200 mg), Open Food Facts 0889392000597, checked 2026-11-14world.openfoodfacts.org
  8. Jagim AR, Harty PS, Camic CL, Common Ingredient Profiles of Multi-Ingredient Pre-Workout Supplements, Nutrients, 2019doi.org
With Gyroscope One, you see the milligrams and the time of your last cup, found in your drinks, next to your sleep. Open Gyroscope

Your personalized guide

Is my coffee keeping me up?

Eight taps. You get how much caffeine is still in you when you fall asleep, the latest time for the drink you actually have, and the one change for tonight.

  • What you fall asleep with, in milligrams
  • Your cutoff for your own drink
  • Free, under a minute
Start