How our caffeine estimates work
Our free web calculator illustrates how dose and timing change an estimated amount of caffeine remaining. It uses a transparent half-life calculation, with assumptions you can inspect and change.
The web calculator's formula
For each drink, we use dose × 0.5^(elapsed hours / half-life hours), then sum the contributions. Amounts are in milligrams and elapsed time is calculated between the local dates and times you enter. Drinks later than the chosen bedtime are rejected so they cannot accidentally contribute to an earlier estimate.
The default half-life is five hours, an illustrative value consistent with the approximate adult average discussed in this clinical reference on caffeine. The control allows 1–12 hours for comparing assumptions. Those bounds are interface limits, not a statement that every person's half-life must lie within them.
What is simplified?
The calculation treats each entry as an instantly available dose and then applies exponential decay. Real absorption takes time. It does not calculate blood concentration, receptor occupancy, a personal peak, withdrawal or sleep stages. It does not infer your metabolism from age, medication or health information.
It includes only the drinks you enter. Earlier doses you omit can still matter biologically. A guessed caffeine content remains a guessed input even if the output has a decimal place.
What does the result mean?
“Estimated caffeine at bedtime” means the sum produced by this model at that date and time. A low number is not a guarantee of undisturbed sleep, and a high number does not diagnose a sleep disorder. We do not assign a universal “sleep-safe” threshold or predict the time you will fall asleep.
The half-life guide includes worked examples. For the research on actual sleep outcomes, read caffeine and sleep.
How does this relate to the Clarity app?
Clarity's iPhone app uses logged drinks to provide caffeine estimates and Bedtime Impact. This web tool is a standalone illustration; it is not connected to your app account, Apple Health data or saved drink history. Its results are not a validation of the app's implementation and may differ from app estimates.
Your entries stay in this page
The calculator processes entries in your browser. It does not send drink entries to a server or save them in browser storage. Reloading the page resets the example. Site hosting and external font requests are separate from calculation; see our privacy policy.
Questions or corrections
Read our editorial policy, or contact Clarity with the page URL and the calculation or statement you want us to examine.