Caffeine in one paragraph
Caffeine keeps you awake by blocking adenosine, the chemical that builds sleep pressure through the day — it does not remove the pressure, it hides it. And it leaves the body slowly: with a half-life of about 5 hours, half of every dose is still there five hours later, a quarter after ten hours, and an eighth after fifteen. A morning coffee is therefore still partly present at bedtime, and an afternoon coffee is mostly present.
The numbers make the point concrete. A 200 mg coffee at 09:00 leaves about 29 mg in your body at 23:00 — 14% of the dose, the equivalent of a third of a cup still circulating when you try to sleep. The same 200 mg at 16:00 leaves about 76 mg at 23:00, which is 38% of the dose and more than half a cup. The difference between the two cups is not the size of the dose but the hours between the dose and bedtime, and that is what the calculator is for.
The rest of this guide works through the decay formula, the hour-by-hour table for a morning coffee, the latest-intake cutoff for a 50 mg bedtime level, and how a faster or slower half-life moves every answer.
The tool at a glance
The Caffeine Calculator asks four things: the caffeine dose in milligrams, the time you drank it, your bedtime, and your half-life (4, 5 or 6 hours, defaulting to 5). It answers with the caffeine left at bedtime, the share of the dose that represents, the latest intake time that leaves no more than 50 mg at bedtime, and the hours between intake and bedtime.
The dose field carries the only judgement call. Brewed coffee is about 95 mg per cup and espresso about 63 mg per shot, so a 200 mg entry is roughly two cups of brewed coffee or a large café drink. Energy drinks and pre-workout powders vary far more — check the label, because a 300 mg energy drink is half as much again as the default dose and moves the cutoff hours earlier.
The half-life field is where the calculator admits its own uncertainty. Five hours is the population average; the engine lets you set 4 or 6 hours, and the spread between them is large enough to matter — the same morning coffee leaves about 18 mg at bedtime on a 4-hour half-life and about 40 mg on a 6-hour one. If you do not know yours, run the default and treat the cutoff as approximate.
The decay: halving every five hours
Caffeine clearance follows exponential decay: every half-life, the amount halves. After one half-life 50% remains, after two 25%, after three 12.5% — the curve flattens, so the last milligrams linger longest. The formula is one line, and every number in this guide comes from it:
Caffeine left = dose × 0.5 ^ (hours since intake ÷ half-life)
Worked for the headline case: 200 mg at 09:00, bedtime 23:00, half-life 5 hours. Fourteen hours pass, which is 14 ÷ 5 = 2.8 half-lives, so the remainder is 200 × 0.5^2.8 = 200 × 0.1436 ≈ 29 mg — the engine reports 28.72 mg, about 14% of the dose. The same arithmetic for a 16:00 coffee: seven hours is 1.4 half-lives, so 200 × 0.5^1.4 = 200 × 0.3789 ≈ 76 mg, which the engine reports as 75.79 mg, about 38% of the dose.
Double the dose and the remainder doubles, because the decay is proportional: a 400 mg coffee at 09:00 leaves about 57 mg at 23:00 (the engine: 57.43 mg), still 14% of the dose. Halving the dose halves the remainder but does not change the percentage. What changes the percentage is only time and half-life — which is why the cutoff question is a question about the clock, not about the cup.
Hour by hour: a 200 mg coffee at 09:00
The decay table is the engine hour-by-hour run for the 200 mg, 09:00, 5-hour case. Two rows deserve attention: 14:00, where exactly 100 mg remains — one half-life, five hours in — and 19:00, where the remainder crosses 50 mg, the threshold the calculator uses for its cutoff.
| Time | Caffeine left (mg) | Share of dose |
|---|---|---|
| 09:00 | 200 | 100% |
| 10:00 | 174.1 | 87% |
| 11:00 | 151.6 | 76% |
| 12:00 | 132 | 66% |
| 13:00 | 114.9 | 57% |
| 14:00 | 100 | 50% |
| 15:00 | 87.1 | 44% |
| 16:00 | 75.8 | 38% |
| 17:00 | 66 | 33% |
| 18:00 | 57.4 | 29% |
| 19:00 | 50 | 25% |
| 20:00 | 43.5 | 22% |
| 21:00 | 37.9 | 19% |
| 22:00 | 33 | 17% |
| 23:00 | 28.7 | 14% |
Notice how slowly the tail falls. The first five hours remove 100 mg; the next five remove 50 mg; the last four remove only about 21 mg. That flattening is why a late coffee is so costly: the body clears the first half quickly and the second half slowly, so the milligrams you drink at 16:00 are mostly still there at 23:00, while the milligrams from 09:00 have had three half-lives to clear.
The table also shows why "I only had one coffee" is a weak defence. One 200 mg coffee at 09:00 is 28.7 mg at bedtime; one at 16:00 is 75.8 mg — nearly three times as much, from the same cup, seven hours later. The dose is identical; the clock is the whole difference.
The cutoff: the latest cup for 50 mg at bedtime
The calculator other headline answer is the latest intake that leaves no more than 50 mg at bedtime — about half a cup, the threshold it uses throughout. For the 200 mg, 09:00, 23:00-bedtime case the answer is 13:00, ten hours before bed: drink at 13:00 and 50 mg is exactly what remains at 23:00; drink later and more remains.
| Dose and half-life | Latest intake for ≤ 50 mg at 23:00 | Caffeine left at 23:00 from 09:00 |
|---|---|---|
| 200 mg, 4-hour half-life | 15:00 | 17.7 mg |
| 200 mg, 5-hour half-life | 13:00 | 28.7 mg |
| 200 mg, 6-hour half-life | 11:00 | 39.7 mg |
| 400 mg, 5-hour half-life | 08:00 | 57.4 mg |
| 95 mg (one cup), 5-hour half-life | 18:22 | 13.6 mg |
Two patterns to notice. First, the half-life moves the cutoff by two hours in each direction: a fast clearer (4 hours) can drink until 15:00, a slow clearer (6 hours) must stop at 11:00 — a four-hour spread from a factor most people never think about. Second, doubling the dose to 400 mg moves the cutoff from 13:00 all the way back to 08:00, because one extra half-life of clearance is needed to bring the larger dose down to the same 50 mg.
The single-cup row is the most forgiving: one 95 mg cup at 09:00 leaves only about 14 mg at bedtime, and the cutoff for a single cup is 18:22. That is the arithmetic behind the common advice that one morning coffee is harmless and the afternoon one is the problem — the morning cup has had 14 hours and nearly three half-lives to clear, and the afternoon cup has had one.
What the number does not know
The half-life is the big unknown, and it is personal. The calculator default of 5 hours is a population average; real half-lives run roughly 4 to 6 hours between healthy adults, and pregnancy, liver conditions and some medicines slow clearance further. If you are a slow clearer and you use the default, every cutoff the tool gives you is about two hours too late — which is why the tool lets you set 6 hours and see the stricter answer.
The model also assumes a single dose at a single time. Real days stack doses: a 200 mg coffee at 09:00 plus another at 14:00 is not one 200 mg decay curve but two, and the bedtime remainder is the sum of both — about 29 mg from the morning cup plus about 57 mg from the 14:00 cup, roughly 86 mg in total. The calculator answers one dose at a time; for a two-coffee day, run each dose separately and add the remainders.
- Caffeine blocks adenosine but does not remove sleep pressure, so a late coffee can leave you tired and wired at once — awake, but not rested.
- Tolerance dulls the feeling of caffeine without speeding its clearance: feeling fine at 23:00 does not mean the milligrams are gone, and sleep quality can suffer without you noticing the cause.
- Decaf still carries a few milligrams per cup, and tea, chocolate and some painkillers add more — small amounts, but they count toward the same 50 mg threshold.
- A 200 mg coffee at 09:00 leaves about 29 mg at a 23:00 bedtime; the same coffee at 16:00 leaves about 76 mg. Move the cup, not the dose, if the evenings are the problem.
Finally, this is an estimate, not medical advice. If sleep is persistently difficult despite a sensible cutoff, the cause is unlikely to be the arithmetic — sleep timing, covered in How Sleep Cycles Work, light exposure, and medical causes matter more, and the calculator is a planning aid for healthy adults, not a diagnostic tool.
Running your own numbers
Start with the Caffeine Calculator: enter your usual dose — 200 mg for two cups of brewed coffee, 95 mg for one — your usual time, and your bedtime, and read the latest-intake time first. If your normal cup falls after the cutoff, move the cup earlier rather than shrinking it: the arithmetic says the clock matters more than the milligrams.
Then check the other side of the night with the Sleep Cycle Calculator — How Sleep Cycles Work explains the 90-minute cycles — and your daytime energy with the Calorie Calculator. A morning coffee that clears to about 29 mg by bedtime and a 23:15 bedtime for a 07:00 wake-up is a coherent evening: the caffeine is mostly gone, and the wake-up lands on a cycle boundary.
Formula: caffeine left = dose × 0.5 ^ (hours ÷ half-life); default half-life 5 hours (range 4–6); threshold 50 mg at bedtime. Brewed coffee ≈ 95 mg per cup, espresso ≈ 63 mg per shot. figures from BeadCalc's caffeine engine, verified December 2, 2026. For education only, not medical advice.
Frequently asked questions
How much caffeine is in a cup of coffee?
About 95 mg in a brewed cup and about 63 mg in a single espresso shot, which is why the calculator defaults to a 200 mg dose — roughly two cups of brewed coffee, or a large café drink. The exact figure varies with bean, brew and serving size, so check the label where one exists and use 95 mg per cup as the planning figure where it does not.
Is 50 mg at bedtime really the cutoff?
It is the calculator threshold, not a medical limit: 50 mg is about half a cup of coffee, and the engine reports the latest intake that leaves no more than that in your body at bedtime. Some people sleep fine with more, and sensitive sleepers feel less — if you know you are sensitive, treat the cutoff as an upper bound and move it an hour earlier. The threshold exists to make the latest-intake time computable, not to declare 50 mg safe for everyone.
Does caffeine really take 5 hours to halve?
Five hours is the average half-life the calculator uses by default, and you can set 4 or 6 hours to match your own clearance. Real half-lives vary widely: pregnancy, liver conditions and some medicines slow clearance further, while smoking speeds it. The same 200 mg coffee at 09:00 leaves about 18 mg at 23:00 with a 4-hour half-life and about 40 mg with a 6-hour half-life — the range is the point, and the calculator shows both.
Run the numbers yourself
How much caffeine is still in your body at bedtime, and the latest cup that leaves no more than 50 mg.
This guide is educational. Its figures are worked examples computed with the site's own calculators from the rules and tables they cite; they are not financial or tax advice for your situation. Confirm the final figure with your lender, tax authority or a qualified professional before making decisions.