Free Online Caffeine Calculator
A free caffeine calculator that shows how much caffeine will still be in your system at bedtime, when it drops below your limit, and the latest time for one more cup.
Free · No sign-up · Runs in your browser · Nothing to install · Today’s drinks saved on your device
This is a free online caffeine calculator — no sign-up, nothing to install, all of it running in your browser — where you add each drink you have had today and when, set your bedtime, and see how much caffeine will still be in your system when you go to sleep, when it drops below your bedtime limit, and the latest time you could have one more, with today’s drinks kept in that browser. It assumes a five-hour half-life, typical for a healthy adult, and a 30 mg bedtime limit drawn from a 2023 review of caffeine and sleep; you can change both. The drink list runs from decaf to pre-workout powder, with typical amounts from USDA data and the other sources under the table below, and Custom amount accepts the number on any label.
How to use
- 1
Add your drinks. Choose a drink from the list, or Custom amount to type the milligrams from a label, set the time you had it, and press Add. Repeat for each drink today.
- 2
Set your bedtime. Enter the time you plan to go to sleep. The default is 11 p.m.
- 3
Adjust the assumptions if you need to. Open Adjust assumptions to change the half-life from 5 hours or the bedtime limit from 30 mg.
- 4
Read the results. See the caffeine left at bedtime, when it drops below your limit, the latest time for one more drink of your choice, and today’s total against 400 mg.
How long caffeine stays in your system
Caffeine’s half-life is the time your body takes to clear half of it. For a typical healthy adult that is about five hours, the figure the CDC Yellow Book uses; the European Food Safety Authority puts the average nearer four, with a range of two to eight. The halving compounds: about half of a drink is still in your system five hours after you have it, a quarter after ten hours, and an eighth after fifteen. That is why a 95 mg cup of coffee at 2 p.m. still leaves about 28 mg at 11 p.m., while the same cup at 8 a.m. is down to about 12 mg by then.
Your own half-life can sit well away from five hours. Smoking speeds clearance: in one study, smokers averaged 3.5 hours against 6 for non-smokers. Estrogen-containing birth control pills slow it: the half-life went from about 5.4 to 7.9 hours in another. Pregnancy slows it more as the months pass, most of all in the third trimester, when the half-life can reach about 15 hours. Liver disease can stretch it much further, and some medicines slow it too. Genes play a part as well, because CYP1A2, the liver enzyme that clears about 95 percent of caffeine, works faster in some people than in others. The half-life setting runs from 1.5 to 15 hours to cover most of this; if you are pregnant, have a liver condition or take a regular medicine, a clinician or pharmacist can tell you more than an estimate can.
What caffeine does to sleep
Caffeine keeps you alert by blocking adenosine, the signal that builds sleep pressure through the day, and it goes on blocking it for as long as enough is circulating. A 2023 meta-analysis of 24 studies by Gardiner and colleagues in Sleep Medicine Reviews found that caffeine cut total sleep time by 45 minutes on average, lowered sleep efficiency by 7 percent, added 9 minutes to the time it took to fall asleep and 12 minutes of waking in the night, and trimmed about 11 minutes of deep sleep. To avoid losing sleep, the authors concluded, a 107 mg coffee should come at least 8.8 hours before bed, and a 217.5 mg pre-workout drink at least 13.2 hours before.
Studies of timing point the same way. In a 2013 study by Drake and colleagues, 400 mg of caffeine taken six hours before bed still disrupted sleep, and the American Academy of Sleep Medicine reported that it cut measured sleep by more than an hour. EFSA notes that a single 100 mg dose can affect sleep in some adults when it is taken close to bedtime. Falling asleep easily does not mean caffeine had no effect, either: in these studies most of the cost was in how long and how deeply people slept, not in how long they took to drop off.
Caffeine in common drinks
Caffeine per serving varies widely. The bean, the brew, the cup and the café all change it, so the figures below are typical amounts from USDA FoodData Central and the other sources listed, not a measurement of your cup. The widest spreads are in drinks sold by the can or the scoop: the FDA puts energy drinks anywhere from 54 to 328 mg per 16 fl oz, and among 100 top-selling pre-workout powders, the ones with caffeine averaged 254 mg per serving, give or take about 80. When a label gives a number, use Custom amount.
Decaf still has a little: the FDA gives 2 to 15 mg for an 8 fl oz cup, and the table uses USDA’s figure of 2. Chocolate counts too, though not for much; 30 g of 70 to 85 percent dark chocolate has about 24 mg. Cold brew strength differs so much between cafés that the table uses one large chain’s published figure for its standard 16 fl oz cup.
| Drink | Serving | Caffeine |
|---|---|---|
| Brewed coffee | 240 ml (8 fl oz) | 95 mg |
| Espresso, single shot | 30 ml (1 fl oz) | 63 mg |
| Espresso, double shot | 60 ml (2 fl oz) | 126 mg |
| Latte or cappuccino | 355 ml (12 fl oz) | 130 mg |
| Cold brew coffee | 473 ml (16 fl oz) | 205 mg |
| Instant coffee | 240 ml (8 fl oz) | 62 mg |
| Decaf coffee | 240 ml (8 fl oz) | 2 mg |
| Black tea | 240 ml (8 fl oz) | 47 mg |
| Green tea | 240 ml (8 fl oz) | 28 mg |
| Matcha | 2 g powder (1 tsp) | 64 mg |
| Cola | 355 ml (12 fl oz) | 34 mg |
| Diet cola | 355 ml (12 fl oz) | 43 mg |
| Energy drink, small can | 250 ml (8.4 fl oz) | 80 mg |
| Energy drink, large can | 500 ml (16.9 fl oz) | 160 mg |
| Pre-workout powder | 1 scoop | 254 mg |
| Caffeine tablet | 1 tablet | 200 mg |
| Dark chocolate, 70–85% cocoa | 30 g (1 oz) | 24 mg |
Sources: USDA (brewed coffee); USDA (espresso); USDA (latte); Starbucks (cold brew); USDA (instant coffee); USDA (decaf); USDA (black tea); USDA (green tea); Japan MEXT food tables (matcha); USDA (cola); USDA (diet cola); EFSA (energy drinks); Jagim et al. 2019 (pre-workouts); FDA, 21 CFR 340.50 (caffeine tablets); USDA (dark chocolate).
How this calculator works
Each drink is treated as one dose that is absorbed and then cleared at steady rates, the standard one-compartment model used in pharmacology. Absorption runs at a rate of 5 per hour, which, at the default half-life, puts each drink’s peak about 45 minutes after the time you enter. From there the amount halves every half-life: 5 hours unless you change it, anywhere from 1.5 to 15. The curve is the sum of every drink on the list, and the day runs from 4 a.m. to 4 a.m., so a 12:30 a.m. bedtime counts as the end of the same day.
The bedtime limit, 30 mg unless you change it (5 to 100), is how much you are willing to have left when you go to sleep. It comes from the Gardiner review’s cutoffs: under this model, a 107 mg coffee 8.8 hours before bed leaves about 32 mg, and a 217.5 mg pre-workout 13.2 hours before leaves about 36 mg, so 30 mg is a slightly cautious reading. The time you drop below the limit is found to the minute, starting after your last drink has peaked and looking up to 48 hours ahead. The latest time for one more drink only counts times that leave it room to peak before bed, is rounded down to the nearest 5 minutes, and says so plainly when you are already over the limit or when no time today would keep you under it. Today’s total is shown against the 400 mg a day the FDA cites for healthy adults.
All of this is an estimate for healthy adults, not medical advice. Real absorption depends on food, how quickly you drink, your body and your medicines, and no calculator knows how sensitive you are to caffeine. If you are pregnant or breastfeeding, have a heart, liver or anxiety condition, or take regular medication, ask a clinician how much caffeine suits you.
Link parameters
Everything travels in the address bar, so a link can open the calculator with drinks, a bedtime and settings already filled in.
| Parameter | Values | Example |
|---|---|---|
| drinks | comma-separated drink@time items, up to 20: a drink id (coffee, espresso, double-espresso, latte, cold-brew, instant-coffee, decaf, black-tea, green-tea, matcha, cola, diet-cola, energy-drink, energy-drink-large, pre-workout, caffeine-tablet, dark-chocolate) or an amount such as 120mg, optionally with 2x in front for two servings, and a time such as 8:00, 13:30, 3pm or 0730. Common names such as tea, cappuccino or red-bull also work, and an item that cannot be read is skipped. Empty by default | /caffeine-calculator/?drinks=coffee@8:00,espresso@13:30 |
| bed | bedtime, in any of the same time formats (default 23:00) | /caffeine-calculator/?bed=22:30 |
| hl | caffeine half-life in hours, 1.5 to 15; values outside are clamped (default 5) | /caffeine-calculator/?hl=7 |
| limit | bedtime limit in mg, 5 to 100; values outside are clamped (default 30) | /caffeine-calculator/?limit=50 |
| next | the drink used for the latest time for one more, as a drink id or common name (default coffee) | /caffeine-calculator/?next=espresso |
/caffeine-calculator/?drinks=coffee@8:00,espresso@13:30 opens with a brewed coffee at 8 a.m. and a single espresso at 1:30 p.m., measured against the default 11 p.m. bedtime.
/caffeine-calculator/?drinks=2xespresso@9am,120mg@3pm&bed=22:30 opens with two single espressos at 9 a.m., 120 mg from a labeled drink at 3 p.m., and a 10:30 p.m. bedtime.
/caffeine-calculator/?drinks=tea@7:30&hl=7&limit=50&next=espresso opens with a cup of black tea at 7:30 a.m., a seven-hour half-life, a 50 mg bedtime limit, and the latest time for one more worked out for an espresso.
Frequently Asked Questions
Is there a free caffeine calculator that shows what is left at bedtime? +
Yes. This page is one: free to use, no account to create, and nothing to install, since it runs in your browser on a phone, tablet or computer. Add each drink and the time you had it, set your bedtime, and it shows about how much caffeine will still be in your system when you go to sleep, when it falls below your limit (30 mg unless you change it), and the latest time for one more cup. It assumes a five-hour half-life, which you can adjust. Today’s drinks are saved in that browser.
What is the half-life of caffeine? +
About five hours in a typical healthy adult, the figure used in the CDC Yellow Book. EFSA gives an average of about four hours, ranging from two to eight. Smoking shortens it: smokers averaged 3.5 hours against 6 for non-smokers in one study. Estrogen-containing birth control pills lengthen it, to 7.9 hours from 5.4 in another, and pregnancy lengthens it most in the third trimester, to about 15 hours. Liver disease can slow it far more: in a small study, two patients with alcoholic liver disease had half-lives of 60 and 168 hours.
How long before bed should I stop drinking coffee? +
For a regular cup, about eight and a half to nine hours. A 2023 meta-analysis of 24 studies concluded that to avoid losing sleep, a 107 mg coffee should come at least 8.8 hours before bed, and a 217.5 mg pre-workout at least 13.2 hours before. For an 11 p.m. bedtime, that puts the last coffee a little after 2 p.m. This calculator gives a similar answer with its default settings: one 95 mg cup by 2:25 p.m. keeps you under 30 mg at 11 p.m. Six hours is a bare minimum; in a 2013 study, 400 mg taken six hours before bed still cut measured sleep by more than an hour.
How much caffeine is too much in a day? +
For most healthy adults, the FDA cites 400 mg a day, about two to three 12 fl oz cups of coffee, as an amount not generally associated with negative effects. EFSA reaches the same figure and adds that single doses up to 200 mg raise no safety concerns. During pregnancy, EFSA and ACOG both use 200 mg a day as the ceiling, and for children and teenagers EFSA suggests no more than 3 mg per kilogram of body weight a day. A daily total inside these figures can still keep you awake if it comes late. If you are pregnant, breastfeeding or taking medication, ask your clinician what suits you.
Can caffeine affect my sleep even if I fall asleep easily? +
Yes. In the 2023 Gardiner meta-analysis, caffeine added only 9 minutes to the time it took to fall asleep, but it cut total sleep by 45 minutes, added 12 minutes of waking in the night, and reduced deep sleep by about 11 minutes while light sleep grew. So the effect can be real even when bedtime feels normal. EFSA notes that a single 100 mg dose close to bedtime may affect sleep in some adults.
When does caffeine peak after a cup of coffee? +
Caffeine is absorbed quickly and completely, most of it within the first hour according to a 2017 review, and EFSA notes that its effects can begin 15 to 30 minutes after you have it. Measured peaks vary with the person, the drink and whether you have eaten. The calculator places each drink’s peak about 45 minutes after the time you enter, then lets it fall at your half-life. For a large drink you sip over an hour or two, enter the time you were about halfway through it.
How does the calculator work out the caffeine in my system? +
It uses the standard one-compartment model from pharmacology. A dose D taken t hours ago contributes D × ka ÷ (ka − ke) × (e^(−ke × t) − e^(−ka × t)) mg, where ka, the absorption rate, is 5 per hour, and ke, the elimination rate, is 0.693 divided by the half-life in hours. Every drink on the list is added together. With the defaults, a 95 mg coffee peaks at about 86 mg some 45 minutes later, since a little has already been cleared by then, and is back down to 30 mg about eight and a half hours after you drink it.
Can I save or share a caffeine calculation? +
Yes. The calculator keeps today’s drinks and your settings in your browser, so they are still there when you come back the same day. Everything also travels in the link: /caffeine-calculator/?drinks=coffee@8:00,espresso@13:30&bed=22:30 opens with a coffee at 8 a.m., an espresso at 1:30 p.m. and a 10:30 p.m. bedtime. Copy link builds the address for you, and the link parameters above list every option.
Related tools
More quiet tools
Box Breathing Timer
The 4-4-4-4 technique used by Navy SEALs for calm and focus.
Focus Timer
A full-screen study timer with Pomodoro presets, ambient sound, and calm backgrounds.
Meditation Timer
A minimal timer with singing bowls, interval bells, and a mindfulness bell that rings at your chosen pace.
Stillsea is for general wellbeing and is not medical advice. Consult a healthcare professional for any health concerns.