When should I stop drinking coffee?
Enter your bedtime and today’s drinks. The calculator estimates how much caffeine may be left at bedtime and shows the cutoff times suggested by sleep research.
Caffeine cutoff calculator
About 47 mg of caffeine may still be in your body at
Show the chart as a table
Cutoff times from the research, for an 11:00 PM bedtime
- : at least 6 hours before bed. Drake et al. found that 400 mg taken 6 hours before bedtime still disrupted sleep and supported avoiding “substantial caffeine use for a minimum of 6 hours prior to bedtime” [4].
- : 8.8 hours before bed for a coffee. A 2023 meta-analysis concluded that “coffee (107 mg per 250 mL) should be consumed at least 8.8 h prior to bedtime” to avoid losing sleep [5].
- : 13.2 hours before bed for a pre-workout supplement (217.5 mg), from the same meta-analysis [5].
The milligram figure is a model estimate (half-life 5 h), not a measurement. Research hasn’t set a “safe” amount at bedtime, which is why the guidance is given in hours before bed.
This calculator gives general estimates based on average 90-minute sleep cycles. It isn’t medical advice. If you have ongoing trouble sleeping, loud snoring, or daytime sleepiness, talk to a doctor.
How accurate is this? It’s an estimate from a simple model: each drink halves every half-life. Half-lives vary several-fold between people [2], and caffeine reaches its peak in the blood anywhere from 15 to 120 minutes after you drink it [2]; the model ignores that delay.
Caffeine in common drinks
| Drink | Serving | Typical caffeine |
|---|---|---|
| Brewed coffee (regular, non-specialty) | 12 fl oz | 113–247 mg |
| Black tea | 12 fl oz | 71 mg |
| Green tea | 12 fl oz | 37 mg |
| Caffeinated soft drink | 12 fl oz | 23–83 mg |
| Energy drink | 12 fl oz | 41–246 mg |
| Decaf coffee | 8 fl oz | 2–15 mg |
These are the FDA’s typical figures [1]. The calculator fills in the low end of each range; edit the milligrams if your drink’s label says otherwise. For most adults, the FDA has cited 400 mg a day as an amount not generally associated with negative effects, while noting wide variation in sensitivity [1].
How the estimate works
Your body clears caffeine gradually, and the speed is described by its half-life: the time it takes to eliminate half of what you consumed. The mean half-life in healthy adults is about 5 hours, with a range of about 1.5 to 9.5 hours [2]. The calculator applies caffeine left = amount × 0.5hours ÷ half-life to each drink and adds them up.
| Hours after drinking | Estimated caffeine left |
|---|---|
| 0 | 113 mg |
| 5 | 57 mg |
| 10 | 28 mg |
| 15 | 14 mg |
Pregnancy, smoking, some medicines and liver health change the half-life [3]. The Sleep Foundation gives a wider range of 2 to 12 hours [3]. If you are sensitive to caffeine, try a longer half-life in the advanced settings.
What the research says about cutoff times
Two studies give practical, hour-based guidance, and the calculator turns them into clock times for your bedtime:
- 6 hours. Drake and colleagues gave people 400 mg of caffeine at bedtime, 3 hours before or 6 hours before. All three disrupted sleep compared with a placebo, and the authors concluded the results support avoiding substantial caffeine for a minimum of 6 hours before bedtime [4].
- 8.8 hours for coffee, 13.2 hours for a pre-workout. A 2023 systematic review and meta-analysis of 24 studies concluded that to avoid reductions in total sleep time, coffee (107 mg per 250 mL) should be consumed at least 8.8 hours before bedtime, and a standard pre-workout supplement (217.5 mg) at least 13.2 hours before [5].
The same meta-analysis found that caffeine reduced total sleep time by 45 minutes and sleep efficiency by 7%, increased the time to fall asleep by 9 minutes, and reduced deep sleep [5]. CDC lists avoiding caffeine in the afternoon or evening among habits that can improve sleep [6].
Why caffeine keeps you awake
During the day a chemical called adenosine builds up and helps make you feel sleepy. Caffeine counteracts sleepiness by blocking adenosine’s actions [7]. That’s useful in the morning and unhelpful at night.
Decaf and hidden caffeine
Decaffeinated doesn’t mean caffeine-free: decaf coffee typically has 2 to 15 mg in an 8-ounce cup [1]. The FDA also notes caffeine can turn up in energy bars, chewing gum, dietary supplements and some over-the-counter medicines [1]. If you’re pregnant, trying to become pregnant, breastfeeding or taking medication, the FDA recommends talking to your healthcare provider about caffeine [1].
Once you know your cutoff, use the bedtime calculator to plan the rest of the evening.
Related guides
Learn how caffeine fits into the bigger picture of sleep.
- Sleep cycles explained: the stages, REM, and why cycles vary.
- How much sleep do you need by age?: the recommended hours for every age group.
- Sleep FAQ: 26 common questions, answered with sources.
Frequently asked questions
How late can I drink coffee?
Research gives two benchmarks: avoid substantial caffeine for at least 6 hours before bed [4], and a 2023 meta-analysis concluded that a coffee (107 mg) should be drunk at least 8.8 hours before bedtime to avoid losing sleep [5].
What is caffeine’s half-life?
The time it takes your body to clear half of it. The mean in healthy adults is about 5 hours, but it can range from 1.5 to 9.5 hours [2]; the Sleep Foundation gives 2 to 12 hours [3].
How much caffeine is in a cup of coffee?
FDA figures for a 12-ounce regular brewed coffee range from 113 to 247 mg [1]. Brand, size and brewing method all change it.
How much caffeine is too much?
For most adults, the FDA has cited 400 mg a day as an amount not generally associated with negative effects, but sensitivity varies widely [1]. If you’re pregnant, breastfeeding or take medication, ask your healthcare provider.
Does decaf have caffeine?
Yes, a little: decaf coffee typically has 2 to 15 mg in an 8-ounce cup [1].
Why does coffee keep me awake?
Adenosine helps make you feel sleepy, and caffeine counteracts sleepiness by blocking its actions [7].
How does caffeine affect sleep?
Across 24 studies, caffeine reduced total sleep time by 45 minutes and sleep efficiency by 7%, and increased the time to fall asleep by 9 minutes [5].
Is the milligram result exact?
No. It’s a model based on an average half-life. Your own half-life could be much shorter or longer, so treat the number as a rough guide and rely on the hour-based guidance.
Sources
- U.S. FDA: Spilling the Beans: How Much Caffeine is Too Much?. August 28, 2024. Accessed October 21, 2026.
- Peer-reviewed review (open access): Common questions and misconceptions about caffeine supplementation (Antonio et al., J Int Soc Sports Nutr 2024). 2024. Accessed October 21, 2026.
- Sleep Foundation: Caffeine and Sleep. July 16, 2025. Accessed October 21, 2026.
- PubMed: Caffeine effects on sleep taken 0, 3, or 6 hours before going to bed (Drake et al., J Clin Sleep Med 2013;9(11):1195–1200). 2013. Accessed October 21, 2026.
- PubMed: The effect of caffeine on subsequent sleep: A systematic review and meta-analysis (Gardiner et al., Sleep Med Rev 2023;69:101764). 2023. Accessed October 21, 2026.
- CDC: About Sleep. May 15, 2024. Accessed October 21, 2026.
- NINDS (NIH): Brain Basics: Understanding Sleep. February 25, 2025. Accessed October 21, 2026.
Last reviewed by the CycleRest team (sources re-checked; no medical reviewer). Editorial policy