Caffeine calculator: half-life and caffeine at bedtime
Enter caffeine amounts and times to estimate what may remain at your chosen bedtime. Compare earlier drinks or different amounts using the same model. This is an educational estimate, not a measurement or a sleep prediction.
Your bedtime estimate
| Drink | Logged caffeine | Hours before bed | Estimated remaining |
|---|
Only the entries above are included. Changing your inputs hides this result until you calculate again. There is no universal remaining-caffeine threshold that guarantees good sleep.
How to use this caffeine calculator
- Enter the milligrams of caffeine you consumed and the time. Use the label or supplier's information where available.
- Add other drinks you want to include, including earlier dates when relevant.
- Choose the date and time you intend to sleep.
- Keep the default half-life for an example or change it to compare assumptions.
- Calculate, then change one input to compare scenarios.
For serving help, read caffeine in drinks. Entries are processed in this page, are not uploaded or saved, and reset on reload.
A worked example without the calculator
Using a five-hour half-life, a 100 mg drink ten hours before bedtime contributes 25 mg at bedtime. A second 100 mg drink five hours before bedtime contributes 50 mg. Added together, the estimate is 75 mg from 200 mg consumed.
How is remaining caffeine calculated?
For each drink: remaining = dose × 0.5^(elapsed hours / half-life hours). Then add the results. The formula simplifies absorption and uses a fixed half-life. Read the methodology and limitations or the half-life guide.
Can this tell me when caffeine will stop affecting my sleep?
No. It compares estimated amounts under chosen assumptions. It cannot identify your personal sensitivity or account for every influence on sleep. The sleep guide explains what the research can tell us.
Keep a record with Clarity
For ongoing logging on iPhone, explore Clarity's caffeine tracker. If you prefer a manual record, our tracking guide explains what to log.