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 later | 63 mgespresso | 95 mgcoffee | 160 mgenergy 16 oz | 200 mgcold brew |
|---|---|---|---|---|
| 0 | 63 mg | 95 mg | 160 mg | 200 mg |
| 1 | 55 mg | 83 mg | 139 mg | 174 mg |
| 2 | 48 mg | 72 mg | 121 mg | 152 mg |
| 3 | 42 mg | 63 mg | 106 mg | 132 mg |
| 4 | 36 mg | 55 mg | 92 mg | 115 mg |
| 5 | 32 mg | 48 mg | 80 mg | 100 mg |
| 6 | 27 mg | 41 mg | 70 mg | 87 mg |
| 8 | 21 mg | 31 mg | 53 mg | 66 mg |
| 10 | 16 mg | 24 mg | 40 mg | 50 mg |
| 12 | 12 mg | 18 mg | 30 mg | 38 mg |
Caffeine content of common drinks
| Drink | Serving | Caffeine | Hours to fall under 50 mg |
|---|---|---|---|
| Brewed coffee | 8 oz | 95 mg | 4.6 |
| Espresso | 1 shot (1 oz) | 63 mg | 1.7 |
| Latte / cappuccino | 12 oz, 2 shots | 126 mg | 6.7 |
| Cold brew | 16 oz | 200 mg | 10.0 |
| Instant coffee | 8 oz | 62 mg | 1.6 |
| Decaf coffee | 8 oz | 3 mg | — |
| Black tea | 8 oz | 47 mg | — |
| Green tea | 8 oz | 28 mg | — |
| Matcha | 1 tsp / 8 oz | 70 mg | 2.4 |
| Cola | 12 oz can | 34 mg | — |
| Energy drink | 8.4 oz can | 80 mg | 3.4 |
| Energy drink, large | 16 oz can | 160 mg | 8.4 |
| Pre-workout | 1 scoop | 200 mg | 10.0 |
| Dark chocolate | 1 oz | 23 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.