Sleep SumsAbout

Caffeine Calculator

Log today's drinks and your bedtime. You get how much caffeine is still in your system when you lie down, whether that is low enough to sleep, and the latest time for one more cup.

5 h is average. Smokers ~3 h; oral contraceptives, pregnancy, some antidepressants push it to 8-10 h.

Today's caffeine

Total today

255 mg

of 400 mg guideline

Still in you at 11:00 PM

45 mg

low enough to sleep

Last coffee by

2:21 AM

for one more 95 mg cup

Half-life used

5 h

19 mg of 100 left after 12 h

Residual = dose × 0.5^(hours ÷ half-life), summed over drinks. The ~50 mg threshold is a planning number, not a clinical one; sensitive people notice less.

Caffeine remaining, by hours since the drink

At a 5-hour half-life. The ~50 mg line is a reasonable planning threshold for falling asleep normally.

Hours later63 mgespresso95 mgcoffee160 mgenergy 16 oz200 mgcold brew
063 mg95 mg160 mg200 mg
155 mg83 mg139 mg174 mg
248 mg72 mg121 mg152 mg
342 mg63 mg106 mg132 mg
436 mg55 mg92 mg115 mg
532 mg48 mg80 mg100 mg
627 mg41 mg70 mg87 mg
821 mg31 mg53 mg66 mg
1016 mg24 mg40 mg50 mg
1212 mg18 mg30 mg38 mg

Caffeine content of common drinks

DrinkServingCaffeineHours to fall under 50 mg
Brewed coffee8 oz95 mg4.6
Espresso1 shot (1 oz)63 mg1.7
Latte / cappuccino12 oz, 2 shots126 mg6.7
Cold brew16 oz200 mg10.0
Instant coffee8 oz62 mg1.6
Decaf coffee8 oz3 mg
Black tea8 oz47 mg
Green tea8 oz28 mg
Matcha1 tsp / 8 oz70 mg2.4
Cola12 oz can34 mg
Energy drink8.4 oz can80 mg3.4
Energy drink, large16 oz can160 mg8.4
Pre-workout1 scoop200 mg10.0
Dark chocolate1 oz23 mg

Typical values from USDA and manufacturer data; a coffee-shop brew can be double the figure shown depending on bean and size.

The arithmetic

  • Remaining = dose × 0.5^(hours ÷ half-life). 95 mg after 8 hours at a 5-hour half-life: 95 × 0.5^1.6 = 31 mg.
  • Hours to a target = half-life × log₂(dose ÷ target). 200 mg to 50 mg: 5 × log₂(4) = 10 hours.
  • Multiple drinks add. The calculator sums each drink's residual at your bedtime, then finds the latest time one more cup would still leave you under the threshold.
  • Half-life is the whole game. The same afternoon coffee leaves a slow metaboliser (8 h) with 44 mg at bedtime and a fast one (3 h) with 12.

Frequently Asked Questions

How long does caffeine stay in your system?

The half-life is about 5 hours in a healthy adult, so half of a coffee's caffeine is still circulating 5 hours later and a quarter after 10. A 200 mg cold brew at 2 p.m. is still 57 mg at 11 p.m. It takes about 15 hours to get below 25 mg.

When should I stop drinking coffee to sleep?

Drake et al. (2013) gave 400 mg zero, three and six hours before bed: even the six-hour dose cut objectively measured sleep by more than an hour, and the subjects did not notice. For a normal 95 mg cup the usual guidance is 8 to 10 hours before bed; for an energy drink or cold brew, longer. The calculator works it out for your drinks and your bedtime.

How much caffeine is safe per day?

Up to 400 mg a day for healthy adults, per the FDA -- about four 8-oz brewed coffees. Pregnant people are advised to stay under 200 mg (ACOG). Adolescents should keep to about 100 mg. Above 400 mg most people get jitters, a faster heart rate and worse sleep; 1,200 mg in a short period is where seizures and dangerous effects start.

Why does coffee affect me more than my friend?

Genetics, mostly. A CYP1A2 variant splits people into fast and slow metabolisers, and the half-life ranges from about 1.5 to 9.5 hours across adults. Smoking speeds clearance up (half-life ~3 h); oral contraceptives, pregnancy, fluvoxamine and some other drugs slow it down to 8 to 10 hours. The half-life slider covers the range.

Does decaf have caffeine?

A little: 2 to 7 mg per cup versus about 95 in regular. A decaf after dinner is fine for almost everyone.

These calculators use published sleep-science guidelines and are for general guidance. They are estimates, not medical advice: persistent insomnia, loud snoring or gasping in sleep, or daytime sleepiness that affects driving are reasons to see a doctor, not to adjust a bedtime.

More Calculators