Caffeine cutoff calculator

Free caffeine calculator: estimate how much caffeine is left at bedtime from your drinks and half-life, and the latest time for your last cup.

Caffeine you've had or plan to have today

Caffeine left at bedtime (10:30 PM)

12 mg

Want another 8 oz brewed coffee? Have it by 10:33 AM to stay under 30 mg at bedtime.

With no other caffeine today, the cutoff for that drink would be 2:11 PM.

Caffeine in your body over the day, in mgAbout 12 mg left at bedtime against a 30 mg limit.038751131509 AM12 PM3 PM6 PM9 PM12 AM30 mg limitBed
Estimated caffeine in your body (mg). Dashed line: your bedtime limit. Dotted line: bedtime.

Caffeine's half-life is 3 to 7 hours in adults, so roughly half of a morning coffee is still in your blood 5 hours later.3 A 2023 meta-analysis found a standard coffee (107 mg) should be finished at least 8.8 hours before bed to avoid losing sleep.1 This caffeine calculator runs the same decay math on your own day.

How the caffeine calculator works

Each drink decays on its own curve: the amount left equals the dose × 0.5hours ÷ half-life. The calculator adds up what remains of every drink at your bedtime. A 95 mg coffee at 7:30 AM with a 10:30 PM bedtime is 15 hours, or 3 half-lives, so about 12 mg is left.

For the "one more drink" answer it subtracts what you already carry at bedtime from your limit, then works out how many hours that extra drink needs to decay into the room left. Times are counted in real elapsed hours, so a bedtime after midnight and the nights the clocks change are handled correctly.

Caffeine half-life: why the presets differ

A 2017 review puts caffeine's half-life at 3 to 7 hours in adults.3 The 5-hour default sits in the middle of that range. The other presets come from studies that measured specific groups:

  • Smokers, 3.5 h. In a study of 13 smokers and 13 non-smokers, the average half-life was 3.5 hours in smokers and 6.0 hours in non-smokers.4
  • Combined pill, 8 h. Women on low-dose estrogen pills for over 3 months averaged 7.9 hours, against 5.4 hours in 9 matched controls.5
  • Late pregnancy, 10.5 h. Half-life rose from about 3 hours in non-pregnant women to 10.5 hours in the last 4 weeks of pregnancy.7 Across 57 pregnant women it ranged from 3 to 16 hours.6

If you are pregnant, the question is total daily intake as much as timing, so check with your midwife or doctor.

When to stop drinking caffeine: what the studies say

The Gardiner meta-analysis pooled 24 studies. Caffeine cut total sleep by 45 minutes and sleep efficiency by 7%, and added 9 minutes to the time it took to fall asleep. To avoid losing sleep, it put the cutoff at 8.8 hours before bed for a cup of coffee (107 mg) and 13.2 hours for a larger 217.5 mg dose.1

An earlier home study gave 12 adults 400 mg at bedtime, 3 hours before or 6 hours before. All three disrupted sleep compared with placebo. Even at 6 hours, sleep was cut by more than an hour.2

No study sets a safe amount left at bedtime, so the 30 mg default is our own derived number, not a figure from the papers. It is roughly what remains when you follow Gardiner's cutoffs at a 5-hour half-life: about 32 mg for the coffee and 35 mg for the larger dose. Raise or lower it to match how you sleep. If you want a wider margin, move your bedtime earlier and get morning sunlight rather than a second coffee.

What this calculator assumes

  • Instant absorption. Caffeine is fully absorbed from the gut in under an hour, and blood levels peak around 2 hours after a drink.3 The chart jumps at the time of each drink, which slightly overstates early levels and understates late ones.
  • One fixed half-life. Your real rate also changes with liver disease and heavy drinking, both of which slow clearance.3
  • Typical drink values. Coffee, tea and espresso use USDA averages, and Coca-Cola and Diet Coke use the maker's figures.89 The FDA lists 113 to 247 mg for a 12 oz brewed coffee, so use the custom amount if you know your drink.10
  • Same level, same effect. It isn't. Common variants of the adenosine A2A receptor gene can make caffeine more disruptive to some people's sleep.3

Pair this with the sleep calculator to pick the bedtime, or read the caffeine half-life guide for more on the research. If your sleep is off for other reasons too, start with how to fix your sleep schedule.

Sources

  1. Gardiner C, Weakley J, Burke LM, et al. The effect of caffeine on subsequent sleep: a systematic review and meta-analysis. Sleep Med Rev. 2023;69:101764. doi:10.1016/j.smrv.2023.101764
  2. Drake C, Roehrs T, Shambroom J, Roth T. Caffeine effects on sleep taken 0, 3, or 6 hours before going to bed. J Clin Sleep Med. 2013;9(11):1195–1200. doi:10.5664/jcsm.3170
  3. Temple JL, Bernard C, Lipshultz SE, et al. The safety of ingested caffeine: a comprehensive review. Front Psychiatry. 2017;8:80. doi:10.3389/fpsyt.2017.00080
  4. Parsons WD, Neims AH. Effect of smoking on caffeine clearance. Clin Pharmacol Ther. 1978;24(1):40–45. doi:10.1002/cpt197824140
  5. Abernethy DR, Todd EL. Impairment of caffeine clearance by chronic use of low-dose oestrogen-containing oral contraceptives. Eur J Clin Pharmacol. 1985;28(4):425–428. doi:10.1007/BF00544361
  6. Knutti R, Rothweiler H, Schlatter C. Effect of pregnancy on the pharmacokinetics of caffeine. Eur J Clin Pharmacol. 1981;21(2):121–126. doi:10.1007/BF00637512
  7. Knutti R, Rothweiler H, Schlatter C. The effect of pregnancy on the pharmacokinetics of caffeine. Arch Toxicol Suppl. 1982;5:187–192. doi:10.1007/978-3-642-68511-8_33
  8. USDA FoodData Central, SR Legacy: brewed coffee (FDC 171890), espresso (171891), black tea (173227), green tea (171917). fdc.nal.usda.gov
  9. The Coca-Cola Company. Ingredients FAQs. coca-colacompany.com
  10. US Food and Drug Administration. Spilling the beans: how much caffeine is too much? fda.gov

General information, not medical advice. If you are pregnant, take medication or have heart or liver disease, ask a doctor how much caffeine suits you.

Related gear and guides

Questions people ask

What is the half-life of caffeine?

Between 3 and 7 hours in adults, according to a 2017 review, so 5 hours is a fair middle guess. Smoking shortens it (3.5 vs 6 hours in one study). The combined pill and pregnancy lengthen it, to an average of 10.5 hours in the last 4 weeks of pregnancy in one study.

When should I stop drinking caffeine before bed?

A 2023 meta-analysis of 24 studies concluded that a cup of coffee (about 107 mg) should be finished at least 8.8 hours before bed to avoid losing sleep. For a 10 PM bedtime that means your last coffee by about 1:12 PM. A larger 217.5 mg dose needs at least 13.2 hours.

How long does caffeine stay in your system?

At a 5-hour half-life, an 8 oz coffee (95 mg) at 8 AM still leaves about 24 mg at 6 PM and about 12 mg at 11 PM. It takes around 5 half-lives, roughly a day, to clear almost all of it.

Is caffeine 6 hours before bed too late?

For a big dose, yes. In a small home study (12 adults), 400 mg taken 6 hours before bed still reduced sleep by more than an hour compared with placebo, as measured by a sleep monitor.

How much caffeine is in a cup of coffee?

USDA data put an 8 oz cup of brewed coffee at about 95 mg and a 1 oz espresso shot at about 63 mg. The FDA gives 113 to 247 mg for a 12 oz cup, so coffee-shop drinks vary a lot.

More free tools