How Late Can You Drink Coffee Before Bed?
How late you can drink coffee depends more on how much than on what time. In a 2025 sleep-lab crossover in 23 healthy young men, 100 mg, about one small coffee, had no significant effect on measured sleep at any timing tested, including four hours before bed. 400 mg four hours before bed cost 50.6 minutes of sleep.
Stop treating 5 hours as your personal number Across healthy adults the measured half-life of caffeine spans 1.5 to 9.5 hours, around a mean of about 5. Two people drinking the same cup at the same hour can be in genuinely different situations at bedtime.
Every tidy cutoff rule you have read silently assumes one shared half-life. The spread is the reason those rules disagree with each other and with people's experience. EVIDENCE TIER A.
Compare the two doses before you compare the two times 23 healthy young men, double-blind crossover, sleep measured by polysomnography, caffeine given 12, 8 and 4 hours before bed at 100 mg and 400 mg. At 100 mg there was no significant effect on objective or subjective sleep at any timing tested. At 400 mg four hours before bed, sleep onset latency rose 14.2 minutes (p=0.013) and total sleep time fell 50.6 minutes (p<0.001). At 400 mg twelve hours before bed, latency to persistent sleep still rose 15.3 minutes (p=0.020).
Same people, same clock positions, opposite outcomes depending only on the dose. Note also that 400 mg still cost something at twelve hours out, so this is not an argument that timing is irrelevant. EVIDENCE TIER B: one crossover trial, n=23, and the participants were all men, so it has not been tested this way in women.
Judge caffeine by what is measured, not by whether you felt it 12 adults, randomized double-blind double-dummy placebo-controlled crossover, 400 mg, sleep measured by EEG. Total sleep time fell by about 1.1 to 1.2 hours at every timing tested, including six hours before bed. At six hours out the participants' own sleep diaries showed a 41 minute reduction that only approached significance (p=0.08), while the electrodes detected the loss.
The gap between the electrodes and the diary is the practical point: people under-report what a large late dose costs them. EVIDENCE TIER B: n=12. DISCLOSURE: this study was funded by an investigator-initiated grant from Zeo Inc, whose sleep-monitoring headband was used, and a co-author was Zeo's Vice President of Scientific Affairs. We think the finding stands, and you should know who paid for it.
Know the typical cost across studies Pooling 24 studies: total sleep time down about 45 minutes, sleep efficiency down about 7%, deep sleep down about 11.4 minutes on caffeine nights.
This is the best summary figure available, and it is also where the widely shared "stop 8.8 hours before bed" line comes from. That figure is an extrapolation from a meta-regression, not a condition anyone tested, and the same lead author's 2025 trial found 100 mg late did nothing measurable. Treat 8.8 hours as an illustration, not a rule. EVIDENCE TIER A for the pooled effect; the 8.8 hour cutoff is deliberately not published here as a rule.
Estimate your real load before you change your timing Reference values: brewed coffee is about 95 mg per 8 fl oz cup, and a 1 fl oz espresso shot about 63 mg (USDA FoodData Central, FDC IDs 171890 and 171891). Measured specialty coffees ranged from 58 to 259 mg per dose, and averaged 188 mg (SD 36) per 16 oz cup. When researchers bought the same beverage from the same outlet on six consecutive days, that one drink alone ranged from 259 to 564 mg.
A more than twofold swing in the same drink from the same place, across six days. If you are aiming at a dose, a large takeaway coffee or a scooped pre-workout is a guess, not a measurement. EVIDENCE TIER A.
Understand the mechanism, so the dose logic makes sense Adenosine accumulates through the day and is the signal that builds sleep pressure. Caffeine is an adenosine receptor antagonist: it occupies the receptor so the signal does not land. Of caffeine's known biochemical actions, only adenosine receptor inhibition occurs at normal human consumption levels.
Receptor occupancy is dose dependent, which is the mechanistic reason a small late dose can be unremarkable while a large one is not. EVIDENCE TIER A.
Treat the CYP1A2 gene claim for sleep as unproven An adult literature does suggest that variants in the adenosine receptor gene (ADORA2A) and the liver enzyme gene (CYP1A) correlate with caffeine-associated sleep disturbance. The two largest sleep-specific tests did not find the CYP1A2 link. A genome-wide study of 2,402 people implicated ADORA2A and reported no CYP1A2 association with the sleep phenotype. A study of 6,112 young people reports that neither ADORA2A nor CYP1A genetic variants were associated with sleep quality, duration, or caffeine dose, and that genotype by caffeine dose interactions were not detected.
The claim that CYP1A2 slow metabolisers get worse sleep from caffeine is sold hard by consumer genetics marketing, and the two biggest sleep-specific tests are negative. If genetics matters here at all, the signal so far is at the receptor, not the liver enzyme. EVIDENCE TIER A for the null findings.
Judge caffeine by the dose currently in you No study has measured a repayment event after caffeine, and no trial has ever moved people's last dose earlier and measured how fast their sleep recovered, so we do not publish a recovery timeline. What has been measured runs the other way: deep sleep goes down on caffeine nights in both the 2023 pooled analysis and the 2025 trial. In a 10-day polysomnography study in 20 healthy young men, neither total sleep time, sleep latency, sleep architecture nor subjective sleep quality differed between placebo, caffeine and caffeine-withdrawal conditions.
People are often told caffeine borrows sleep pressure and that a rebound night pays it back. Nobody has measured that event. The honest version is simpler: the effect tracks the dose currently in you. EVIDENCE TIER A for the absence of evidence, B for the null result (n=20, men only).
Find your largest dose of the day, not your first one If your biggest serve, a large takeaway coffee, an energy drink or a scooped pre-workout, lands within about nine hours of bedtime, either move it earlier or halve it. Leave the morning cup alone. Then log the time you actually fell asleep, not the time you got into bed, for seven nights.
Dose is the variable the trials moved, and the biggest dose is the one most likely to be doing something. Logging sleep onset rather than bedtime is what makes the change visible to you, given how badly self-report tracked the objective loss in the Drake data.
Caffeine works by blocking adenosine, the molecule that builds sleep pressure through the day; of caffeine's known biochemical actions, only adenosine receptor inhibition happens at normal human consumption.
View sources
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)
Caffeine Effects on Sleep Taken 0, 3, or 6 Hours Before Going to Bed (Drake et al., J Clin Sleep Med, 2013)
The Effect of Caffeine on Subsequent Sleep: a Systematic Review and Meta-analysis (Gardiner et al., Sleep Medicine Reviews, 2023)
Caffeine Content of Specialty Coffees (McCusker, Goldberger & Cone, J Anal Toxicol, 2003)
Adenosine, Caffeine, and Sleep-Wake Regulation (Reichert, Deboer & Landolt, J Sleep Res, 2022)
Actions of Caffeine in the Brain (Fredholm et al., Pharmacological Reviews, 1999)
A Genome-wide Association Study of Caffeine-Related Sleep Disturbance (Byrne et al., Sleep, 2012)
Caffeine Consumption, Genetic Variation and Sleep in Adolescents (Jessel et al., Genes, 2023)
Caffeine-Dependent Changes of Sleep-Wake Regulation (Weibel et al., Scientific Reports, 2021)
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.
Editorial disclosure. This protocol is written and fact-checked by the YourProtocol editorial team directly from the primary sources cited below; it is not written or reviewed by any outside expert.
Is this for you
- Anyone who has been told to stop caffeine at a fixed hour and found it did not help
- Big-serve coffee, energy drink and pre-workout users
- People who fall asleep fine after caffeine and still wake unrefreshed
- Anyone sold a caffeine gene test
Cautions
- Caffeine timing is about sleep quality, not a medical claim; if you have a heart, blood-pressure or anxiety condition, follow your clinician's caffeine guidance
- Do not stop a heavy caffeine habit abruptly; taper
- The two direct dose-and-timing trials here are small (12 and 23 participants) and the 23-participant trial enrolled men only, so none of this has been tested this way in women
- If you are pregnant, trying to conceive or breastfeeding, caffeine guidance is different and lower than anything on this page; follow your own clinician's or midwife's advice
- Educational only, not medical advice