The Caffeine GuideEnjoy it and sleep well
Calculator

When should I stop drinking coffee?

It depends on the cup more than the clock. Put in your drinks and when you fall asleep, and drag them along the day to see what's still in you when your head hits the pillow.

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.

39 to 101 mg if your half-life is 3 to 6 hours. About 48 mg at 3am.

0501001502002503006am9amnoon3pm6pm9pmmidnight3am40 mg80 mg83 mg
  • A cup of black coffee95 mg
  • A big paper cup of coffee190 mg

Half-life: 5 hours, the average. Set yours

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

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

A measured cost Over our 80 mg line. 400 mg taken 12 hours before bed leaves about 84 mg and still cut about 21 minutes of deep sleep. The 40 and 80 mg lines are ours.

What your result means

  1. Low, under 40 mg: nothing to change. The 2023 review's cutoffs for a coffee and a pre-workout both leave about this much at bedtime.
  2. In between, 40 to 80 mg: one trial found nothing at this level and another found less deep sleep a little above it. If you wake up tired, move your last drink an hour or two earlier, or tap the smaller drink.
  3. A measured cost, over 80 mg: move the big drink to the morning or swap it for a small one. In a 2025 trial, 400 mg taken 12 hours before bed left about 84 mg and still cut about 21 minutes of deep sleep.
  4. No time today: your earlier drinks already leave too much at bedtime, so the afternoon ones are the place to start. Make them smaller before you move the morning cup.

What to do next

  1. Keep one change for a week, the earlier time or the smaller drink, whichever is easier to stick to.
  2. Compare two weeks. One as you are now and one with the change. On a ring or watch, look at deep sleep and time awake in the night. Without one, write down each morning how long you took to fall asleep and how rested you feel from 1 to 5.
  3. On the pill, pregnant or a smoker? Set your half-life first, since each one moves your cutoff by hours.

The latest time for each drink

For one drink and nothing else that day, on a 5 hour half-life, the latest time that leaves under 40 mg when you fall asleep. Never later than 4 hours before sleep, because no trial tested a small dose closer than that.

Last drinkmgHours before sleepAsleep 10pmAsleep 11pmAsleep midnight
Espresso, 1 shot6346:00pm7:00pm8:00pm
Black tea, 8 oz4746:00pm7:00pm8:00pm
Red Bull, 8.4 oz can805.84:15pm5:15pm6:15pm
Brewed coffee, 8 oz9573:00pm4:00pm5:00pm
Monster, 16 oz can16010.811:15am12:15pm1:15pm
Brewed coffee, 16 oz1901210:00am11:00amnoon
CELSIUS, 12 oz can20012.49:40am10:40am11:40am
Pre-workout, 1 scoop25414.17:55am8:55am9:55am

The cup beats the clock

Dose
12 hours before bed
8 hours before bed
4 hours before bed
100 mgabout a cup
21 mg leftNothing measurable
37 mg leftNothing measurable
64 mg leftNothing measurable
400 mgabout four cups
84 mg left21 minutes less deep sleep
146 mg left15 minutes less deep sleep, 29 more minutes awake
255 mg left51 minutes less sleep, 30 minutes less deep sleep
Left at bedtime on a 5 hour half-life, and what a 2025 trial of 23 healthy young men measured with a sleep monitor at home (Gardiner 2025). The dose row changes more than the hour column.

How the clock works

Almost all of a drink is absorbed within 45 minutes, so each one ramps in over 45 minutes. Then it halves: about every 5 hours on average, anywhere from 1.5 to 9.5 hours in healthy adults. The clock adds up every drink and shows the band for a half-life of 3 to 6 hours, the range a 2025 trial calls typical, so no answer is a single prescription.

The latest time works backward from your sleep: the hours it takes your last drink to fall to 40 mg, after what your earlier drinks still leave. Set a different half-life on your half-life page and the clock uses it.

Our two lines

These lines are ours, worked from the trials. Under 40 mg is low: the 2023 review's cutoffs, 8.8 hours for a 107 mg coffee and 13.2 hours for a 217.5 mg pre-workout, both leave 35 to 39 mg at bedtime on this model. 40 to 80 mg is in between: 100 mg 4 hours before bed leaves about 64 mg and showed nothing measurable in one trial. Over 80 mg is a measured cost: 400 mg 12 hours before bed leaves about 84 mg and still cut about 21 minutes of deep sleep.

Where the clock stops

It doesn't know how sensitive you are, the real size of your cup, or your real half-life. Coffee-shop cups vary a lot: one drink from the same shop measured 259 to 564 mg on six days. Very heavy days slow clearance further, so the halving fits ordinary amounts best. Check it against your own nights for two weeks.

11 sources
  1. 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
  2. Gardiner C and others, Dose and timing effects of caffeine on subsequent sleep: a randomized clinical crossover trial, Sleep, 2025doi.org
  3. Gardiner C and others, The effect of caffeine on subsequent sleep: a systematic review and meta-analysis, Sleep Medicine Reviews, 2023doi.org
  4. Drake C, Roehrs T, Shambroom J, Roth T, Caffeine effects on sleep taken 0, 3, or 6 hours before going to bed, Journal of Clinical Sleep Medicine, 2013pmc.ncbi.nlm.nih.gov
  5. USDA FoodData Central, SR Legacy: brewed coffee (171890), espresso (171891), brewed black tea (173227) and brewed green tea (171917)fdc.nal.usda.gov
  6. Red Bull, How much caffeine is in a can of Red Bull?redbull.com
  7. The Coca-Cola Company, What is caffeine?coca-colacompany.com
  8. Monster Energy original, 16 fl oz, retail label listing (caffeine from all sources 160 mg)shaws.com
  9. CELSIUS Sparkling Kiwi Guava, 12 fl oz, retail label listing (caffeine 200 mg)shop.lowesfoods.com
  10. Jagim AR, Harty PS, Camic CL, Common Ingredient Profiles of Multi-Ingredient Pre-Workout Supplements, Nutrients, 2019doi.org
  11. Denaro CP and others, Clinical Pharmacology and Therapeutics, 1990 (clearance falls with repeated high daily doses)pubmed.ncbi.nlm.nih.gov

More calculators

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