Caffeine calculator
Caffeine leaves your body slowly. For most people, a coffee at 4 in the afternoon is still about half a coffee at 9 in the evening. Add your drinks below, then try moving one earlier or later and see what it does to your night.
What's still in you at bedtime?
The amounts are typical figures for each drink. If your can, cup or tub says something different, tap the drink and change it.
Set your bedtime, add what you drink and when, and see how much caffeine your body is still carrying when you go to bed.
Clock
Add a drink
Not on the shelf?
The caffeine in your body, hour by hour
Caffeine in youIf your body clears it faster or slower
Clear of your sleepCutting it closeMay cost you sleep
The colors are about what's still in you when you go to bed: green up to about 30 mg, yellow up to about 60, red above that. Each drink is colored by what it leaves on its own, the verdict below by all of them together.
Why those numbers: in a review of 24 sleep studies, a coffee within about 9 hours of bed or a pre-workout scoop within about 13 shortened sleep on average, and both leave a little over 30 mg by bedtime. Up to 60, the studies disagree; 400 mg twelve hours before bed, about 75 left, delayed sleep.
Bodies clear caffeine at different speeds. For most adults, half of it is gone in 4 to 6 hours, but some clear it in under 3 and others take up to 10.
Smoking speeds it up, hormonal birth control and pregnancy slow it down, and genes play a big part, so there's no easy way to know your own speed. The big number assumes half is gone every 5 hours; the range uses 3 and 8.
Today, in total
What your result means
The color is our reading of the sleep studies. Green is an amount of caffeine at bedtime where they found no measurable cost to sleep, red is an amount where they have measured one, and yellow is in between, where the studies disagree.
If you fall asleep fine after a late coffee or energy drink, a red result can look like a false alarm. It might not be. Across 24 studies, caffeine took about 45 minutes off the night on average, more the bigger the dose and the closer to bedtime. And in a 2025 trial of 23 young men, 400 mg taken a full 12 hours before bed still cut into their deep sleep, while they rated the quality of their sleep as no worse than usual.
The color is still an estimate for a typical body, and nobody has settled whether having caffeine every day softens its effect on sleep. So test it for yourself. If your night comes up yellow or red, have the drink the result names earlier in the day, or make it smaller, and judge the change by your mornings. And if that drink is for an evening workout or a late night with friends, keeping it can be the right call. That’s your trade to make, and now you can make it knowing the number.
How long does caffeine stay in your system?
For a typical adult, about a day, though most of it is gone much sooner, because caffeine leaves by halves. Half of what’s in a drink is usually gone 4 to 6 hours after you drink it (that’s its “half-life”), half of what’s left goes in the next 4 to 6, and so on.
The calculator counts each drink in full from the moment you drink it, takes half away every 5 hours and adds your drinks together. So a big energy can (160 mg) at 2 in the afternoon is still a small one (80 mg) at 7 in the evening, and at midnight you’re still carrying 40 mg. Feeling a drink wear off doesn’t mean it’s gone: there’s more on that in why energy drinks make you tired.
When should your last caffeine of the day be?
Eight hours before bed is a fair place to start, and it’s the cutoff we use in how to fix your sleep schedule. The size of the drink moves it, though. A mug of tea can go a lot later than that, while in a review of 24 sleep studies a mug of coffee had to be about 9 hours before bed to avoid shortening the night, and a scoop of pre‑workout more than 13. Tap one of your drinks under the chart and the line it sits on turns green where that drink would be clear of your sleep.
How much caffeine is too much?
For most healthy adults, the guidance comes in two parts: up to about 200 mg at one time and up to about 400 mg across a day (200 mg a day in pregnancy). That 400 mg, about four mugs of filter coffee or two and a half big energy cans, is the line on the bar under your day’s total. People differ a lot in how strongly they react to caffeine, so read it as a ceiling, not a target.
This page is general information from coaches, not medical advice. If you have a medical condition or an injury, or take medication, talk to your doctor before you change your training or diet.
Sources
Gardiner C, Weakley J, Burke LM, Roach GD, Sargent C, Maniar N, et al. The effect of caffeine on subsequent sleep: a systematic review and meta-analysis. Sleep Medicine Reviews, 2023;69:101764. DOI.
Gardiner CL, Weakley J, Burke LM, Fernandez F, Johnston RD, Leota J, et al. Dose and timing effects of caffeine on subsequent sleep: a randomized clinical crossover trial. Sleep, 2025;48(4):zsae230. DOI.
Guest NS, VanDusseldorp TA, Nelson MT, Grgic J, Schoenfeld BJ, Jenkins NDM, et al. International Society of Sports Nutrition position stand: caffeine and exercise performance. Journal of the International Society of Sports Nutrition, 2021;18(1):1. DOI.
EFSA Panel on Dietetic Products, Nutrition and Allergies. Scientific opinion on the safety of caffeine. EFSA Journal, 2015;13(5):4102. DOI.
Blanchard J, Sawers SJ. The absolute bioavailability of caffeine in man. European Journal of Clinical Pharmacology, 1983;24(1):93-98. DOI.
Desbrow B, Hall S, O’Connor H, Slater G, Barnes K, Grant G. Caffeine content of pre-workout supplements commonly used by Australian consumers. Drug Testing and Analysis, 2019;11(3):523-529. DOI.
US Food and Drug Administration. Spilling the beans: how much caffeine is too much? Consumer update. fda.gov.
US Department of Agriculture, FoodData Central (SR Legacy): brewed coffee, espresso, instant coffee, black tea and cola. fdc.nal.usda.gov.
National Heart, Lung, and Blood Institute. Circadian rhythm disorders: treatment. nhlbi.nih.gov.