# Caffeine and Sleep: What the Research Says About Timing

Published 2026-11-19, updated 2026-11-19. Online at https://thenuttracker.com/blog/caffeine-and-sleep-what-research-says-about-timing

Caffeine's half-life is about 5 to 6 hours, longer in some people. In small trials, a large 400 mg dose cut measured sleep even 6 hours before bed, while a 100 mg dose, about one cup, did not.

The coffee is at 3 p.m. and the ceiling-staring is at 1 a.m., and your brain may or may not have filed those under the same case. Sleep researchers have tried to separate them with clocks, pills and home sleep monitors. Here is what two small trials and one review measured, and where they stop. More on sleep and the rest of the body lives in the [body and mood](/blog/category/body-and-mood) archive.

## How long does caffeine stay in your body?

Its half-life is about 5 to 6 hours, and much longer in some people. That is the figure the US workplace safety agency NIOSH gives in its [guide to preparing for sleep](https://www.cdc.gov/niosh/work-hour-training-for-nurses/longhours/mod6/04.html).

Half-life is the time the body needs to clear half of what you took. If a cup at 3 p.m. has a 5 hour half-life, about half of it is still around at 8 p.m., and about a quarter at 1 a.m. That is arithmetic, not a measurement of anyone's sleep. NIOSH's advice is to avoid caffeine for several hours before sleep, according to individual sensitivity.

## What happened when people took caffeine 0, 3 or 6 hours before bed?

All three timings cut measured sleep. In a [2013 crossover trial](https://pmc.ncbi.nlm.nih.gov/articles/PMC3805807/), 12 healthy adults aged 19 to 48 each received 400 mg of caffeine in a pill, or a placebo, at bedtime, 3 hours before, or 6 hours before. They slept at home wearing a headband EEG monitor and also kept a sleep diary.

| Caffeine timing | Measured total sleep time | What the diary caught |
|---|---|---|
| At bedtime | Down about 1.1 to 1.2 hours | Disruption detected |
| 3 hours before | Down about 1.1 to 1.2 hours | Disruption detected |
| 6 hours before | Down about 1.1 to 1.2 hours | A 41 minute drop, not statistically significant (p = 0.08) |

The 6 hour row is the one to look at. The monitor picked up the loss, and the diary mostly did not. The authors concluded that caffeine 6 hours before bed has important disruptive effects, and supported avoiding substantial caffeine for at least 6 hours.

They also listed their own limits: a small sample, no blood caffeine levels, and young to middle-aged moderate caffeine users.

## Does the dose matter as much as the clock?

Yes, in the one trial that tested it. A [later crossover trial](https://pmc.ncbi.nlm.nih.gov/articles/PMC11985402/) gave 23 healthy young men placebo, 100 mg or 400 mg of caffeine, 4, 8 or 12 hours before bedtime. Researchers described 100 mg as about one cup of coffee and 400 mg as a high dose, the upper recommended daily limit.

- **100 mg:** no significant effect on measured or reported sleep at any timing, even 4 hours before bed.
- **400 mg, 4 hours before:** total sleep time down 50.6 minutes and sleep efficiency down 9.5%.
- **400 mg, 8 hours before:** 29.1 more minutes awake during the night.
- **400 mg, 12 hours before:** 15.3 minutes longer to fall asleep and 20.6 fewer minutes of deep sleep.

So the 400 mg doses in both trials show what a large dose does, not what an ordinary morning cup does. The 12 hour result also hints that effects can land in parts of the night people don't notice.

## Can you tell when caffeine is hurting your sleep?

Often you cannot. In the second trial, perceived sleep quality was not significantly reduced at 8 or 12 hours, even though measured sleep was. Only 22% of participants correctly identified both the dose and the timing they had received. In the first trial, the diary missed the 6 hour effect that the monitor caught.

That cuts both ways: a bad night is not proof caffeine did it, and a fine-feeling night does not prove it had no effect. It is also one reason to read your own numbers with care, as with [how accurate sleep trackers are](/blog/sleep-tracker-accuracy-what-validation-studies-found).

## What can these studies not tell you?

Not much about you specifically. Participants were small groups of healthy, young to middle-aged, moderate caffeine users, and the second trial was all men. Each condition was one night. The second trial's authors noted that they collected gene data but were not powered to test genetic effects.

A [systematic review of caffeine before late afternoon and evening training](https://pmc.ncbi.nlm.nih.gov/articles/PMC12473705/) is similarly cautious. Pooling four randomized trials, mostly of male athletes, it found total sleep time 32.5 minutes lower, which was not statistically significant, and rated the certainty of the evidence low to very low. Your own sensitivity, your habits and your [chronotype](/blog/what-is-chronotype-morning-lark-night-owl-research) all sit outside what any of this measured.

## Tracking it yourself

A log can show your own pattern, which no trial can. Four entries are enough: the time of your last caffeine, roughly how much, when you went to bed, and how the night felt. Fill them in the same day, because memory smooths things over, as [diary studies show](/blog/daily-log-vs-recall-accuracy-what-diary-studies-show).

After a few weeks, compare nights with an early last cup against nights with a late one. Treat it as a pattern to notice, not a verdict, and the same approach works for [alcohol and sleep](/blog/alcohol-and-sleep-what-research-says-about-the-night-after). If something about your sleep worries you, talk to a doctor.

In [The Nut Tracker](/), an entry can carry tags, a mood, a note and a rating, so a tag like "late coffee" can sit next to the night's note. The stats and calendar then show how the tagged days line up. The data stays on your phone, and there is no account.

## Bottom line

Caffeine's half-life is 5 to 6 hours, and in small trials large doses cut measured sleep even 6 hours before bed, while one cup did not. Those trials were small and narrow, so your own log is the better test. More reading is in the [blog](/blog).

## Questions

### How many hours before bed should I stop caffeine?

The authors of a 2013 crossover trial supported avoiding substantial caffeine for at least 6 hours before bed. A US workplace safety guide (NIOSH) says only to avoid it for several hours, according to individual sensitivity. Both are starting points to compare with your own log, not a personal answer.

### What is the half-life of caffeine?

NIOSH gives 5 to 6 hours, and notes it is much longer in some people. Half-life is the time it takes the body to clear half of what you consumed.

### Does one cup of coffee affect sleep?

In a trial of 23 healthy young men, 100 mg of caffeine, about one cup of coffee, had no significant effect on sleep even 4 hours before bedtime. A 400 mg dose did, at 4, 8 and 12 hours.

### Can I tell if caffeine is affecting my sleep?

Not always. In both trials, measured sleep and self-reported sleep did not match, and only 22% of people in the second trial correctly identified both the dose and the timing they had received.

## Sources

- [CDC NIOSH: Improving Your Sleep and Alertness, Prepare for Sleep](https://www.cdc.gov/niosh/work-hour-training-for-nurses/longhours/mod6/04.html)
- [Journal of Clinical Sleep Medicine: Caffeine Effects on Sleep Taken 0, 3, or 6 Hours before Going to Bed](https://pmc.ncbi.nlm.nih.gov/articles/PMC3805807/)
- [PubMed Central: Dose and timing effects of caffeine on subsequent sleep, a randomized clinical crossover trial](https://pmc.ncbi.nlm.nih.gov/articles/PMC11985402/)
- [PubMed Central: Caffeine before late afternoon or evening training and sleep, a systematic review with meta-analysis](https://pmc.ncbi.nlm.nih.gov/articles/PMC12473705/)
