{"success":true,"version":"v1","request":{"tool":"get_calculator_schema","calculator_id":"caffeine-half-life"},"result":{"entity_type":"calculator","id":"caffeine-half-life","calculator_id":"caffeine-half-life","canonical_url":"https://tttkmbb.com/health/caffeine-half-life","name":"Caffeine Half-Life Calculator","title":"Caffeine Half-Life Calculator – Caffeine Remaining in the Body Over Time","category":"health","category_name":"Health","tool_name":"calculate_caffeine_remaining","featured_mcp_tool":false,"description":"Computes the caffeine remaining after a given time by first-order elimination with an adjustable half-life (about 5 hours in healthy adults), the time until the amount falls below a threshold, and a 24-hour decay schedule.","use_when":"You want to know how much of a coffee, tea or energy-drink dose is still active after some hours, or when it will drop below a chosen level before bedtime.","do_not_use_when":"You need guidance for pregnancy, liver disease, children or drug interactions, where the half-life can be two to three times longer; the result is informational only, not medical advice. For generic exponential decay use half-life.","inputs":[{"name":"dose_mg","label":"Caffeine dose","type":"number","unit":"mg","required":true,"max":2000,"exclusive_min":0,"description":"Caffeine taken at time zero. Typical: brewed coffee ≈ 95 mg per 240 mL cup, espresso ≈ 63 mg per 30 mL shot, black tea ≈ 47 mg per cup, cola ≈ 34 mg per 355 mL, energy drink ≈ 80 mg per 250 mL.","example":200},{"name":"hours_elapsed","label":"Hours elapsed","type":"number","unit":"h","required":true,"min":0,"max":72,"description":"Time since the dose was taken.","example":10},{"name":"half_life_hours","label":"Half-life","type":"number","unit":"h","required":false,"default":5,"min":1.5,"max":10,"description":"Elimination half-life: about 5 h in healthy adults (FDA), shorter in smokers (≈ 3 h), longer with oral contraceptives, in pregnancy or with liver disease.","example":5},{"name":"threshold_mg","label":"Threshold","type":"number","unit":"mg","required":false,"default":25,"max":2000,"exclusive_min":0,"description":"Amount below which the remaining caffeine is considered negligible (25 mg ≈ a quarter cup of coffee).","example":25}],"outputs":[{"name":"remaining_mg","label":"Caffeine remaining","type":"number","unit":"mg","decimals":2,"description":"Caffeine still in the body after hours_elapsed."},{"name":"percent_remaining","label":"Remaining","type":"number","unit":"%","decimals":2,"description":"remaining_mg as a percentage of the dose."},{"name":"half_lives_elapsed","label":"Half-lives elapsed","type":"number","decimals":2,"description":"hours_elapsed / half_life_hours."},{"name":"hours_until_threshold","label":"Hours until threshold (from dose)","type":"number","unit":"h","decimals":2,"description":"Time from the dose until the amount falls to threshold_mg (0 when the dose is already at or below it)."},{"name":"hours_until_threshold_from_now","label":"Hours until threshold (from now)","type":"number","unit":"h","decimals":2,"description":"hours_until_threshold minus hours_elapsed, floored at 0."},{"name":"schedule","label":"Decay schedule","type":"list","decimals":2,"description":"Objects with hours and remaining_mg at 0, 2, 4, 6, 8, 10, 12, 16, 20 and 24 hours after the dose."}],"input_schema":{"type":"object","properties":{"dose_mg":{"description":"Caffeine taken at time zero. Typical: brewed coffee ≈ 95 mg per 240 mL cup, espresso ≈ 63 mg per 30 mL shot, black tea ≈ 47 mg per cup, cola ≈ 34 mg per 355 mL, energy drink ≈ 80 mg per 250 mL. Unit: mg.","type":"number","maximum":2000,"exclusiveMinimum":0,"examples":[200],"x-unit":"mg"},"hours_elapsed":{"description":"Time since the dose was taken. Unit: h.","type":"number","minimum":0,"maximum":72,"examples":[10],"x-unit":"h"},"half_life_hours":{"description":"Elimination half-life: about 5 h in healthy adults (FDA), shorter in smokers (≈ 3 h), longer with oral contraceptives, in pregnancy or with liver disease. Unit: h.","type":"number","minimum":1.5,"maximum":10,"default":5,"examples":[5],"x-unit":"h"},"threshold_mg":{"description":"Amount below which the remaining caffeine is considered negligible (25 mg ≈ a quarter cup of coffee). Unit: mg.","type":"number","maximum":2000,"exclusiveMinimum":0,"default":25,"examples":[25],"x-unit":"mg"}},"additionalProperties":false,"required":["dose_mg","hours_elapsed"]},"output_schema":{"type":"object","properties":{"remaining_mg":{"description":"Caffeine still in the body after hours_elapsed. Unit: mg.","type":"number","x-unit":"mg"},"percent_remaining":{"description":"remaining_mg as a percentage of the dose. Unit: %.","type":"number","x-unit":"%"},"half_lives_elapsed":{"description":"hours_elapsed / half_life_hours.","type":"number"},"hours_until_threshold":{"description":"Time from the dose until the amount falls to threshold_mg (0 when the dose is already at or below it). Unit: h.","type":"number","x-unit":"h"},"hours_until_threshold_from_now":{"description":"hours_until_threshold minus hours_elapsed, floored at 0. Unit: h.","type":"number","x-unit":"h"},"schedule":{"description":"Objects with hours and remaining_mg at 0, 2, 4, 6, 8, 10, 12, 16, 20 and 24 hours after the dose.","type":"array"}}},"formula":"remaining_mg = dose_mg × 0.5^(hours_elapsed / half_life_hours); percent_remaining = 100 × 0.5^(hours_elapsed / half_life_hours); hours_until_threshold = half_life_hours × log2(dose_mg / threshold_mg), 0 when dose_mg ≤ threshold_mg; hours_until_threshold_from_now = max(0, hours_until_threshold − hours_elapsed)","method":"Assumes first-order (exponential) elimination and complete absorption at time zero; absorption actually takes 30–60 minutes and the half-life ranges from about 1.5 to 9.5 h between adults. Informational only, not medical advice.","sources":[{"name":"FDA – Spilling the Beans: How Much Caffeine is Too Much?","url":"https://www.fda.gov/consumers/consumer-updates/spilling-beans-how-much-caffeine-too-much","type":"government","retrieved_at":"2026-09-24"},{"name":"Wikipedia – Caffeine (pharmacokinetics)","url":"https://en.wikipedia.org/wiki/Caffeine","type":"reference","retrieved_at":"2026-09-24"}],"freshness":{"type":"static","max_age_seconds":null,"note":"Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output."},"examples":[{"name":"200 mg after 10 h, half-life 5 h","inputs":{"dose_mg":200,"hours_elapsed":10,"half_life_hours":5,"threshold_mg":25},"expected":{"remaining_mg":50,"percent_remaining":25,"half_lives_elapsed":2,"hours_until_threshold":15,"hours_until_threshold_from_now":5},"url":"https://tttkmbb.com/api/v1/calculate/caffeine-half-life?dose_mg=200&hours_elapsed=10&half_life_hours=5&threshold_mg=25"},{"name":"One 95 mg coffee after 6 h","inputs":{"dose_mg":95,"hours_elapsed":6},"expected":{"remaining_mg":41.35,"percent_remaining":43.53,"hours_until_threshold":9.63,"hours_until_threshold_from_now":3.63},"url":"https://tttkmbb.com/api/v1/calculate/caffeine-half-life?dose_mg=95&hours_elapsed=6"}],"faq":[{"q":"How much caffeine is in my drink?","a":"Roughly: brewed coffee 95 mg per 240 mL cup, espresso 63 mg per shot, black tea 47 mg, green tea 28 mg, cola 34 mg per 355 mL can, energy drink 80 mg per 250 mL. Check the label when it states a value."},{"q":"When should I stop drinking coffee before bed?","a":"With a 5 h half-life, half of a dose is still present after 5 h and a quarter after 10 h; many sleep guidelines suggest no caffeine within 6–8 hours of bedtime. Use the threshold outputs to find the time for your own dose."}],"tags":["caffeine half life","caffeine calculator","caffeine remaining","coffee before bed","caffeine metabolism"],"related":[{"calculator_id":"half-life","reason":"Generic exponential decay for any substance or half-life."},{"calculator_id":"sleep-cycles","reason":"Plan a bedtime once the caffeine has worn off."}],"links":{"html":"https://tttkmbb.com/health/caffeine-half-life","markdown":"https://tttkmbb.com/health/caffeine-half-life.md","json":"https://tttkmbb.com/health/caffeine-half-life.json","api":"https://tttkmbb.com/api/v1/calculate/caffeine-half-life","schema":"https://tttkmbb.com/api/v1/calculators/caffeine-half-life","openapi":"https://tttkmbb.com/openapi.json","mcp":"https://tttkmbb.com/mcp"},"version":"v1","updated_at":"2026-09-24"},"timestamp":"2026-09-24T03:52:04Z","next_actions":[{"tool":"run_calculator","calculator_id":"caffeine-half-life","reason":"Run Caffeine Half-Life Calculator with the inputs above."}],"links":{"markdown":"https://tttkmbb.com/health/caffeine-half-life.md"}}