Skip to content

Guides · Sleep and recovery

How Late Can I Drink Caffeine Before It Affects My Sleep?

Published · 8 min read

The common answer is six hours. The best-controlled trial on the question suggests that is the wrong shape of answer, because it treats timing as the variable that matters and holds dose constant.

In that trial, 100 mg of caffeine, roughly one cup of coffee, changed nothing measurable at any timing tested, including four hours before bed. And 400 mg, roughly four cups, was still measurably suppressing deep sleep when it was taken twelve hours before bed. That is a coffee at 9am showing up in a midnight sleep stage.

The men it happened to could not tell.

The numbers, and where they come from

The study is Gardiner and colleagues, published in Sleep in 2024 and carried in the April 2025 issue. It is a placebo-controlled, double-blind, randomised crossover trial, which is the design that makes it worth quoting: every participant did every condition, so each person acts as their own control.

Twenty-three healthy men aged 18 to 40 completed seven conditions each, separated by 48 hours. The conditions were a placebo control plus two doses, 100 mg and 400 mg, crossed with three timings, 12, 8 and 4 hours before their own habitual bedtime. Everyone took three identical capsules on every condition day, so nobody knew which capsule held the caffeine.

Sleep was recorded at home with a validated partial polysomnography device worn on the forehead, not a wrist tracker and not a sleep diary. Participants also rated their own sleep the next morning, which turns out to be the most interesting measurement in the study.

For scale, the trial defines 400 mg as about four standard coffees, three energy drinks, or two servings of a pre-workout.

Averaged across everyone, 400 mg against their own placebo nights:

Measured on the night 4 hours before bed 8 hours before bed 12 hours before bed
Total sleep time down 50.6 min not significant not significant
Sleep efficiency down 9.5% down 6.9% not significant
Time awake after falling asleep up 26.2 min up 29.1 min not significant
Awakenings per hour up 1.4 not significant not significant
Deep sleep, N3 duration down 29.7 min down 15.3 min down 20.6 min
Light sleep, N1 and N2 share up 5.6% not significant up 5.8%

At 100 mg, no sleep outcome moved significantly at any of the three timings.

Read the deep sleep row on its own. It is the only row that is significant at every timing, and the 12-hour figure is larger than the 8-hour one. Whatever caffeine is doing to slow-wave sleep at this dose, it does not obediently fade with the hours.

The finding that changes how you should read your own number

Three things in this trial argue against the six-hour rule as most people apply it.

Dose did more work than timing. The clean comparison is 400 mg against 100 mg at the same hour. At four hours before bed that gap was 46.2 minutes of total sleep and 33.8 minutes of deep sleep. At twelve hours before bed it was still 20.0 minutes of deep sleep. Meanwhile 100 mg produced no significant timing effect at all. A rule that tells you when to stop, without telling you how much, is answering the smaller of the two questions.

The authors' own thresholds get crossed early. They apply published clinical-significance thresholds of more than 10 minutes added sleep onset, more than 20 minutes awake after sleep onset, and more than 5% lost sleep efficiency. At 400 mg the onset threshold was exceeded within twelve hours of bedtime, and the fragmentation and efficiency thresholds within eight.

Habitual drinkers were not protected. Every participant was already a regular consumer, averaging about 112 mg a day. The disruption happened anyway. The authors are careful here: whether tolerance to caffeine's sleep effects exists in habitual consumers remains unsettled, and this trial is one line of evidence rather than the last word.

The part almost nobody measures: they could not feel it

This is the finding that should change what you do with your own tracker.

Only 44% of participants correctly identified which dose they had been given, and only 22% identified both the dose and the timing.

More precisely: objective time awake after falling asleep rose by 26 and 29 minutes at the four and eight hour conditions, and perceived time awake did not move significantly at any timing. The fragmentation was real and it was invisible from the inside.

At twelve hours before bed, nothing subjective reached significance at all. Not perceived sleep time, not perceived quality, not pre-sleep alertness. Deep sleep was still down 20.6 minutes.

So the honest version of the answer is not "stop six hours before bed". It is closer to this: at a large dose, the thing caffeine costs you late in the day is deep sleep, and deep sleep is precisely the thing you have no direct sensation of losing. If you are waiting to feel it before you change anything, you are using the one instrument this study showed does not work.

Why the average here is still not you

The trial tried to find the individual mechanism and could not.

All 23 participants were genotyped for the two variants usually invoked in this conversation, CYP1A2 rs762551 for metabolism speed and ADORA2A rs5751876 for sensitivity. There was no significant effect of either genotype on any sleep outcome. The authors are explicit that the study was not powered to detect one, and they report only that on a distribution plot, slow metabolisers and sensitive types appeared to sleep less. Appeared, with no test and no effect size behind it.

That is worth stating plainly rather than skipping, because a great deal of caffeine advice online is built on genotype claims that this trial, which actually genotyped its participants, declined to make.

Which leaves the question where it started. Caffeine's half-life is usually given as three to six hours, and the paper notes it varies substantially between people, that it lengthens with oral contraception, and that adults over 40 appear more susceptible. None of those were tested here. Twenty-three young men are not a population you can be looked up in.

What this actually means for your own data

None of this requires new equipment. It requires treating your own history as the reference.

Watch deep sleep, not the summary score. The row that moved at every timing was N3 duration. A recovery or sleep score is a blend, and a blend can hold steady while its most caffeine-sensitive component falls. If your deep sleep looks low in general, why your deep sleep might be low covers the other causes worth ruling out first.

Know what your device can and cannot see here. Consumer sleep staging is an estimate from motion and heart signals, not the forehead electrodes this trial used, and stage boundaries are where that estimate is weakest. How accurate wearable sleep stages are is the honest version of what you are looking at.

Record the dose and the clock time, because no sensor captures either. A wearable measures your body and never measures your afternoon. Two espressos at 2pm and a large filter coffee at 4pm are different exposures, and without the input written down the effect gets absorbed into your normal instead of appearing as a signal. This is the same discipline that makes testing whether a supplement is working possible at all.

Compare like with like. A high-dose day against a low-dose day, with alcohol, hard training and travel held roughly constant, or the comparison tells you nothing. Alcohol in particular hits the same early-night window and will happily take the credit.

Collect the quiet nights first. You cannot see a deviation without something to deviate from, and a baseline built on too few nights is too wide to be useful. How long until your baseline is accurate covers how many that takes.

Do not let one night decide it. One number is an observation. A pattern across several comparable nights is evidence. And a reading that disagrees with how you feel is not automatically a mistake, which is the subject of feeling tired when your score says otherwise.

What this evidence does not establish

Worth being precise about the limits, because they decide how far you can take it.

The sample is 23 healthy men aged 18 to 40. No women, so nothing here speaks to hormonal variation or to oral contraception lengthening caffeine's half-life. Nobody over 40, the group the authors say may be more susceptible.

Each condition was measured on one night, and the authors themselves say to be cautious reading sleep architecture from a single night. Diet was not standardised beyond caffeine. The previous night's sleep was not statistically accounted for. Each dose was given at a single timepoint, so this does not tell you what the same daily total does when spread across the day, which is how most people actually drink it.

And the obvious one. This describes what tends to happen to a measurement. It is not medical advice, not a diagnosis, and not guidance about your caffeine intake. If something in your data concerns you, that is a conversation for a clinician who can see the rest of your context.

The short version

At about one cup, this trial found nothing measurable at any timing. At about four cups, sleep was measurably worse when the dose landed four hours before bed, and deep sleep was still down when it landed twelve hours before bed. Perception tracked almost none of it.

So the useful question is not how late you can drink caffeine. It is how much, how late, and what it does to yours, and only the last part has to come from your own history.

NUVARD builds one live model of one person across 300 or more devices and apps, so a change gets read against your own baseline rather than a population range. It has not been released yet. Everyone gets the same access on the same day, and the waitlist gets the download link first at nuvard.ai.

Source

Gardiner CL, Weakley J, Burke LM, Fernandez F, Johnston RD, Leota J, Russell S, Munteanu G, Townshend A, Halson SL. Dose and timing effects of caffeine on subsequent sleep: a randomized clinical crossover trial. Sleep 2025;48(4):zsae230. doi:10.1093/sleep/zsae230

Join the waitlist

NUVARD provides wellness intelligence. It does not diagnose, treat, or replace medical care.

← All guides