Latest Sip Time
{{ cutoff_time_short || '—' }}
Stay under {{ ST.formatNumber(Number(threshold_mg) || 0, 1) }} mg by {{ bedtime_short || '—' }}. Day total {{ ST.formatNumber(projectedDailyTotal, 0) }}/{{ ST.formatNumber(safetyProfile.dailyLimit, 0) }} mg.
{{ cutoff_lead_display }} lead {{ metabolismBadgeText }} {{ thresholdBadgeText }} {{ candidate_status_label }} Cap {{ candidate_time_short || 'now' }}: {{ candidate_safe_dose_display }} {{ window_status_display }}
{{ statusAlertText }}
mg
h
mg
min
min
mg
Candidate Check
{{ candidate_time_short || '—' }}
{{ candidate_status_label || '—' }}
Residual @ bed: {{ candidate_residual_display }}
Dose Cap
{{ candidate_safe_dose_display }}
Safe max at {{ candidate_time_short || 'candidate time' }}
Reduction needed: {{ candidate_dose_reduction_display }}
Window Status
{{ window_status_display }}
{{ guardrailStatus }}
{{ candidate_action }}
Metric Value Copy
{{ row.label }} {{ row.value }}
Scenario Time Lead Before Bed Residual @ Bed Safe Max Dose Status
{{ row.label }} {{ row.time }} {{ row.lead }} {{ row.residual }} {{ row.safeDose }} {{ row.status }}

                
:

Caffeine can still be active at bedtime long after the obvious buzz has faded. That matters because sleep disruption is tied not only to whether you had caffeine that day, but to how much remains in your system when you try to sleep.

A caffeine cut-off estimate answers one practical question: how early does a drink need to happen so the remaining amount at bedtime stays at or below a target you choose. That makes the idea useful for afternoon coffee, pre-workout drinks, late study sessions, shift work, or any situation where alertness now may trade against sleep later.

Timeline showing a latest sip point, a short absorption period, then caffeine decay until bedtime when the remaining amount reaches the chosen target.

Clearance is not the same for everyone. A half-life near 5 hours is a useful adult average, but smoking, pregnancy, liver function, medicines, hormonal contraception, and plain individual sensitivity can shift the answer enough to move a bedtime cut-off by hours.

Use the result as an informational estimate, not as a diagnosis or treatment rule. If you are pregnant, highly caffeine-sensitive, treating a sleep problem, or taking medicines that change caffeine metabolism, more conservative settings and clinician advice matter more than any single clock time.

Technical Details:

Caffeine is absorbed quickly after oral intake. Standard pharmacology references describe near-complete absorption, with peak blood levels usually reached within about 15 to 120 minutes. After that peak, elimination is commonly modeled as first-order decay, meaning the remaining amount falls by half over each half-life interval. In healthy adults the average half-life is about 5 hours, but that average hides wide real-world variation, and pregnancy can prolong clearance much further.

That makes bedtime planning a dose-to-threshold problem. A larger drink starts farther above the bedtime target. A longer half-life stretches the decay window. A lower bedtime threshold demands more decay before lights out. If bedtime lands before the drink has fully absorbed, the residual estimate should not act as if a full peak was present from the first minute, so this tool treats the absorption window separately before applying the half-life model.

The core math works backward from bedtime to the latest drink time that still leaves the chosen residual amount at or below the bedtime target.

D = planned caffeine dose in mg T = chosen bedtime threshold in mg thalf = selected half-life in hours n = ln(DT)ln2 tdecay = n×thalf tlead = tdecay+tabsorb+tbuffer tcutoff = tbedtime-tlead R(t) = D×12tthalf
How each planning element changes the caffeine cut-off calculation
Planning element Changes bedtime residual math? Changes warning or comparison lanes? Why it matters
Dose Yes Yes A bigger dose needs more half-lives to drop to the same bedtime target and also raises the projected day total.
Half-life Yes No Longer clearance means each halving takes longer, so the latest sip moves earlier.
Bedtime threshold Yes No A lower residual target is stricter and shifts the cut-off earlier even when the drink size stays the same.
Absorption time and extra buffer Yes No These extend the total lead time before bed without changing the underlying half-life.
Earlier caffeine today No Yes It affects Projected daily total and Remaining allowance, but it does not get stacked into the single-drink decay curve.
Daily intake guide and fixed sleep guardrail No Yes These provide separate exposure and timing checks alongside the dose-to-threshold estimate.

The extra guidance lanes in this tool are deliberately separate. The daily intake guide changes warning language and remaining allowance. The fixed sleep guardrail gives you a simple 3 to 8 hour no-caffeine window for comparison. Neither one rewrites the half-life math. That separation matters because a drink can fit the bedtime threshold while still pushing total daily intake too high, and the reverse can also happen.

The Healthy adult guide uses FDA's widely cited 400 mg per day reference. The Pregnancy guide uses ACOG's under-200 mg per day advice. The Sensitivity-aware guide is a conservative planning lane built into this tool rather than an external clinical standard. Those guide choices help you judge exposure, while the bedtime estimate itself still comes from dose, threshold, half-life, absorption, buffer, and bedtime.

Everyday Use & Decision Guide:

A strong first pass is simple: choose a Drink preset, set Target bedtime, leave Metabolism profile on the typical 5-hour setting, and keep the standard 30 mg bedtime target. That gives you a neutral planning estimate before you start making it stricter for sensitivity, pregnancy, or past experience.

  • Treat the preset as a planning estimate, not a lab measurement. FDA drink ranges vary widely, especially for brewed coffee and energy drinks, so replace the preset with a product-specific mg value when you have one.
  • If you are evaluating a late drink, switch Candidate drink time to a clock time and compare Candidate residual @ bedtime, Safe max dose at candidate time, and Dose reduction needed instead of relying only on the headline cut-off.
  • If you already had caffeine earlier, fill in Consumed earlier today so Projected daily total and Remaining allowance reflect the whole day. It does not add those earlier drinks into the decay curve.
  • Use Model vs guardrail when you want a second sanity check. If the pharmacokinetic estimate is earlier than the fixed guardrail, your personal settings are stricter than a simple clock rule.

This tool is a good fit when you know the rough caffeine content of one planned drink and want to protect a target bedtime. It is a poor fit if you want a full stacked-caffeine diary across several late drinks, because the decay charts describe the current planned dose rather than the sum of everything consumed that day.

The result tabs are built for different kinds of checking. Latest Sip Plan is the best place for a decision. Residual Curves compares the computed cut-off with drinking now or at your chosen candidate time. Dose-at-Time Map shows how much caffeine fits as lead time changes. Timing Scenarios lines up the candidate plan, latest cut-off, and fixed guardrail in one table. JSON, CSV, chart-image, and DOCX exports are there if you want to keep or share the plan.

Before you trust a green-looking result, pause at two fields: Candidate residual @ bedtime and Projected daily total. If either one is worse than you expected, adjust the half-life, bedtime threshold, dose, or candidate time before treating the plan as settled.

Step-by-Step Guide:

  1. Pick a Drink preset or type a custom Caffeine dose. If you know the label value for your exact drink, use that instead of the preset.
  2. Set Target bedtime and confirm Date mode. Late at night, Auto may move bedtime to tomorrow if that clock time has already passed.
  3. Read Latest sip time, Window status, and Lead time to bedtime. Those three outputs tell you the basic timing answer.
  4. Open Advanced if you need a slower or faster Metabolism profile, a different Threshold profile, more Absorption time, or an Extra buffer.
  5. If you want to test a specific late drink, change Candidate drink time to a clock time and compare Candidate residual @ bedtime, Safe max dose at candidate time, and Dose reduction needed.
  6. If total exposure matters, set Guideline profile and Consumed earlier today, then check Projected daily total and Remaining allowance.
  7. If no estimate appears, fill Target bedtime. If the timing looks shifted by a day, fix Date mode before changing the pharmacology settings.

Interpreting Results:

The cleanest read is to compare the bedtime residual against the bedtime target you chose. If Candidate residual @ bedtime is Bedtime threshold, that candidate timing fits your settings. If it is > the target, the drink is too large, too late, or both for the assumptions you entered.

  • If Window status says the window closes in a remaining duration, the current moment is still earlier than Latest sip time. If it says you are late by a duration, that cut-off has already passed.
  • If Projected daily total is greater than the chosen guide limit, the timing estimate may still fit but the day-total warning remains important.
  • If Model vs guardrail says the model is earlier than the fixed guardrail, the half-life-based estimate is the stricter boundary. If the guardrail is earlier, the simple hour rule is stricter.
  • If drink now → safe bedtime is the inverse view of the same model. It shows how late bedtime would need to be for the current dose to fit right now.

A passing result does not guarantee perfect sleep. Recent sleep research shows that dose and timing interact, and different people notice different levels of disruption. Treat the headline time as a planning boundary, then use Candidate residual @ bedtime, Status, and your own experience to decide whether the threshold or half-life should be more conservative next time.

Worked Examples:

Standard coffee with a late-afternoon candidate. Set Caffeine dose to 95 mg, Target bedtime to 10:00 PM, keep the typical 5-hour half-life, keep the 30 mg target, and leave Absorption time at 45 minutes. The tool reports about Required half-lives 1.66, Required decay time 8 h 18 m, and Lead time to bedtime 9 h 3 m, so Latest sip time lands around 12:57 PM. If you then check a 4:00 PM candidate drink, Candidate residual @ bedtime becomes about 45.88 mg > 30.00 mg, Safe max dose at candidate time is about 62.1 mg, and Dose reduction needed is about 32.9 mg.

Higher dose plus a pregnancy intake guide. Set Caffeine dose to 160 mg, Target bedtime to 11:00 PM, keep the 5-hour half-life, keep the 30 mg target, add Absorption time 45 minutes and Extra buffer 30 minutes, switch Guideline profile to pregnancy, and enter 80 mg for Consumed earlier today. The longer lead pushes Latest sip time to about 9:41 AM and Lead time to bedtime to 13 h 19 m. Even before you test a candidate clock time, Projected daily total reaches 240 mg and Remaining allowance drops to -40 mg, so the timing plan and the exposure warning both deserve attention.

Troubleshooting an unexpected next-day answer. Suppose it is already 11:15 PM and you enter Target bedtime as 10:00 PM with Date mode left on Auto. Using 95 mg, a 5-hour half-life, a 30 mg target, and 45 minutes absorption, Bedtime (local) rolls to tomorrow night and Latest sip time moves to about 12:57 PM tomorrow. If that is not what you meant, switch Date mode to Tonight. The same inputs then turn Window status into late by about 10 h 18 m, and If drink now → residual @ bedtime becomes 95.00 mg > 30.00 mg.

FAQ:

Why can the tool call a drink late even when generic advice sounds less strict?

Generic rules average many people and many drink sizes. This tool uses your chosen Bedtime threshold, Half-life, and drink size. A recent randomized sleep trial found that 100 mg and 400 mg doses behaved very differently near bedtime, so a personal planning threshold can reasonably be stricter than a one-size-fits-all rule.

Do the drinks I already had today change the decay curve?

No. Consumed earlier today affects Projected daily total and Remaining allowance, but the residual curves and cut-off time are calculated from the single planned dose in Caffeine dose.

Why did the latest sip time jump to tomorrow?

That usually comes from Date mode. In Auto, if the bedtime clock time has already passed today, bedtime is moved to tomorrow. Switch to Tonight when you truly mean the current night's bedtime.

Are the drink presets exact?

No. They are planning anchors. FDA drink tables show that brewed coffee and energy drinks can vary a lot by brand and serving size, so entering a product-specific mg value is better whenever you have it.

Why is no cut-off showing?

The tool needs both a valid Target bedtime and a positive Caffeine dose. If bedtime is blank, the warning asks you to set one. If the dose is zero, the timing fields stay empty until you enter a value above 0 mg.

Does it send my caffeine plan to a server?

No. The calculations, charts, and downloads are generated in the browser, and this tool has no separate server-side processing step.

Glossary:

Half-life
The time needed for the remaining caffeine amount to fall by half.
Bedtime threshold
The residual caffeine amount you are willing to tolerate when bedtime arrives.
Lead time
The total time the model wants between the drink and bedtime after decay, absorption, and any extra buffer.
Candidate plan
The drink time you are testing right now, either the current moment or a specific clock time.
Guardrail
A fixed no-caffeine window before bedtime used as a second comparison, separate from the half-life estimate.
Residual
The estimated caffeine still present at bedtime under the assumptions you entered.