By Small Hours · Last reviewed

Caffeine can still disturb sleep many hours after your last cup. In a home trial, 400 mg of caffeine, which the authors call a moderate dose, taken even 6 hours before bedtime measurably disturbed sleep, and a pooled analysis of 24 studies estimates that a single coffee would need a gap of nearly 9 hours to avoid losing any sleep time. [1][2] How long it lasts for you depends on you, and the research cannot tell you your own number.
What the research says
Caffeine reaches further into the night than most people assume. In a home trial, 400 mg of caffeine taken 0, 3 or 6 hours before bedtime disturbed sleep at every timing; the authors concluded that even the 6-hour gap had important disruptive effects. [1] Pooling 24 studies, caffeine cut total sleep by about 45 minutes and sleep efficiency (the share of time in bed spent asleep) by about 7%, added about 9 minutes to falling asleep and 12 minutes awake in the night, and traded deep sleep for light. From those averages, a single coffee needs a gap of about 8.8 hours to avoid losing sleep time. [2] In a 2025 trial of 23 men, 100 mg made no significant difference, while 400 mg delayed sleep onset within 12 hours of bed and fragmented sleep within 8 hours. Yet the men rated their sleep worse only in the 4-hour condition, so people may not notice caffeine's effect. [3] In plain terms, an afternoon coffee can still be working at bedtime, unnoticed.
The studies behind this
- Home trial (Drake, 2013): caffeine (400 mg) or placebo was taken 0, 3 or 6 hours before each person's usual bedtime, and sleep was recorded with a portable monitor and a diary. All three caffeine times disturbed sleep compared with placebo. The authors concluded that caffeine 6 hours before bed has important disruptive effects. [1]
- Pooled analysis (Gardiner, 2023): across 24 studies, caffeine cut total sleep time by about 45 minutes and sleep efficiency (the share of time in bed spent asleep) by about 7%. It added about 9 minutes to falling asleep and about 12 minutes awake in the night. Light sleep rose and deep sleep fell. [2]
- Timing estimate from the same analysis: to avoid losing total sleep time, the authors estimated a coffee (about 107 mg per 250 mL) should be drunk at least 8.8 hours before bedtime. [2]
- Dose and timing trial (Gardiner, 2025): 23 men with moderate habitual intake took placebo, 100 mg or 400 mg of caffeine 12, 8 or 4 hours before bed. The 100 mg dose did not significantly change sleep. The 400 mg dose delayed sleep onset when taken within 12 hours of bed, and fragmented sleep when taken within 8 hours. [3]
- A gap between feeling and measuring: in that trial, people rated their sleep quality as worse only for the 4-hour condition, even though recordings showed effects at longer gaps. The authors suggest people may not notice caffeine's effect on their own sleep. [3]
Why does it last so long?
Caffeine acts partly by blocking receptors for adenosine, a brain chemical involved in regulating sleep. [4][5] The body clears caffeine gradually. Its half-life is the time it takes to clear half of what is in your blood.
Half-life is not fixed. In one small study, women taking low-dose oestrogen contraceptives had an average caffeine half-life of about 7.9 hours, compared with about 5.4 hours in matched women not taking them. [6] That is one example of how the same cup can behave differently from person to person.
Why do people react so differently?
- Genes. A common variant in the adenosine A2A receptor gene differed between people who rated themselves caffeine-sensitive and those who did not, and it predicted how closely caffeine's effect on brain activity during sleep resembled the pattern seen in insomnia. [5]
- Age. A systematic review found that the sleep of older adults may be more sensitive to caffeine than that of younger adults, though most studies were in male adults in Western countries. [4]
- Habit and body chemistry. Reviews describe pronounced individual differences, so an average gap from a trial may be too short for some people and unnecessary for others. [2][4]
What about the "sleep hygiene" advice to cut caffeine?
Sleep hygiene means general habits such as caffeine timing and bedroom conditions. The American Academy of Sleep Medicine guideline suggests clinicians not rely on sleep hygiene advice alone to treat chronic insomnia. [7] Caffeine is one piece of a larger picture, not a stand-alone cure. We explain why sleep hygiene on its own is usually not enough, and alcohol has a similar double edge, covered in alcohol and sleep.
Where the evidence is thin
- Most trials used healthy volunteers, many of them young men, and some used large single doses. Effects in women, in older adults and at everyday doses are less certain. [3][4]
- The pooled timing estimates (such as 8.8 hours) come from averages across studies that differ in design. They are a guide, not a rule for any one person. [2]
- The 2013 home trial used a fixed dose of 400 mg, so it does not tell us what a single small cup does. [1]
- The contraceptive study was small and from 1985. [6]
Where does this leave you?
The research explains why a late-afternoon coffee can still be in play at bedtime, and why your friend's cut-off may not suit you. If trouble sleeping has gone on for months, caffeine is rarely the whole story, and the treatment guidelines point first to CBT-I, a structured program for insomnia. Small Hours covers caffeine inside its six-week program, and its nightly diary lets you tick caffeine on the nights it came up, so you can watch your own pattern instead of a study average. You can sign up at trysmallhours.com.
When should you talk to a doctor?
- Trouble sleeping that lasts months, even after you cut back on caffeine.
- A racing heart, anxiety or tremor after caffeine. Ask about your own caffeine intake and any medicines you take.
- Loud snoring, breathing pauses, or heavy daytime sleepiness.
General education, not medical advice.
References
- 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. Source for reference 1 (opens in a new tab)
- Gardiner C, Weakley J, Burke LM, Roach GD, Sargent C, Maniar N, Townshend A, Halson SL. The effect of caffeine on subsequent sleep: a systematic review and meta-analysis. Sleep Med Rev. 2023;69:101764. Source for reference 2 (opens in a new tab)
- Gardiner CL, Weakley J, Burke LM, Fernandez F, Johnston RD, Leota J, Russell S, Munteanu G, et al. Dose and timing effects of caffeine on subsequent sleep: a randomized clinical crossover trial. Sleep. 2025;48(4):zsae230. Source for reference 3 (opens in a new tab)
- Clark I, Landolt HP. Coffee, caffeine, and sleep: a systematic review of epidemiological studies and randomized controlled trials. Sleep Med Rev. 2017;31:70-78. Source for reference 4 (opens in a new tab)
- Rétey JV, Adam M, Khatami R, Luhmann UF, Jung HH, Berger W, Landolt HP. A genetic variation in the adenosine A2A receptor gene (ADORA2A) contributes to individual sensitivity to caffeine effects on sleep. Clin Pharmacol Ther. 2007;81(5):692-698. Source for reference 5 (opens in a new tab)
- Abernethy DR, Todd EL. Impairment of caffeine clearance by chronic use of low-dose oestrogen-containing oral contraceptives. Eur J Clin Pharmacol. 1985;28(4):425-428. Source for reference 6 (opens in a new tab)
- Edinger JD, Arnedt JT, Bertisch SM, et al. Behavioral and psychological treatments for chronic insomnia disorder in adults: an American Academy of Sleep Medicine clinical practice guideline. J Clin Sleep Med. 2021;17(2):255-262. Source for reference 7 (opens in a new tab)
This article is general education, not medical advice. It cannot diagnose anything or replace a conversation with your doctor. Read how we choose and check sources on the how we write page.