Caffeine Curve

Drag the cups along the axis, or edit them below, and watch how much caffeine is still in you at bedtime. The model is the standard one-compartment pharmacokinetic curve, with your own half-life.

A recreation of Charles Postiaux's "Caffeine consumption for optimal sleep". The concept, design and interaction are his; this page was rebuilt with Claude (Fable 5.1) to test what the model could reproduce from his demo.

Peak —
At bedtime —
Under threshold from —
Last cup by —

Caffeine in your body, mg

Drag a cup to move it · arrow keys nudge a focused cup by 5 min

Cups

You

How it is calculated

Each cup follows the Bateman curve: first-order absorption (rate 2.8 /h, so about 15 minutes to absorb half a cup) and first-order elimination at the rate set by your half-life. The curves add up. "Last cup by" moves the latest cup, keeping the others fixed, to the latest time that keeps you under the threshold through the night.

Half-life varies more between people than anything else here. The 5-hour figure is a population average; measured values run from roughly 2 to 10 hours in healthy adults, shorter in smokers, longer with oral contraceptives, in late pregnancy, and with some antidepressants and antibiotics. The threshold is a rule of thumb, not a tested cutoff: a 2023 meta-analysis (Gardiner et al., Sleep Medicine Reviews) found that a ~107 mg coffee taken within 8.8 hours of bedtime, or ~217 mg within 13.2 hours, measurably shortens sleep. None of this is medical advice.

Original concept and design: Charles Postiaux (his demo, 9 November 2026). This page is an unaffiliated recreation built with Claude (Fable 5.1) as a test; the numbers it produces were checked against the ones visible in his video. The US Army's 2B-Alert Web is the research-grade tool for alertness-optimised dosing.

Table of values by hour