Skip to main content

Free health tool

Caffeine at Bedtime Calculator

Illustrate remaining caffeine mass at a chosen time using a simple half-life model.

  • Free
  • Instant result
  • No account

Calculate your result

A model assumption in hours. Change it to see a different scenario.

Accepted range: 0.25 to 48 h

Enter the amount for this serving, in milligrams.

Accepted range: 0 to 1000 mg

Enter elapsed hours to bedtime, including any hours after midnight.

Accepted range: 0 to 72 h

Your result will appear here

Nothing is saved or added to the URL.

Illustration of coffee cup and bedtime moon beside the calculator’s worked example.

What this result means

Enter the labelled caffeine for up to three servings. Use clock times for the most recent serving times before bedtime, or type elapsed hours directly. Choose an assumed half-life to see what the model leaves in total and from each serving. [1][2]

Start with milligrams per serving

Use the caffeine amount for the portion you consumed. If the figure on the package is per serving and you drank two servings together, the amount for that entry is twice the label serving. Coffee-shop drinks can vary, so the result is only as good as the amount you enter. [1][2]

Choose clock times or elapsed hours

For a 21:30 drink and a 00:30 bedtime, clock mode uses three elapsed hours. It uses the most recent occurrence of each time at or before bedtime, so equal clocks represent zero hours. Enter elapsed hours for servings 24 hours or more before bedtime, or for nights when the clock changed. [1][2]

Treat half-life as an assumption

Research reports a range of elimination times. Dose, pregnancy, medicines and other differences can affect caffeine handling. Compare the same serving history under different assumptions to see how sensitive the estimate is. [1][2]

Read each serving alongside the total

The estimated milligrams by serving show how much each entered drink contributed. The share remaining compares the combined estimate with the amount entered and is omitted when that amount is zero. A result below 0.1 mg means the model still gives a small positive estimate. [1][2]

Can the result tell me whether I will sleep well?

It describes the remaining amount predicted by the model. It cannot measure sensitivity, sleep quality or personal risk. An entry at zero elapsed hours simply makes the model count the whole serving before any elimination has happened. [1][2]

Formula and assumptions

Formula
For each serving, remaining mg = serving mg × 2 raised to −(elapsed hours ÷ assumed half-life hours). Add all remainders. Divide by the entered caffeine total to get the share remaining, when the total is positive. [1][2]
Version
Caffeine at Bedtime Calculator, 1.0
Rounding
Keep full precision until the servings are added. Milligrams and percent are displayed to one decimal place. A positive amount that would round to zero is shown as less than 0.1 mg.
Worked example
For two servings and a five-hour half-life, 120 mg at 19:30 leaves 60 mg at a 00:30 bedtime. Another 80 mg at 14:30 leaves 20 mg. The combined estimate is 80 mg, or 40% of the 200 mg entered. [1][2]

Who this is for — and when not to use it

Intended use

Illustrate remaining caffeine mass at a chosen time using a simple half-life model.

Not intended for

The model assumes immediate absorption and a constant elimination rate. It does not measure your blood concentration, establish your own half-life, predict whether you will fall asleep or show how much caffeine you can safely have.

Exclusions

  • Measurements or units that do not match the selected method.

Evidence sources

  1. 1. Scientific memorandum: Caffeinated alcoholic beverages, pharmacokinetics of caffeine — U.S. Food and Drug Administration. Accessed Nov 20, 2026.
  2. 2. Caffeine Effects on Sleep Taken 0, 3, or 6 Hours before Going to Bed — Journal of Clinical Sleep Medicine. Accessed Nov 20, 2026.