{
  "dataset": "model",
  "title": "The caffeine elimination model this site publishes",
  "description": "First-order elimination with no absorption phase: the constants, the formulas, worked examples you can check, and the limits of what any of it can tell you about a person.",
  "generated": "2026-09-30",
  "count": 1,
  "self": "https://trackcaffeine.com/api/v1/model.json",
  "documentation": "https://trackcaffeine.com/api/",
  "licence": {
    "name": "CC BY 4.0",
    "url": "https://creativecommons.org/licenses/by/4.0/",
    "attribution": "TrackCaffeine (https://trackcaffeine.com)",
    "terms": "Free to reuse, redistribute and build on, including commercially, with attribution to TrackCaffeine and a link to https://trackcaffeine.com."
  },
  "provenance": {
    "compiled_by": "Vast Flow, LLP",
    "method": "Caffeine figures are compiled by hand from manufacturer labelling and nutrition panels, USDA FoodData Central and published measurement tables, for the serving size named in the row. Everything derived — decay, cutoff times, cup equivalents — is computed from the published model, not taken from a source.",
    "licensed_in_data": false,
    "licensed_in_note": "No column here is redistributed from a third-party API or a licensed corpus, which is why the whole set can carry CC BY 4.0. Brand names identify the product a row describes.",
    "primary_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"
      },
      {
        "name": "EFSA — Scientific Opinion on the Safety of Caffeine (2015)",
        "url": "https://www.efsa.europa.eu/en/efsajournal/pub/4102"
      },
      {
        "name": "USDA FoodData Central",
        "url": "https://fdc.nal.usda.gov/"
      },
      {
        "name": "Drake et al., Journal of Clinical Sleep Medicine (2013)",
        "url": "https://jcsm.aasm.org/doi/10.5664/jcsm.3170"
      }
    ],
    "contact": "support@trackcaffeine.com"
  },
  "engine_source": "https://trackcaffeine.com/api/v1/model.json",
  "caveats": [
    "The model uses a population-average half-life. Real half-life ranges from roughly 1.5 to over 10 hours with smoking, pregnancy, medication and CYP1A2 genotype, so a bedtime figure is a starting point a person tunes, not a prediction about them.",
    "Nothing here is medical advice or a recommended intake. It is published arithmetic and cited reference values.",
    "Every caffeine value is an estimate for a labelled serving, not a measurement of a particular cup. Bean, grind, brew time, steeping and the shop's actual pour move a coffee figure by more than the gap between many rows in this set."
  ],
  "constants": {
    "half_life_minutes": 342,
    "half_life_hours": 5.7,
    "half_life_range_hours": [
      1,
      12
    ],
    "sleep_threshold_mg": 100,
    "daily_guidance_mg": 400,
    "pregnancy_guidance_mg": 200,
    "standard_cup_mg": 95,
    "drip_coffee_mg_per_240ml": 96,
    "default_bedtime": "23:00",
    "weight_band_mg_per_kg": {
      "moderate": 3,
      "upper": 6
    }
  },
  "formulas": {
    "remaining": {
      "expression": "remaining_mg = dose_mg × 0.5 ^ (minutes ÷ half_life_minutes)",
      "note": "First-order elimination: a fixed FRACTION leaves per unit time, never a fixed amount. Several doses are summed by evaluating each one's own curve at the same moment — never by adding the doses first and decaying the total, which gives the wrong answer for anything drunk at different times."
    },
    "total_at_a_moment": {
      "expression": "total(t) = Σ over doses of  dose.mg × 0.5 ^ ((t − dose.time) ÷ half_life)",
      "note": "A dose whose time is after t contributes 0. It has not been drunk yet."
    },
    "time_to_target": {
      "expression": "hours = half_life_minutes × log2(dose_mg ÷ target_mg) ÷ 60",
      "note": "Zero when the dose already starts at or under the target. Not negative."
    },
    "latest_cup_before_bed": {
      "expression": "cutoff = bedtime − half_life × log2(cup_mg ÷ (sleep_threshold − mg_already_there_at_bedtime))",
      "note": "The inverse problem, and the one this site is organised around. Undefined — meaning no time works tonight — when the caffeine already in the person exceeds the threshold at bedtime on its own. Where the headroom is larger than the cup, a cup at bedtime itself is still under, so the answer is bedtime."
    }
  },
  "worked_examples": [
    {
      "question": "A 200 mg dose. What is left after 3, 6 and 12 hours?",
      "inputs": {
        "dose_mg": 200,
        "hours": [
          3,
          6,
          12
        ]
      },
      "answer": [
        {
          "hours": 3,
          "mg": 139
        },
        {
          "hours": 6,
          "mg": 96
        },
        {
          "hours": 12,
          "mg": 46
        }
      ]
    },
    {
      "question": "One 240 ml drip coffee (96 mg). When is it back under 100 mg?",
      "inputs": {
        "dose_mg": 96
      },
      "answer": {
        "crosses_sleep_threshold": false,
        "hours_to_sleep_threshold": 0,
        "note": "It never crosses it: 96 mg starts below the 100 mg threshold. A single ordinary cup is not what keeps people awake — the second and third one, and the time of day, are."
      }
    },
    {
      "question": "A 300 mg energy drink at 15:00, bedtime 23:00. How much is left at bedtime?",
      "inputs": {
        "dose_mg": 300,
        "hours_before_bed": 8
      },
      "answer": {
        "mg_at_bedtime": 113,
        "over_sleep_threshold": true,
        "hours_to_sleep_threshold": 9
      }
    },
    {
      "question": "How many cups of drip coffee is the 400 mg daily guidance?",
      "inputs": {
        "mg": 400
      },
      "answer": {
        "cups_of_drip_coffee": 4.2
      }
    }
  ],
  "limits": [
    {
      "limit": "No absorption phase",
      "detail": "The model treats a dose as fully present the moment it is drunk. Real absorption peaks at roughly 30–60 minutes, so the first hour after a drink is the one place the curve is meaningfully wrong — it overstates. It is also the hour nobody asks about, which is why the app and this site both use the simpler form."
    },
    {
      "limit": "The half-life is a population average",
      "detail": "Individual values run from roughly 1.5 to over 10 hours. Smoking roughly halves it; pregnancy can double or triple it; oral contraceptives, some antidepressants and liver conditions lengthen it; CYP1A2 genotype splits people into fast and slow metabolisers. Treat the 5.7-hour figure as the starting point a person tunes from their own experience, which is why the range is published as a constant."
    },
    {
      "limit": "The 100 mg sleep threshold is a rule of thumb, not a clinical boundary",
      "detail": "It is a usable line for \"enough left to matter at bedtime\", not a measured point at which sleep is disturbed. Sensitivity varies enormously and some people are unaffected at levels that keep others awake."
    },
    {
      "limit": "The 400 mg daily figure is for healthy adults",
      "detail": "It is FDA and EFSA general guidance. It does not apply to children or adolescents, and pregnancy guidance is a separate, lower figure. Both are published as constants above."
    },
    {
      "limit": "Milligram inputs are estimates",
      "detail": "Whatever the model does with them, the number going in is a labelled-serving estimate. A \"medium coffee\" varies by more between two shops than most of the rows in the dataset differ from each other."
    }
  ],
  "refusals": {
    "medical": "This is arithmetic on population-average pharmacokinetics, not medical advice. It does not account for medication, pregnancy, liver conditions, heart conditions or age, and it must not be used to decide whether caffeine is safe for a particular person.",
    "dose": "Nothing here recommends an amount of caffeine to take. It reports how much of a dose someone has already had is still present, and what published guidance says.",
    "children": "No published daily figure on this site applies to children or adolescents; the 400 mg FDA reference is for healthy adults. Paediatric guidance is a clinician's question.",
    "measurement": "Caffeine values are public-source estimates for a labelled serving, not measurements of the cup in front of you. Brewing, bean, steeping time and cup size move a coffee figure by more than the difference between many of the entries in the dataset."
  },
  "implementations": {
    "engine_module": "https://trackcaffeine.com/api/v1/model.json",
    "browser_calculators": "https://trackcaffeine.com/tools/",
    "mcp": "https://trackcaffeine.com/mcp",
    "note": "The browser calculators, the figures on the drink pages, these endpoints and the MCP tools all run one JavaScript module. A figure from any of them cannot differ from a figure from another, because there is nothing left to disagree."
  }
}
