Coffee Kick Calculator
See when the caffeine in your coffee peaks, how much is still in your body at bedtime, and how long before bed your last cup should be, from your half-life.
Coffee Kick Calculator
Background.
Can a coffee at three in the afternoon still be in you at eleven at night? Mostly, yes. In the average adult, caffeine's half-life is about five hours, so after ten hours roughly a quarter of it is still circulating. Two mugs of brewed coffee at 3 pm can leave around 61 mg in your body at an 11 pm bedtime, more than the 30 to 50 mg the FDA gives for an 8 oz cup of black or green tea.
The calculator follows one sitting of coffee, tea or energy drink through the hours after you finish it, using the one-compartment model pharmacology applies to drugs taken by mouth: caffeine enters the blood from the gut at one rate and is cleared by the liver at another. It reports the peak and when it arrives, what is left at bedtime, how long it takes to fall below a level you choose, and what remains a day later.
Your own elimination half-life sets the shape of the whole curve, and people differ widely: a review by Cappelletti and colleagues gives 2 to 12 hours. Smoking speeds clearance; pregnancy and oral contraceptives slow it substantially.
No health authority publishes a safe bedtime level of caffeine, so the comparison point comes from a sleep study. Drake and colleagues gave volunteers 400 mg six hours before their usual bedtime, and they lost more than an hour of sleep. Your bedtime figure is shown against what that dose leaves in the same model, alongside a threshold you set yourself.
What is coffee kick calculator?
Caffeine moves through the body in two overlapping stages. After you swallow it, it passes from the gut into the bloodstream over roughly the first hour, and essentially all of it gets there. Meanwhile the liver, mainly through the enzyme CYP1A2, removes it at a first-order rate: a constant fraction each hour rather than a fixed number of milligrams. Together those produce a curve that climbs steeply to a peak, typically 30 to 60 minutes after the drink, then decays exponentially. The calculator gives that curve as the amount of caffeine in your body in milligrams. It does not give a blood concentration, which would need your weight and a volume of distribution, about 0.6 L/kg in adults, and would imply more precision than a two-parameter model can deliver.
How to use this calculator.
- Enter the caffeine in one serving. The FDA gives 80 to 100 mg for an 8 oz cup of brewed coffee (the 90 mg default is the midpoint), 30 to 50 mg for 8 oz of tea, 30 to 40 mg for a 12 oz soft drink and 40 to 250 mg per 8 fl oz for energy drinks.
- Enter the number of servings drunk at that sitting. They are treated as one dose finished at the same moment.
- Set your caffeine half-life. Start at 5 hours; go higher if you are pregnant, take oral contraceptives, or find that an afternoon coffee reliably keeps you awake, and lower if you smoke.
- Leave the absorption half-life at 10 minutes unless you have a reason to change it, and check that the time to the peak stays in the 30 to 60 minute range. It has to be shorter than the elimination half-life.
- Enter the hours from finishing this drink to bedtime and the most caffeine you are willing to have on board at lights-out. The 50 mg default is a Quanta choice, not a published limit.
- Read "Hours until below your threshold" as your cut-off: the last cup needs to be at least that long before you plan to sleep.
The formula.
The amount in the body t hours after you finish drinking is A(t) = D × ka ÷ (ka − ke) × (e^(−ke·t) − e^(−ka·t)), the Bateman function. D is the dose in milligrams, and ka and ke are the absorption and elimination rate constants, each ln 2 divided by the corresponding half-life in hours. With the defaults, ke = 0.6931 ÷ 5 = 0.1386 per hour and ka = 0.6931 ÷ (10 ÷ 60) = 4.1589 per hour, exactly 30 times faster.
At t = 0 both exponentials equal 1 and A is zero. Because ka is so much larger, the e^(−ka·t) term fades within an hour or two, and after that the curve is plain exponential decay at your elimination half-life. The peak comes at t_max = ln(ka ÷ ke) ÷ (ka − ke), which depends on the two half-lives but not on the dose. Bioavailability is taken as 1, the usual assumption for caffeine.
The 10-minute absorption half-life is not a measured figure. Studies report time to peak instead, 30 to 60 minutes in Cappelletti's review, and 10 minutes puts this model's peak at 50.8 minutes; across elimination half-lives of 2 to 12 hours the derived peak stays between about 39 and 63 minutes.
The time to fall below your threshold has no closed form, so it is found numerically on the falling side of the curve, and reads 0 if the peak never reaches the threshold. The Drake reference is A(6) for D = 400 mg at your half-life.
A worked example.
Two 8 oz cups of brewed coffee at 3 pm, at the FDA range's 90 mg midpoint, make a dose of 2 × 90 = 180 mg, and bedtime is 11 pm, eight hours later. A 5-hour half-life gives ke = 0.1386 per hour and the 10-minute absorption half-life gives ka = 4.1589 per hour. The peak arrives at ln(4.1589 ÷ 0.1386) ÷ (4.1589 − 0.1386) = ln 30 ÷ 4.0202 ≈ 0.8460 hours, about 50.76 minutes after the last sip, and reaches 160.08 mg, 88.93% of what was drunk. After that the decline is steady: 141 mg at two hours, 107 mg at four, 81 mg at six and 61 mg at eight. At bedtime 61.43 mg is left, 34.13% of the dose, which is above the 50 mg threshold. The amount does not fall below 50 mg until 9.48 hours after the coffee, at about half past midnight, so finishing the second cup an hour and a half earlier would bring bedtime under the line. Measured against the Drake reference, the 180.11 mg that 400 mg taken six hours before bed leaves in the same model, this afternoon's coffee is about a third of that tested condition.
Frequently asked questions.
How long before bed should I stop drinking coffee?
Why is the peak lower than the caffeine in my cup?
What caffeine half-life should I use for myself?
Why is some of yesterday's coffee still in my body today?
Can I model three coffees drunk across a morning?
Does this tell me whether I drink too much caffeine?
References& sources.
- [1]Evans J, Richards JR, Battisti AS. "Caffeine." In: StatPearls [Internet]. Treasure Island (FL): StatPearls Publishing; last update 29 May 2024 — "the half-life of caffeine in the average adult is approximately 5 hours", volume of distribution about 0.6 L/kg in adults, and "daily doses of up to 400 mg are considered safe".
- [2]Cappelletti S, Piacentino D, Sani G, Aromatario M (2015). "Caffeine: Cognitive and Physical Performance Enhancer or Psychoactive Drug?" Current Neuropharmacology 13(1):71–88, doi:10.2174/1570159X13666141210215655 — "The maximum plasma concentration is reached after 30-60 minutes from consumption", with "maximum plasma concentrations reached between 15 and 120 min" reported, and "Caffeine's half-life in humans ranges from a minimum of 2 to a maximum of 12 hours".
- [3]Drake C, Roehrs T, Shambroom J, Roth T (2013). "Caffeine Effects on Sleep Taken 0, 3, or 6 Hours before Going to Bed." Journal of Clinical Sleep Medicine 9(11):1195–1200, doi:10.5664/jcsm.3170 — 400 mg of caffeine in pill form at 0, 3 and 6 hours before habitual bedtime; "reducing TST between 1.1 to 1.2 hours" at every administration time; "provides empirical support for sleep hygiene recommendations to refrain from substantial caffeine use for a minimum of 6 hours prior to bedtime".
- [4]U.S. Food and Drug Administration (Consumer Updates). "Spilling the Beans: How Much Caffeine is Too Much?" — an 8-ounce cup of coffee is "closer to 80 to 100 milligrams", 8 oz green or black tea 30–50 mg, a 12-ounce caffeinated soft drink 30–40 mg, energy drinks 40–250 mg per 8 fl oz; 400 mg a day cited as an amount not generally associated with negative effects for most healthy adults, with "too much" varying by body weight, medications, medical conditions and individual sensitivity.
- [5]Grogan S, Preuss CV. "Pharmacokinetics." In: StatPearls [Internet]. StatPearls Publishing; last update 30 July 2023 — first-order kinetics is "the major elimination model of most medications", and half-life is "the amount of time for serum drug concentrations to decrease by 50%". The basis for deriving both rate constants as ln 2 divided by a half-life.
How this page was produced
- Published by
- Quanta Calculator
- Overseen by
- Daniel, Quanta Calculator Researcher
- Primary sources
- 5 cited below
- Method
- A(t) = D · ka⁄(ka−ke) · (e^(−ke·t) − e^(−ka·t)) · t_max = ln(ka⁄ke)⁄(ka−ke)
- Published
- Last verified
Built with AI assistance and verified by automated tests against the cited sources — every worked example on this page is computed by the same code that runs the calculator. How we build and check calculators.
In this category
Embed
Quanta Pro
Paid features are coming later.
- All 1560 calculators remain free
- No billing is enabled