Some people finish a coffee after lunch and sleep like a rock. Others take one sip past noon and stare at the ceiling until 2am. Blame CYP1A2, the liver enzyme that decides how fast caffeine actually leaves your bloodstream, and one that runs at wildly different speeds depending on whose body it's sitting in.
What the newest dose-and-timing trial found
A 2024 randomized, placebo-controlled crossover trial gave healthy adults either 100mg or 400mg of caffeine (or a placebo) at 4, 8, or 12 hours before bedtime, then measured their sleep with polysomnography, the same setup used in sleep labs.1 The 100mg dose, roughly one regular coffee, barely moved the needle at any timing tested, even taken just 4 hours before bed. The 400mg dose (about four coffees, or one large energy drink) was a different story. Taken 4 hours before bed, it added 14 minutes to how long it took to fall asleep, cut total sleep by about 50 minutes, and trimmed nearly 30 minutes off deep sleep.
The strange part is what happened at 12 hours out. That same 400mg dose, consumed a full 12 hours before bedtime, was still cutting deep sleep by around 20 minutes. Not the same size effect as taking it right before bed, but not nothing either. Dose mattered more than the clock.
Dose mattered more than the clock.
Why your liver is the real clock
The reason a single cutoff time can't work for everyone is genetic, not a matter of willpower. One liver enzyme, CYP1A2, handles the large majority of caffeine clearance, and a common variant in the gene that codes for it splits people into two rough groups.2 "Fast" metabolizers clear caffeine with a half-life of around 2 to 4 hours. "Slow" metabolizers, roughly half the population, can take 8 hours or longer to clear the same half. That's not a small gap. It means the same 3pm coffee can be fully cleared from a fast metabolizer's system by bedtime, and still be half-present in a slow metabolizer's bloodstream at midnight.
Milligrams matter more than minutes
Count the dose, not the cup. A 250ml drip coffee runs around 95mg of caffeine, an espresso shot around 63mg, and a can of energy drink can be anywhere from 80mg to over 300mg depending on the brand. Two "coffees" can mean two very different caffeine loads.
Treat 400mg as the number to watch, especially late in the day. The trial found 100mg barely registers even close to bedtime, while 400mg disrupts sleep at every timing tested, including 12 hours out. If your afternoon and evening drinks add up past that, timing alone won't save you.
If wired evenings or jittery afternoons are already a pattern for you, assume you're a slow metabolizer. You don't need a genetic test to act on this. Being unusually sensitive to a normal dose is itself the signal.
Stack your doses mentally, not just your cups. A coffee at 10am and another at 2pm isn't two small, separate doses by the time evening rolls around. To your bloodstream, it's closer to one larger one that hasn't finished clearing.
If your evenings already feel wired
This doesn't mean caffeine is harmless right up until lights out. It means the number on your cup matters more than the number on the clock, and your own CYP1A2 is running the real math regardless of what a fixed cutoff time claims. If one afternoon coffee already keeps you staring at the ceiling, that's a direct signal worth trusting. Pay attention to what your own evenings are actually telling you.
Sources
-
Gardiner, C., Weakley, J., Burke, L.M., et al. (2024). "Dose and timing effects of caffeine on subsequent sleep: a randomised clinical crossover trial." Sleep, 48(4), zsae230. doi.org/10.1093/sleep/zsae230 ↩
-
Nehlig, A. (2018). "Interindividual Differences in Caffeine Metabolism and Factors Driving Caffeine Consumption." Pharmacological Reviews, 70(2), 384-411. doi.org/10.1124/pr.117.014407 ↩