Caffeine Calculator

Calculate how much caffeine is still in your body after its half-life and when to have your last cup, right in the browser.

How useful is this tool?

The result will appear here …

Caffeine Calculator: What remains when you go to bed?

The Caffeine Calculator estimates how much caffeine remains after a coffee. Enter the starting dose in milligrams and elapsed hours, optionally adding hours until bedtime. Use the result to understand your afternoon drink, not as a sleep guarantee.

How it works

The model uses exponential decay: remaining amount = starting amount × 0.5 raised to (elapsed hours / half-life). Leaving the half-life blank selects five hours. For example, 200 mg becomes 100 mg after five hours and 50 mg after ten hours. To estimate the amount at bedtime, the calculator adds elapsed hours to the hours still ahead.

The table follows the decline from now. The reverse formula, half-life × log₂(starting amount / 50 mg), finds the required gap before your target time. Doses already below the target need no waiting time. The chosen 50 mg is not a medical sleep threshold.

What it can and cannot do

Estimate one dose or drinks consumed together. Do not combine drinks spread throughout the day: each has a different decay time. This tool excludes blood measurements, delayed absorption and later drinks. A cup of filter coffee contains roughly 80 to 90 mg, an espresso about 60 mg, cola around 25 mg per 250 ml and black tea about 45 mg. Preparation and portion sizes change these estimates; check the label where available.

Note: For orientation only, not medical advice. Seek medical advice for symptoms or persistent sleep problems instead of relying on another calculation.

Why local processing in the browser

Your device handles the calculation without an account. No remote server needs your dose or bedtime. Once the page and script load, you can try more values offline. Reopening the page without a connection depends on which files your browser has kept.

Creative uses

  • Compare the same coffee consumed earlier in the day.
  • Check the gap before planned rest after a night shift.
  • Try a longer half-life to see how the estimate changes.
  • Compare coffee and tea using their estimated caffeine content.
  • Add a calculated decay timeline to a sleep diary.

A small contribution to climate protection

Each calculation stays in the browser, avoiding another server request. The historical estimate of 1.76 g CO2 per page view gives context, not a measurement of this page. The IEA reports that data centres consumed 415 TWh in 2024. Local processing avoids repeated server round-trips, not all energy demand. These figures cannot establish carbon savings per calculation.

Frequently asked questions

Can water or exercise speed up caffeine clearance?

Not reliably. Your liver does most of the work. Water and sweating cannot flush caffeine out on demand. Do not shorten the half-life just because you exercised.

Why does caffeine affect people differently?

Genetics, medication and liver health affect clearance. Adult literature gives a broad half-life range of three to seven hours. Smoking can shorten it, hormonal contraception can roughly double it and pregnancy can prolong it substantially. This caffeine safety review discusses those differences.

Is half-life the same as duration of effect?

No. One half-life leaves half the starting dose. Sensitivity and tolerance affect alertness and sleep. Fading effects do not mean complete clearance.

What daily amounts are considered safe?

EFSA identifies up to 400 mg throughout the day and single doses up to 200 mg as raising no safety concerns for healthy, non-pregnant adults. For adolescents it proposes 3 mg per kg of body weight daily as a level of no concern. Count all sources. These are not intake targets or guarantees of undisturbed sleep.

Do I need to be online to use the Caffeine Calculator?

You need a connection for the initial page load. After that, the open page can calculate offline as long as the script remains available.

Are my caffeine details uploaded?

No. The calculation does not send your entries to a server. It processes caffeine amounts, time intervals and half-life in your browser only.