You can feel fine at bedtime and still have caffeine active in your system. Timing matters even when falling asleep does not feel difficult.
Caffeine can outlast the buzz
Caffeine blocks the tiredness signal, not the tiredness itself
Adenosine is a chemical that builds up in the brain while you are awake. More adenosine means more pressure to sleep. Caffeine works by occupying adenosine receptors, so the brain receives less of the tired signal. The tiredness is still there. It is just blocked from being felt.
When the caffeine wears off, the blocked pressure is still waiting. That is why the crash can feel sudden.
Half can still be active hours later
Caffeine half-life varies, but it is often about five to seven hours. Landolt et al. (1995) found that caffeine can reduce deep sleep even when people still fall asleep.
Half-life: the time it takes to clear half the caffeine. At 5 hours, a 3 PM coffee still has half its dose at 8 PM.
Quick check
Mechanism check
Does caffeine remove adenosine from your brain?
The tiredness you do not feel is still there. When the caffeine clears, that built-up adenosine arrives all at once.
Quick check
The 3 PM espresso
If you drink coffee at 3 PM and the half-life is 6 hours, roughly how much is still active at 9 PM?
About half the dose is still active at the 6-hour mark. That is why afternoon coffee can affect night sleep even when you feel fine at bedtime.
Try this
Start with an eight-hour buffer
Count back eight hours from bedtime. Use that as your cutoff, or choose an earlier one if caffeine tends to stay with you.
Try this
Keep the morning cup. Protect the cutoff.
You do not need a strict waiting window after waking. Keep the morning cup where it works for you, then protect the earlier cutoff before bed. Landolt et al. (1995) found that caffeine can affect deep sleep even when people still fall asleep.
Try this
Switch to half-caff or decaf in the afternoon
If a full stop feels unrealistic, switch to half-caff or decaf after midday. A smaller dose is still better than pretending the late cup is not counting.
Key idea
Give caffeine room to clear
Caffeine can be useful. Give it room to clear before bed.