1001Ferramentas
Calculators

Caffeine Calculator

Calculate how long caffeine stays in your body. See the remaining amount after each half-life and when it is safe to sleep. Includes a sources table (coffee, tea, energy drinks, chocolate). Everything in your browser.

Not sure?

5h is the average in healthy adults. Pregnancy: 10–15h. Smokers: 3–4h.

How it works

Caffeine follows first-order elimination kinetics, meaning the amount in your blood halves with every half-life that passes. In healthy adults that half-life averages around 5 hours, though the spread is wide. Pregnancy stretches it to 10–15h, smokers land at 3–4h, and certain variants of the CYP1A2 gene also fall outside the average.

People who want a good night of sleep generally keep caffeine under 50 mg by bedtime. The formula behind that is remaining = initial × 0.5^(t / half-life). The whole calculation runs in your browser.

Caffeine half-life and safe dose

Caffeine follows first-order pharmacokinetics, which means the blood concentration drops by half at each half-life. For healthy adults the population average sits around 5 hours (somewhere between 3 and 7 h), but pregnancy stretches that out two or three times over (10–15 h), and smokers clear it faster (3–4 h). The decay equation is remaining = initial · 0.5^(t / half-life). Take an example: drink 200 mg at 18:00 and you're left with roughly 100 mg at 23:00, 50 mg at 04:00, and only about ~6 mg by 13:00 the next day. The safe ceiling for healthy adults is 400 mg/day (FDA, EFSA). Pregnant people should keep it under 200 mg/day given the risk of miscarriage and low birth weight, and for children the figure is around 2.5 mg/kg. Where it shows up: espresso runs ~63 mg per 30 mL, drip coffee ~95 mg per 240 mL, energy drinks 80–300 mg, cola sodas 30–40 mg, and dark chocolate 20–60 mg per 100 g.

Genetics, tolerance and sleep

In the brain, caffeine blocks adenosine receptors, and that holds back the signal that builds sleep pressure. About 95% of caffeine metabolism runs through the liver enzyme CYP1A2, and a single-nucleotide polymorphism sorts people into two camps. Fast metabolizers (AA homozygotes) see less of a hit to their sleep from coffee, while slow metabolizers (AC/CC) carry higher cardiovascular risk when they drink a lot. Use caffeine every day and the brain up-regulates those adenosine receptors, so you build tolerance to the alertness boost, though not entirely to the sleep disruption. A couple of practical pointers: for an ergogenic effect, take 3–6 mg/kg about 30–45 minutes before training, and stop all caffeine at least 6 hours before bedtime. Research found that even 400 mg taken 6 h before bed cuts total sleep by roughly an hour.

FAQ

Why do I sleep fine after coffee? You might be a fast CYP1A2 metabolizer, or you've built up tolerance in your adenosine receptors. Even so, objective measures like deep sleep and HRV often still look worse, even when the sleep feels normal to you.

Does decaf have caffeine? It does. A cup usually carries 2–15 mg. That's small, but it isn't zero.

How long do withdrawal symptoms last? The headache, fatigue and irritability tend to peak 24–48 h after you stop and clear up within 7–9 days. Tapering off slowly keeps them from showing up at all.

Is caffeine dangerous? Acute toxicity is rare and generally takes more than 10 g, roughly 100 cups of coffee. With moderate intake the downsides are mostly anxiety, palpitations, GERD and disrupted sleep, and all of those are reversible.

How long caffeine stays in your body

That late-afternoon coffee might be exactly why you keep tossing and turning. Caffeine has a half-life of a few hours, so half the dose is still circulating long after your last sip. This calculator draws out that curve and helps you plan your intake with a bit more sense.

Type in the dose in mg, the half-life that applies to you and the limit you consider safe at bedtime. The tool counts in hours from now rather than clock time: it shows what is left after one and after two half-lives, and how many hours until the dose drops below your limit. There's also a table of caffeine in everyday sources, like coffee, tea, energy drinks and chocolate, so you can ballpark how much you've already had.

Whatever you enter stays put, since the math runs right in your browser and nothing is stored. Handy for people who are sensitive to caffeine but still want the lift without wrecking their sleep.

Frequently asked questions

Where do I enter the time I drank the coffee?
There is no such field. Everything the calculator returns is counted in hours from the moment you drank it, and adding that to the clock is left to you: if safe to sleep reads 10h and the coffee was at 4pm, your clear time is 2am. With the default half-life of 5 hours, 200 mg falls to 100 mg after 5h and to 50 mg after 10h. The formula is half-life × log2(dose ÷ limit), the same as halving repeatedly until you hit the limit.
I clicked two items in the sources table and the values did not add up.
Each button replaces the field, it never adds to it. The table is there for anyone unsure how many milligrams they drank: a 30 ml espresso counts 64 mg, a 240 ml drip coffee 95 mg, a 250 ml energy drink 80 mg and 40 g of dark chocolate 24 mg. For two drip coffees, click once and edit the field to 190. Treat the figures as table averages, since brand, roast and brewing time move the real number a long way.
Why does changing the half-life shift the result so much?
Because it is the only thing driving the clock. The 5 hours filled in by default is the healthy-adult average, and the field accepts 1 to 20 hours precisely because the spread between people is wide: pregnancy pushes it to 10-15 hours, smoking brings it down to 3-4, and oral contraceptives roughly double it. Swapping 5 for 10 instantly doubles every figure on screen, including near-complete clearance, which is always five half-lives, the point where about 3% of the dose is left.

Related Tools

The results provided by this tool are for general informational and educational purposes only and do not constitute professional, financial, medical, legal, tax or accounting advice. Always confirm important decisions with a qualified professional and official sources.