When should you stop drinking caffeine before bed?
Your caffeine cut-off depends on the dose, your bedtime and your response. An earlier last drink gives caffeine more time to clear, but a clock time alone cannot guarantee good sleep.
Why “no coffee after 2 pm” is incomplete
For someone going to bed at 10 pm, 2 pm is eight hours earlier. For a shift worker sleeping at 9 am, the same rule describes a different part of the day. Serving size matters too: a small tea and a large energy drink may involve very different amounts.
Start with the bedtime you mean, including the date if it falls after midnight. Then look back at every dose you want to include, not just the last drink. The bedtime calculator supports explicit dates for this reason.
What six hours does and does not mean
A trial of 400 mg found sleep disruption even six hours before bedtime. It supports caution about substantial late doses, but six hours is not a biological switch after which caffeine stops affecting sleep. Drake and colleagues' trial.
For the wider picture, including research comparing different doses, read our caffeine and sleep guide. A group study cannot tell you the exact best cut-off for your own routine.
Compare an afternoon drink at two times
Imagine a 100 mg drink and an 11 pm bedtime. With a five-hour half-life assumption, consuming it at 1 pm gives 25 mg remaining at bedtime. At 6 pm, the model gives 50 mg. These are examples from the formula, not thresholds for good or bad sleep.
You can also compare amounts at the same time. Halving a modelled dose halves its remaining contribution. Moving a drink earlier and reducing its size are separate ways to change the calculation.
What if you can sleep after coffee?
The ability to fall asleep is useful context, but it is not a complete assessment of sleep quality. Log the next morning's experience too. Avoid treating a calculator result as reassurance if you are having persistent sleep difficulties.
Make your record useful
Use consistent units, check the actual caffeine per serving, and record the time. If you compare habits over several days, note other changes such as a later bedtime. The tracking guide explains how to build that record.