Caffeine & Sleep
Matthew Walker's caffeine rule is a curfew: stop about 8 to 10 hours before bed, because caffeine lingers far longer than you feel it. This is his stated practical position rather than a trial result. For what sleep labs have measured directly across doses and timings, see our caffeine and sleep explainer.
Know caffeine's real timeline Mean half-life about 5 hours, but it ranges from 1.5 to 9.5 hours between people
If your own half-life sits at the long end of that range, a coffee at noon can still be working at midnight. Caffeine outstays its welcome by hours, and by a different number of hours for each person.
Set a caffeine curfew Stop ~8 to 10 hours before bed (early afternoon for most)
This keeps the lingering quarter-life from eating into your night. If you go to bed around 10:30pm, that means last caffeine around midday to early afternoon.
Keep the dose modest and morning-only 1 to 3 cups, in the morning
Walker's rule of thumb: enjoy coffee, but front-load it and cap it. The dose and the timing make the poison.
Switch the afternoon cup to decaf Decaf or half-caf after your curfew
Walker notes the health benefits of coffee come largely from its antioxidants, not the caffeine, and decaf keeps most of those. It lets you keep the ritual without the sleep cost.
Don't trust 'I sleep fine on coffee' Judge deep sleep, not just falling asleep
Many people fall asleep after an evening coffee but still lose deep sleep quality. Sleeping through is not the same as sleeping well.
Break the caffeine dependency loop Fix timing first, then let morning need fall
Poor sleep drives more coffee, which degrades the next night, which drives more coffee. Fixing the timing breaks the loop at its source.
Caffeine's half-life averages about 5 hours, but it varies widely between people, from about 1.5 to 9.5 hours, so the same afternoon coffee can be gone by bedtime for one person and still working for another.
View sources
The Matt Walker Podcast: Sleep & Caffeine
Matthew Walker (MasterClass): the buzz on caffeine & alcohol
Caffeine for the Sustainment of Mental Task Performance (Institute of Medicine, National Academies Press, 2001)
Dose and Timing Effects of Caffeine on Subsequent Sleep: a Randomized Clinical Crossover Trial (Gardiner et al., Sleep, 2025)
The Effect of Caffeine on Subsequent Sleep: a Systematic Review and Meta-analysis (Gardiner et al., Sleep Medicine Reviews, 2023)
Not medical advice. This page is for education only and is not a substitute for professional medical care. Consult a qualified clinician before changing your health routine.
Independent curation. YourProtocol is an independent platform. This protocol is based on the publicly available work of Matthew Walker and is not created, reviewed, endorsed by, or affiliated with Matthew Walker or UC Berkeley.
Is this for you
- Afternoon coffee drinkers who don't fall asleep well
- People who 'sleep fine' on caffeine but wake unrefreshed
- Anyone stuck in the more-coffee, worse-sleep loop
- Ritual lovers who want to keep the cup without the cost
Cautions
- Caffeine sensitivity varies widely between people, and the measured half-life ranges from 1.5 to 9.5 hours, so some people need a much earlier curfew than others. How much of that variation is genetic is not settled: for sleep specifically, the two largest genetic studies did not find the CYP1A2 link that consumer gene tests sell.
- Don't quit caffeine abruptly if you drink a lot; taper to avoid headaches.
- This is about sleep quality, not a medical claim; if you have a heart or anxiety condition, follow your physician's caffeine guidance.
- Educational only, not medical advice.
- Cafe Don Pablo