Sleep, daily intake & half-life
Caffeine Calculator: Half-Life, Sleep Cutoff & Safe Daily Limit
Track caffeine on board across the day, get a personalized safe daily limit by body weight and age, find the latest safe time for one more cup before bed, and size a pre-workout dose. Half-life adjusts for pregnancy, contraceptives, and smoking. Educational estimates only.
By Jeff Beem
Updated
What you've had today
Drink presets use USDA averages and manufacturer labels. Edit the mg field to match your brand or pour size, or pick Custom to type your own.
You
EFSA's safe range is 3-6 mg/kg/day. The personal limit on the right uses the 5 mg/kg midpoint, capped at 400 mg.
Adults 50-64 use a 10% reduction; 65+ uses 25% for slower CYP1A2 clearance. Tool is not designed for minors.
Average CYP1A2 activity. Half-life ~5 h.
Sleep & sensitivity
After-midnight bedtimes are handled. The cutoff math finds the latest time you can drink before bed.
Common heuristic: below this, EEG disruption is small.
Using state preset: 5.0 h
If a late drink keeps you wired and the calculator says it shouldn't, your half-life is probably longer than the preset.
The latest-safe time below assumes you drink this much extra (95 mg = 8 oz brewed coffee).
Pre-workout (optional)
Caffeine on board now Β· 12:00 PM
137 mg
Total today: 190 mg Β· 49% of personal limit (Under)
Predicted at bedtime
32 mg
Threshold: 50 mg at 10:30 PM
Latest safe last cup
Already too late
For 95 mg, half-life 5.0 h.
Drops below 25 mg
12:18 AM
From now on; "negligible" by most policies.
Personal daily limit
386 mg
5 mg/kg Γ age factor 1
Check
mg(t) = Ξ£ Di Γ 0.5(t β ti) / 5.0h
At now (12:00 PM), 2 doses sum to 137 mg.
Caffeine across the day
Total caffeine on board between 6:00 AM and 12:00 AM. Each drink is marked at its consumption time. The dashed red line is your at-bedtime threshold; the dashed black line is the current time.
Caffeine primer
Reading the results panel
A short read on what each output means and where the model has soft edges.
Overview
What this calculator does
The tool tracks every drink you've added today, decays each one with a first-order half-life, and sums what's left at any time you ask about. The headline is caffeine on board now. The tile grid covers the four questions people actually want answered: predicted level at bedtime, the latest safe time for one more cup, when caffeine drops below the 25 mg "negligible" line, and your personal daily safe limit.
Inputs feed one model. Change body weight and the daily limit shifts. Change the half-life and the curve in the chart relaxes or steepens. The output is an estimate, not a clinical reading; for medication interactions or arrhythmia risk, ask your doctor.
Formula
Half-life decay, multiple doses
Each dose decays by half every tΒ½ hours:
remaining(t) = D Γ 0.5(t β ti) / tΒ½
Multi-dose total is the sum across drinks (linear pharmacokinetics, valid at dietary doses below CYP1A2 saturation):
total(t) = Ξ£ Di Γ 0.5(t β ti) / tΒ½
The verification line at the bottom of the dark panel restates this with your actual numbers, so you can match it against a spreadsheet or hand calculation.
Half-life states
Why the same coffee can be a 3-hour or an 11-hour drink
Caffeine half-life varies by a factor of three to four across healthy adults, and almost an order of magnitude once pregnancy enters the picture. The tool ships with six state presets that drive a sensible default; flip on the custom half-life if you want to dial it in to your real-world response.
- Healthy adult: ~5 h. The number every cookie-cutter calculator assumes by default.
- Heavy smoker: ~3 h. Smoking induces CYP1A2, so caffeine clears faster (and the buzz fades faster too).
- Hormonal contraceptive or SSRI: ~7 h. Estrogens and several SSRIs slow CYP1A2; one cup hits like 1.5 cups would otherwise.
- Pregnancy 3rd trimester: ~11.5 h. Late pregnancy nearly doubles the half-life, which is why the ACOG limit drops to 200 mg/day.
Sleep cutoff
Working backward from bedtime
The classic question is "when should I stop drinking coffee for sleep?" The tool answers it by back-solving. Given everything you've already had, project the level at bedtime, find the headroom under your threshold, then compute how late you could add one more drink and still land under it. Closed form:
t* = bedtime β tΒ½ Γ log2(Dnext / headroom)
The threshold dropdown lets you pick how strict to be. Sleep researchers like Walker and Drake target zero. The conventional 50 mg line is where EEG sleep architecture begins to change measurably. If your sleep already feels off, drop to 25 mg or strict zero and watch the cutoff time march earlier.
Pre-workout
3-6 mg/kg, 45-60 min before
Caffeine is the most-studied legal ergogenic in sport. The ISSN position stand and EFSA's safety opinion converge on a 3-6 mg/kg single dose taken 45-60 min before exercise as the well-evidenced range for endurance and high-intensity work. Toggle the pre-workout block to see a personalized dose and recommended take-time.
Two warnings the calculator can't print. First, the dose still counts toward your daily limit and your sleep cutoff. Late-afternoon training plus a 200 mg pre-workout is the most common reason coffee drinkers can't fall asleep at night. Second, 6 mg/kg is a ceiling, not a target; taller doses raise jitter and arrhythmia risk without extra performance.
Limits
What this tool can't do
Linear pharmacokinetics break down at very high doses (CYP1A2 saturates above ~600 mg in a single sitting), and the tool doesn't model that. It also can't predict interactions with prescription drugs, arrhythmia history, anxiety disorders, or caffeine sensitivity at the genetic CYP1A2*1F level. Outputs are educational estimates, not medical advice.
Pregnancy guidance is the firmest part. The 200 mg/day cap is not negotiable in clinical guidance, regardless of body weight, and high consumption is linked to miscarriage and low birth weight in observational data. If you're pregnant or breastfeeding, talk to your obstetrician before changing intake based on this calculator.
Two morning coffees, one bedtime
The default load is 95 mg at 8 a.m. and another 95 mg at 11 a.m. With a 5 h half-life and a 50 mg bedtime target, you can watch how much is still on board at 10:30 p.m. and what time the tool says one more 95 mg cup would break your line. Weight sets the daily cap; state sets half-life; bedtime sets the cutoff.
Four things worth knowing
Half-life is personal
Latest-safe time is for one hypothetical cup
Pre-workout belongs in the drink list
Caffeine calculator: half-life, sleep cutoff, and daily limit
Two 95 mg coffees by late morning, 5 h half-life, 50 mg at-bed target: see what is left at 10:30 p.m. and when one more cup is too late. Educational only; not medical advice.
What this calculator does
- Outputs:Mg on board now; mg predicted at bedtime; latest safe time for one hypothetical cup; daily limit; optional ISSN-style pre-workout dose and suggested take-time (~50 min before workout).
- Limits:Linear decay model breaks down at extreme single doses or very high daily intake. Does not model every drug interaction, arrhythmia, or anxiety. Drink presets are typical USDA/manufacturer values. If a clinician capped your caffeine, follow that. Runs in the browser only.
The math
- Decay:and
- Daily limit:weight (kg) Γ 5 mg/kg, Γ0.9 if age 50β64, Γ0.75 if 65+, hard cap 400 mg (FDA) or 200 mg in pregnancy presets (ACOG).
- Sleep cutoff:Latest minute for a hypothetical dose before bedtime:
- Worked example:200 mg at 8:00 and 95 mg at 11:00, h, bedtime 22:00, threshold 50 mg: existing at bed β mg. Headroom for another 95 mg cup is essentially zero; the tool will say no safe late cup unless you relax the threshold.
- Pre-workout:Dose (mg) = weight (kg) Γ 3, 4.5, or 6. UI suggests intake about 50 minutes before workout time.
- Half-life presets:Heavy smoker ~3 h; healthy adult ~5 h; contraceptive/SSRI ~7 h; pregnancy ~7 / ~9 / ~11.5 h by trimester. Custom override available.
Using the calculator
- Drinks:Edit mg per preset. Cold brew, energy cans, and matcha differ a lot from averages.
- Hidden caffeine:Chocolate, some pain relievers, and βdecafβ (not zero) are not auto-added; enter them if they matter.
- Pregnancy:Switch to a pregnancy trimester for 200 mg cap and longer . See the pregnancy timeline calculator if useful.
- Privacy:All math stays on your device.
Caffeine Calculator FAQ
How long does caffeine stay in your system?
How much caffeine is safe per day?
When should I stop drinking coffee to sleep well?
How much caffeine is safe during pregnancy?
How much caffeine before a workout?
Why does half-life change with pregnancy or birth control?
Is the 50 mg sleep threshold too high?
Are drink caffeine values exact?
Sources & citations
References used for the calculation method and definitions. Links open in a new tab when available.
Source for the daily-intake math: single doses up to 3 mg/kg and habitual intake up to 5.7 mg/kg per day (about 400 mg) do not raise safety concerns for healthy adults; pregnant women up to 200 mg/day. The calculator uses the 5 mg/kg midpoint of the 3-6 mg/kg/day range as its baseline.
United States Food and Drug Administration consumer guidance fixing 400 mg/day as a generally safe ceiling for healthy adults; the calculator uses this value as the absolute hard cap on the personal daily limit.
Defines the 200 mg/day pregnancy cap that overrides body-weight math when the user selects a pregnancy state preset.
Randomized trial showing 400 mg of caffeine reduces objectively measured sleep by more than an hour even when taken 6 hours before bed; supports the 6-hour minimum cutoff and the 50 mg at-bedtime EEG-impact heuristic used in the sleep threshold.
Source for the pre-workout dose: caffeine improves performance at 3-6 mg/kg body mass; doses at or above 9 mg/kg add side effects without extra benefit. Most studies use 60 minutes pre-exercise.
United States Department of Agriculture reference database for the typical caffeine values used in the drink presets (brewed coffee, espresso, brewed tea, soda).
Fitness Reference Note
Informational Use: These calculations (BMI, Calories, etc.) are based on standard statistical formulas and are intended for general reference and goal-setting purposes only.
Consult Experts: This tool does not provide medical advice, diagnosis, or treatment. Results may not be accurate for athletes, pregnant individuals, or those with underlying health conditions.
Health Safety: Always consult with a healthcare professional or qualified trainer before beginning any new diet or intensive exercise program.
Privacy First: All calculations are performed locally in your browser. No health data is stored or transmitted to any server.