What the sleep studies actually found
The most-cited experiment on this question gave 400 mg of caffeine at three different times — right at bedtime, 3 hours before, and 6 hours before — and measured sleep in a lab. All three conditions disrupted sleep; even the 6-hour dose cost more than an hour of total sleep time (Drake et al., 2013, Journal of Clinical Sleep Medicine). The authors' takeaway was blunt: avoid caffeine within a minimum of 6 hours of bedtime.
A 2025 randomized crossover trial in the journal Sleep sharpened the picture by testing dose: 100 mg up to 4 hours before bed showed no significant sleep disruption, while 400 mg measurably reduced sleep even 8 to 12 hours before bedtime. Size of dose and timing interact — a morning monster is survivable, an evening one is not.
Turning research into your cutoff time
Guidelines give a floor, not a personal answer. The American Academy of Sleep Medicine's 6-hour minimum assumes an average metabolizer and a moderate dose. If you drink large coffees, metabolize slowly, or are sensitive to caffeine, your real cutoff is earlier — possibly before lunch.
A practical method: pick a residual threshold around 50 mg of bloodstream caffeine at bedtime, then back-solve using the half-life. For an average metabolizer that lands a 96 mg cup at ~3.5 hours before bed and a 190 mg cup at ~6 hours. The cutoff calculator on this site does exactly this for any drink, any half-life preset, and shows the decay curve so you can see it, not just read it.
The morning advantage is real
Sleep pressure (adenosine) is low in the morning and your cortisol rhythm naturally boosts alertness on waking, so early caffeine does the least harm and buys the least. Mid-morning to early afternoon is where caffeine gives real value; the trap window is 3 PM onward, when fatigue tempts and half-life math quietly stacks the deck against your night. If you need a 3 PM ritual, our tracker shows exactly what a decaf, a green tea, or a half-strength pour leaves in your bloodstream at lights-out.
Put it to work: cutoff calculator · daily tracker · 110-drink database