Caffeine calculator
How much caffeine will be left at bedtime?
Pick your drinks, when you'll have them and when you go to bed. You'll see how much caffeine is still in you at lights-out, whether it's under the 50 mg sleep line, and the latest time for your next one.
Peaks around 85 mg at 4:52 PM. Under 50 mg from 9:21 PM.
Finish it by 5:30 PM to stay under 50 mg at bedtime.
Drag along the chart to see any hour.
Let the app do this for you. It adds up every drink you log, all day, and warns you before the one that would cost you sleep.
Get the free betaActive caffeine with a one-compartment model (absorption half-life 10 min). General wellness information, not medical advice.
The short answer
- Caffeine has a half-life of about 5 to 6 hours for most adults, so about half of a 4 pm coffee is still in you at 9 to 10 pm.
- Aim for under 50 mg at bedtime, about half a cup of coffee. Sleep studies find less deep sleep above that, even in people who fall asleep fine.
- For an 11 pm bedtime, finish a regular coffee (95 mg) by 5:30 pm, a two-shot latte by 3:15 pm and a 200 mg energy drink by 11:30 am.
- Drinks add up. Coffee at 8 am, a latte at 4 pm leaves about 69 mg at 11 pm, more than the latte alone.
- On the pill or pregnant? Caffeine lasts about twice as long, so move every time 2 to 4 hours earlier.
Updated 2 October 2026 · By the Caffeine vs Water team
Common scenarios
What a typical drink leaves at bedtime
One drink each, for someone with a typical 5.5-hour half-life unless it says otherwise. Open any of them in the calculator to change the times.
4 PM · bed at 11 PM
An afternoon latte
54 mg just over the line
A two-shot latte (126 mg) at 4 pm still leaves about half a coffee in you at lights-out. Switch to a single shot and it drops to about 27 mg.
2 PM · bed at 11 PM
Is 2 pm too late for coffee?
32 mg under the line
For one regular cup (95 mg), usually not. A large one (190 mg) at the same time leaves about 63 mg, which is over.
3 PM · bed at 11 PM
A big energy drink after class
60 mg over the line
A 473 ml can has 160 mg, so even eight hours later there's more left than in a can of cola. To be under 50 mg at 11 pm, finish it by about 1:30 pm.
8 PM · bed at 11 PM
An espresso after dinner
45 mg just under the line
A single shot is small (63 mg), but three hours isn't long. It peaks around 56 mg at about 8:50 pm and is only just under the line by bedtime.
8 AM · bed at 11 PM
One big morning coffee
30 mg under the line
Even a large 190 mg mug is fine this early. Fifteen hours is almost three half-lives, so less than a sixth of it is left.
6 PM · bed at 11 PM
Pre-workout before an evening gym session
110 mg more than double the line
A 200 mg scoop five hours before bed leaves more than a cup of coffee in you. For evening workouts, a caffeine-free pre-workout is the better pick.
2 PM · on the pill
The same 2 pm coffee, on the pill
52 mg just over the line
The contraceptive pill roughly doubles how long caffeine lasts. The cup that left 32 mg above now leaves 52 mg. Bring it forward to around 1 pm.
10 AM · pregnant
A morning coffee while pregnant
48 mg just under the line
In late pregnancy caffeine can take 12 hours or more to halve, so a 10 am cup is still around at 10 pm. Most guidelines say to keep to 200 mg a day in total.
2 AM · sleep at 9 AM
A night-shift double espresso
54 mg over the line
The same rule applies to daytime sleep, which is lighter and easier to disturb. Have caffeine early in the shift and stop about eight hours before you sleep.
Cutoff times
The latest time for each drink
The last time you can finish each drink and still be under 50 mg at an 11 pm bedtime, by how fast you clear caffeine. For a different bedtime, move every time by the same amount.
| Drink | Fast (4 h) | Typical (5.5 h) | Slow (7.5 h) | On the pill (10 h) |
|---|---|---|---|---|
| Black tea · 47 mg | Any time. It never reaches 50 mg on its own. | |||
| Espresso · 63 mg | 9:15 PM | 8:45 PM | 8:00 PM | 7:15 PM |
| Matcha · 70 mg | 8:45 PM | 8:00 PM | 7:00 PM | 5:45 PM |
| Energy drink, 250 ml · 80 mg | 8:00 PM | 7:00 PM | 5:30 PM | 3:45 PM |
| Drip coffee · 95 mg | 7:00 PM | 5:30 PM | 3:45 PM | 1:15 PM |
| Latte, two shots · 126 mg | 5:15 PM | 3:15 PM | 12:30 PM | 9:15 AM |
| Cold brew · 155 mg | 4:00 PM | 1:45 PM | 10:30 AM | 6:15 AM |
| Energy drink, 473 ml · 160 mg | 4:00 PM | 1:30 PM | 10:00 AM | 5:45 AM |
| Large drip coffee · 190 mg | 3:00 PM | 12:00 PM | 8:15 AM | 3:15 AM |
| Celsius or pre-workout · 200 mg | 2:45 PM | 11:30 AM | 7:30 AM | 2:30 AM |
Rounded down to the quarter hour. One drink at a time: if you've had caffeine earlier in the day, the cutoff comes sooner. For more drinks and the studies behind the line, read when to stop drinking coffee before bed.
How it works
The maths behind the number
Up fast, down slowly
Caffeine is absorbed within about an hour, then your liver clears a fixed share of it every hour. The calculator uses the standard one-compartment model from caffeine research, the same one the app uses: an absorption half-life of 10 minutes, then the elimination half-life you pick.
Your half-life
Most adults clear half their caffeine in about 5 hours, but it ranges from about 3 to 7. Smoking speeds it up. The contraceptive pill roughly doubles it, and late pregnancy can triple it. That's why the same coffee can be fine for one person and keep another awake. Why it varies
Why 50 mg at bedtime
Caffeine blocks adenosine, the signal that builds up sleep pressure. Studies find less deep sleep after moderate doses taken hours before bed, even in people who fall asleep fine. Around 50 mg, about half a cup of coffee, is a sensible line to stay under. How caffeine affects sleep
Questions
Caffeine calculator FAQ
How long does caffeine stay in your system?
Caffeine peaks in your blood under an hour after you drink it. After that, about half of it is cleared every 5 to 6 hours for most adults, so a 95 mg coffee at 2 pm still leaves about 32 mg at 11 pm. It takes about a day to clear almost all of it, and longer if you're pregnant or on the pill.
How much caffeine at bedtime is too much?
There's no exact cutoff, but sleep studies find measurable effects on deep sleep from moderate doses taken in the afternoon and evening. The calculator uses 50 mg at bedtime, about half a cup of coffee, as a sensible line. The app lets you change it.
What is caffeine half-life?
It's how long your body takes to clear half the caffeine in it. For most healthy adults it's about 5 hours, but it ranges from about 3 to 7 hours. Smoking shortens it. The contraceptive pill roughly doubles it, and in late pregnancy it can reach 10 to 15 hours.
Does the calculator add up several drinks?
No, it shows one drink at a time. Caffeine from several drinks adds up, so two coffees leave roughly the sum of what each would leave alone. The Caffeine vs Water app adds up every drink in your day and projects the total to your bedtime.
How accurate is it?
It uses the standard one-compartment model from caffeine research, the same model as the Caffeine vs Water app. Real levels vary with your body, your genes and what you've eaten, so treat the result as a well-informed estimate. If caffeine hits you harder or softer than most people, pick a different setting under Caffeine hits you.
Does decaf have caffeine?
A little. A cup of decaf coffee has about 2 to 5 mg, compared with about 95 mg in regular drip coffee. That's far below the 50 mg line even right before bed.
Keep reading
More on caffeine and sleep
Sleep
When to stop drinking coffee before bed
A caffeine cutoff for every drink, by dose, not guesswork.
Caffeine science
How long does caffeine last?
Half-life, an hour-by-hour timeline, and what makes it last longer for you.
Sleep
Is 2 pm too late for coffee?
The caffeine left at bedtime for 2, 3 and 4 pm drinks.
Energy drinks
Energy drinks and sleep
23 cans ranked by the hours they need before bed.
Pregnancy
Caffeine and pregnancy
The 200 mg limit in real drinks, and why caffeine lasts longer when you're pregnant.
Caffeine chart
Caffeine content chart
Coffee, tea, soda and energy drinks side by side, by size.
Every drink, added up for you.
Caffeine vs Water does this for your whole day: every coffee, tea and energy drink, projected to your bedtime, with a warning before the one that would cost you sleep. For iPhone and Apple Watch. Join the beta and Apple will email you a TestFlight invite.
Free. Needs an iPhone with iOS 26 or later. We pass your email to Apple to send the TestFlight invite, and nothing else. Privacy