Take your last caffeine about eight hours before bed: a third of it is still in you, 32 mg of a mug of filter coffee and 68 mg of a 200 mg dose.
After 8 hours 34 percent of a dose is left for a 5-hour half-life, so a mug of filter coffee (95 mg) leaves 32 mg and a 200 mg dose leaves 68 mg. In a small study of 12 people, 400 mg taken six hours before bed cut the measured sleep by more than an hour, and they did not notice it.
For someone who clears caffeine slowly (a half-life of 10 hours) the same mug leaves 55 mg after 8 hours. It is a rule of thumb for an average sleeper, not a promise of good sleep: sensitivity to caffeine varies widely, and the study was small.
Estimate with the rule, then check it against the calculator that models it properly.
Open Caffeine Curve →