Caffeine and Sleep
Caffeine keeps working long after the cup is empty, and most people underestimate how long.
Finish a typical cup of coffee at least 8.8 hours before bed, the cutoff suggested by a meta-analysis of 24 studies that found caffeine cut total sleep by about 45 minutes and cut into deep sleep.1 The effect lasts longer than most people expect: in a laboratory study, caffeine taken six hours before bed still cost more than an hour of sleep without the sleepers noticing.2 Sensitivity varies widely from person to person.3 Relying on caffeine to get through days despite enough sleep is worth taking seriously in its own right.4
The effects show up across the whole night. Pooling 24 studies, researchers found that caffeine reduced total sleep by about 45 minutes and sleep efficiency by 7%, added about 9 minutes to the time it took to fall asleep and 12 minutes of time awake after first falling asleep, and reduced deep sleep by about 11 minutes.1
Longer than the alert feeling lasts. In a laboratory study, healthy sleepers took 400 mg of caffeine, about the amount in two to three large cups of coffee,3 at bedtime, three hours before bed or six hours before. Even at six hours, total sleep measured overnight fell by more than an hour. The participants’ own reports suggested they had not noticed.2
That gap between what happens and what you feel is why caffeine is easy to overlook as a cause of poor sleep.
The meta-analysis put numbers on the cutoff. To avoid losing sleep, the authors advised finishing a typical cup of coffee, about 107 mg, at least 8.8 hours before bed, and a typical pre-workout supplement, about 217 mg, at least 13.2 hours before.1
In practice. For a 10 p.m. bedtime, that means the last coffee by about 1 p.m., and a pre-workout drink before about 9 a.m.1
| Bedtime | Last coffee by about | Last pre-workout drink by about |
|---|---|---|
| 10 p.m. | 1 p.m. | 9 a.m. |
| 11 p.m. | 2 p.m. | 10 a.m. |
| Midnight | 3 p.m. | 11 a.m. |
For night shifts. The same logic applies in reverse: caffeine early in the shift supports alertness, while caffeine late in the shift eats into the daytime sleep that follows.2,5 See the shift worker’s survival guide.
The FDA notes wide variation both in how sensitive people are to caffeine and in how fast they clear it from the body.3 Two people can drink the same afternoon coffee and only one of them lies awake at midnight. The cutoffs above are averages drawn from many studies; your own may be earlier.
A practical test. Move your last caffeinated drink two or three hours earlier for two weeks and keep a simple sleep log. If sleep improves, the old cutoff was too late for you.
Used on purpose, caffeine has a place in good sleep habits rather than against them.
Before a short nap. Caffeine taken just before a nap of about 20 minutes has been shown to reduce the grogginess on waking, because it starts working as you come round.6 See the science of napping.
After crossing time zones. Caffeine helps with daytime alertness at the destination; the CDC advises stopping six hours before the new bedtime.7 See managing jet lag.
Early in a night shift. Alertness support at the start of the shift, not in the last hours before daytime sleep.2,5
Stopping abruptly can produce withdrawal. Across controlled studies, symptoms included headache, fatigue, low energy, drowsiness, difficulty concentrating and a foggy feeling. They typically began 12 to 24 hours after the last dose, peaked between 20 and 51 hours, and lasted two to nine days. Headache occurred in about half of people, and withdrawal appeared after daily intakes as low as 100 mg.8
Taper instead. The FDA notes that withdrawal is not dangerous but can be unpleasant, and recommends cutting back gradually.3 Trimming one drink every few days, or switching some cups to half-caffeinated, spreads the adjustment out.
Move before you cut. Because timing drives so much of the sleep cost, moving the same amount earlier in the day is a sensible first step.1
Caffeine is a reasonable tool for a short night. It becomes a warning sign when it is the only thing holding the day together: when you rely on it despite getting seven or more hours, or when you still doze off in quiet moments.4,9
Persistent sleepiness despite enough sleep is a symptom with findable causes, including sleep apnea and disorders of the brain’s sleep-wake system.4 What is excessive daytime sleepiness? explains the common ones.
If you need caffeine to stay awake despite enough sleep, an evaluation can identify treatable causes.
- Gardiner C, Weakley J, Burke LM, et al. The effect of caffeine on subsequent sleep: a systematic review and meta-analysis. Sleep Med Rev. 2023;69:101764. doi:10.1016/j.smrv.2023.101764 https://doi.org/10.1016/j.smrv.2023.101764
- Drake C, Roehrs T, Shambroom J, Roth T. Caffeine effects on sleep taken 0, 3, or 6 hours before going to bed. J Clin Sleep Med. 2013;9(11):1195-1200. doi:10.5664/jcsm.3170 https://doi.org/10.5664/jcsm.3170
- US Food and Drug Administration. Spilling the beans: how much caffeine is too much? Consumer update. August 28, 2024. https://www.fda.gov/consumers/consumer-updates/spilling-beans-how-much-caffeine-too-much
- Gandhi KD, Mansukhani MP, Silber MH, Kolla BP. Excessive daytime sleepiness: a clinical review. Mayo Clin Proc. 2021;96(5):1288-1301. doi:10.1016/j.mayocp.2020.08.033 https://doi.org/10.1016/j.mayocp.2020.08.033
- Morgenthaler TI, Lee-Chiong T, Alessi C, et al. Practice parameters for the clinical evaluation and treatment of circadian rhythm sleep disorders. Sleep. 2007;30(11):1445-1459. doi:10.1093/sleep/30.11.1445 https://doi.org/10.1093/sleep/30.11.1445
- Hilditch CJ, McHill AW. Sleep inertia: current insights. Nat Sci Sleep. 2019;11:155-165. doi:10.2147/NSS.S188911 https://doi.org/10.2147/NSS.S188911
- Riedy SM, Williams SG. Jet lag disorder. In: CDC Yellow Book: Health Information for International Travel. Centers for Disease Control and Prevention. Updated April 23, 2025. Accessed October 5, 2026. https://www.cdc.gov/yellow-book/hcp/travel-air-sea/jet-lag-disorder.html
- Juliano LM, Griffiths RR. A critical review of caffeine withdrawal: empirical validation of symptoms and signs, incidence, severity, and associated features. Psychopharmacology (Berl). 2004;176(1):1-29. doi:10.1007/s00213-004-2000-x https://doi.org/10.1007/s00213-004-2000-x
- Watson NF, Badr MS, Belenky G, et al. Recommended amount of sleep for a healthy adult: a joint consensus statement of the American Academy of Sleep Medicine and Sleep Research Society. J Clin Sleep Med. 2015;11(6):591-592. doi:10.5664/jcsm.4758 https://doi.org/10.5664/jcsm.4758