Falling asleep easily does not tell you everything about coffee’s effect on your night. Dose and timing matter—and decaf offers a way to keep the cup you enjoy.
Suppose you finish dinner with an espresso. You enjoy its aroma, the slight bitterness, and the way it seems to complete the meal. You are not trying to stay awake. You simply like good coffee.
Four hours later, you go to bed and fall asleep without difficulty. The next morning, you feel reasonably rested.
Did the coffee affect your sleep?
Possibly. Falling asleep tells you how the night began, not what happened next. Caffeine can shorten sleep, fragment it, or change the time spent in different stages. Some of those changes escape notice.
For a healthy adult who wants to protect sleep, keeping regular coffee to the morning or early afternoon is a reasonable starting point. Switching to decaf later can preserve much of the pleasure without most of the caffeine.
But there is no experimentally established last safe hour for everyone.
One controlled experiment found no statistically significant sleep deterioration after 100 mg of caffeine taken four hours before bedtime. A 400 mg dose, however, disturbed sleep even when consumed twelve hours before bed. [1]
Timing is only half the question. The dose matters too. So does the meaning of a seemingly exact deadline: 8.8 hours. Even there, the published model’s central estimate suggests roughly 12 minutes less sleep. We checked the calculation and its limits. [9]
Key Takeaways
- The dose matters. A large caffeine dose can disturb sleep even twelve hours before bedtime. Smaller doses may have less effect, but no experiment has established a universally safe cutoff.
- You might not notice every effect. Objective sleep recordings sometimes reveal changes that are absent from people’s overall ratings of sleep quality.
- You do not have to abandon coffee. Keeping caffeinated drinks earlier in the day and choosing good-quality decaf later are practical ways to reduce exposure.
Can coffee affect your sleep without you noticing?
You remember sleeping well.
You fell asleep promptly and woke feeling much as usual.
A recording of your brain activity tells a different story: less time in deep sleep, though your impression of the night has not changed.
Both accounts can be accurate.
A trial by Carissa Gardiner and colleagues exposed precisely this gap between recorded and perceived sleep. Published online in 2024, it appeared in the journal Sleep in 2025. [1]
The researchers studied 23 healthy young men who regularly consumed moderate amounts of caffeine. Each participant received either a placebo or a 100 mg or 400 mg dose of caffeine at different intervals before bedtime. The researchers recorded sleep at home, including brain activity, and collected the participants’ own assessments.
When participants took 400 mg twelve hours before bedtime, they spent approximately 21 minutes less in deep sleep than in the placebo condition. Their overall ratings of sleep quality, however, did not show a statistically significant deterioration at that interval.
At eight hours, objective disturbances were also detected, although some subjective measures did worsen. At four hours, the large dose produced problems that were apparent both in the recordings and in what participants reported.
The sleep recordings detected changes that overall sleep-quality ratings did not.
You may be right that coffee does not stop you falling asleep. You may even wake feeling rested. Yet neither observation can tell you exactly how the night unfolded.
There is a limit to what this finding means. A measurable reduction in deep sleep during one experimental night does not automatically establish long-term damage to memory, health or everyday functioning. The researchers did not test those consequences.
The instruments detected a change that the sleepers could not reliably feel.
How much caffeine makes a difference?
The results differed sharply between 100 mg and 400 mg.
What happened at different doses?
Dose changed the outcome
Caffeine taken 4, 8 or 12 hours before bed · Gardiner et al. [1]
Different measures of sleep: the values below do not form a single comparable scale.
Also delayed the onset of persistent sleep.
Also about 15 minutes less deep sleep.
Largest measured reduction in total sleep duration.
Selected statistically significant results relative to placebo in 23 healthy young men. Deep sleep, wakefulness and total sleep are distinct outcomes, so the figures should not be directly compared or added. No significant effect detected is not evidence of no effect.
Reductions in total sleep time after 400 mg at eight and twelve hours were estimated but not statistically significant. [1]
At four hours before bed, the 400 mg dose reduced total sleep time by an estimated 50.6 minutes.
The 100 mg dose did not produce a statistically significant deterioration, even at that same four-hour interval.
For a modest cup, that is encouraging, not a clean bill of health. With only 23 young men, the trial could have missed smaller effects.
An earlier experiment brings the question to an ordinary dinner table.
What happens after just one evening coffee?
In 2012, researchers recruited 63 adults who considered themselves sensitive to caffeine. On different evenings, they drank either regular coffee containing 90 mg of caffeine or decaf containing 4.5 mg after dinner, without knowing which version they were receiving. [2]
After regular coffee, participants reported taking an average of 17 minutes longer to fall asleep. They also reported more nighttime awakenings and poorer sleep quality.
These adults drank almost the same amount of caffeine as in Gardiner’s lower-dose condition. Yet their reported sleep was worse.
The studies examined different people under different conditions. The dinner-coffee experiment specifically recruited caffeine-sensitive adults and relied on their reports. Gardiner’s trial recorded objective sleep in healthy young men.
A statistically significant result in one study and its absence in another do not establish that the true effects were different.
Neither trial identifies a dose that is harmless for everyone.
In 2013, Christopher Drake and colleagues found disrupted sleep after a single 400 mg dose taken at bedtime, three hours earlier or six hours earlier. [3]
The dose, the timing and the person drinking it all shape the result.
Why does caffeine stay with you for so long?
Caffeine does not create energy. Its main alerting effect comes from blocking receptors for adenosine, a substance involved in regulating sleep pressure.
Sleep pressure is the increasing tendency to sleep after spending time awake. Caffeine interferes with that signal, making you feel less sleepy without removing the underlying need for sleep.
The taste fades long before the molecule disappears.
In healthy adults, caffeine has an elimination half-life of around five hours on average, although the actual value varies considerably. [4]
Put those five hours on a clock.
One coffee, many hours later
Suppose you drink 100 mg of caffeine at 5 p.m., and your caffeine half-life is five hours.
Caffeine remains long after the last cup
Illustrative example: one 100 mg dose, five-hour half-life
By bedtime, the cup is long gone. Some of its caffeine is not.
Fifty milligrams still circulating does not translate into a fixed loss of sleep. Clearance is only part of the story.
Why can one person drink coffee at night while another cannot?
The CYP1A2 gene helps determine the activity of an enzyme responsible for much of caffeine’s metabolism in the liver. Differences in its activity can influence how quickly caffeine is cleared.
But the rate of elimination is only part of the story.
Variations in another gene, ADORA2A, have been associated with differences in sensitivity to caffeine’s effects on sleep. This gene is involved in the adenosine-receptor system that caffeine acts upon. [5,6]
Two people can clear caffeine at different speeds and respond differently to the same concentration.
Genetics is not destiny, however. Smoking, medications, hormones and other physiological factors also influence caffeine metabolism. And the available evidence does not support a simple genetic test that can reliably tell everyone their last safe coffee time.
A person who sleeps easily after an evening espresso may genuinely be less sensitive. But falling asleep alone cannot establish that their sleep is completely unaffected.
Does drinking coffee every day make you resistant?
After a break, a strong espresso may feel markedly different from the same drink in an ordinary working week. Repeated caffeine exposure can change the response. Whether it protects sleep is another matter.
Researchers at the University of Basel investigated the question in 20 healthy young men who regularly consumed caffeine. [7]
Participants completed experimental periods involving caffeine, placebo or withdrawal. During the caffeine condition, they received 150 mg three times daily, a total of 450 mg. The final dose came eight hours before the measured night’s sleep.
After nine days of repeated caffeine exposure, conventional sleep measures, including total sleep time, the time needed to fall asleep and sleep-stage distribution, did not differ significantly between conditions.
One measure did differ: the electrical signatures of brain activity during sleep. Whether those differences matter for health or daily functioning remains unknown.
This small study of 20 men is compatible with some adaptation under its experimental conditions. It does not show that habitual caffeine use makes sleep immune to disruption.
A separate question is who remains a habitual caffeine user. People whose sleep suffers may already have cut back, leaving a disproportionate share of people who tolerate caffeine well. That selection cannot explain differences within the same participants across experimental conditions. It does limit how confidently the findings can be applied to everyone.
In Gardiner’s later trial, habitual caffeine users still showed disturbed sleep after a large additional dose. [1]
Being accustomed to coffee is not a guarantee that caffeine has stopped affecting you.
What happens when people drink coffee in ordinary life?
A laboratory controls the dose and the clock. Real life controls neither.
People drink different coffees, at different times, for different reasons. Someone may consume more caffeine because they slept badly the previous night.
That leaves observational studies with a problem of direction: does coffee shorten sleep, or does a bad night prompt another cup?
The CRAVE trial introduced random assignment into that daily routine. [8]
Published in The New England Journal of Medicine in 2023, the trial randomly assigned 100 adults to periods when they were instructed to drink caffeinated coffee or avoid caffeine. Participants continued their normal lives while wearable devices recorded sleep and other outcomes.
Usable sleep data were available from 81 participants.
Coffee days versus caffeine-free days
| Randomized instruction | Average recorded sleep |
|---|---|
| Avoid caffeine | 7 hours 12 minutes |
| Drink caffeinated coffee | 6 hours 37 minutes |
The adjusted difference was approximately 36 minutes less sleep on coffee-assigned days, with a 95% confidence interval of 25 to 47 minutes less sleep.
That average also hid a genetic difference. In a genetic analysis of CRAVE [14], participants predicted to metabolise caffeine slowly slept almost an hour less on coffee days than on avoidance days, while the fastest predicted metabolisers showed no detectable difference. The interaction was statistically significant, but this finding does not mean a genetic test can reliably predict how coffee will affect an individual’s sleep.
Because participants experienced both conditions, the result is harder to explain simply by saying that people who enjoy coffee happen to have different sleep habits.
Participants knew whether they had been instructed to drink coffee. The quantity and timing were not standardised, and wrist-worn monitors were less precise than brain-activity recordings. Effects could also carry between days: if some people slept unusually long on avoidance days following coffee days, withdrawal-related rebound might have exaggerated the difference. The trial did not separately test this possibility.
The study supports a causal effect of the coffee-drinking instructions on recorded sleep under ordinary living conditions.
It does not establish that one cup of coffee costs everyone 36 minutes of sleep.
So how many hours before bed should you stop?
Six hours is the familiar cutoff.
It sounds precise, but leaves the dose out of the equation.
The 2013 Drake experiment found sleep disruption after 400 mg even six hours before bed. The later Gardiner experiment detected effects of 400 mg at twelve hours, while finding no statistically significant deterioration after 100 mg taken four hours before bedtime. [1,3]
Another recommendation arrives with unusual precision: 8.8 hours.
Where does the 8.8-hour rule come from?
In 2023, researchers published a systematic review and meta-analysis combining 24 studies of caffeine and subsequent sleep. [9]
Across the studies contributing to each outcome, caffeine consumption was associated with approximately:
- 45 minutes less total sleep
- 9 minutes longer to fall asleep
- 12 minutes more wakefulness after falling asleep
- 7 percentage points lower sleep efficiency
- Less time in deep sleep
These are pooled experimental estimates across different doses, schedules and participants. They are not predictions for a particular cup of coffee.
The authors also modelled how dose and timing related to differences in total sleep duration.
For a 250 ml coffee containing 107 mg of caffeine, the model produced an estimated cutoff of 8.8 hours before bedtime.
The apparent precision conceals a distinction between statistical confidence and the predicted effect.
The 8.8-hour cutoff is where the model’s 95% confidence band reached the zero-effect line. It is not where the central estimate reached zero.
We checked the model’s published coefficients. For 107 mg taken 8.8 hours before bedtime, its central prediction remains approximately 12 minutes less sleep.
At 8.8 hours, the model still predicts sleep loss
For 107 mg, the model’s central estimate is still about 12 minutes less sleep at the published 8.8-hour cutoff. The estimate is not an observed outcome or a prediction for an individual.
Central model estimate, not measured sleep loss. The 95% confidence band is not shown.
Read the line as a prediction, not a measurement. It shows the model’s central estimate for a 107 mg dose; the confidence band is not plotted, and 8.8 hours is not a guaranteed safe cutoff.
Source: Gardiner et al., Sleep Medicine Reviews (2023). Method and suggested citation · Direct figure link.
Research note: What does 8.8 hours actually mean?
The 2023 meta-analysis modelled how caffeine dose and timing relate to total sleep time. For 107 mg consumed 8.8 hours (528 minutes) before bedtime, its published rounded coefficients give:
21.02 − 0.05 × 528 + 0.16 × 107 = 11.74 minutes
The central estimate still suggests approximately 12 minutes less sleep. The 8.8-hour cutoff is where the model’s 95% confidence band reaches the zero-effect line, not where the predicted effect vanishes.
Our calculation checks rounded published coefficients, not participant-level data or the model’s uncertainty. The plotted line is the central estimate only. The full 95% confidence band cannot be reliably reconstructed from separate rounded coefficients and their individual uncertainty ranges. This is not an individual safety threshold. [9]
Suggested citation: Mike’s Balance (2026), “Coffee Can Follow You Into Sleep”, independent visualisation of the regression reported by Gardiner et al. (2023). Permanent link to Figure: At 8.8 hours, the model still predicts sleep loss. This calculation reuses published coefficients; it is not an original experiment.
This is not a forecast for any individual night. At 8.8 hours, the interval also includes zero, so the model no longer establishes a reduction with conventional statistical confidence.
Built from a limited and varied set of experiments, the model cannot establish a biological boundary precise to a tenth of an hour.
For a modest coffee, leaving roughly nine hours before bed is a cautious planning reference, not a tested guarantee. High doses warrant substantially greater caution.
How much caffeine is actually in your cup?
Scientists describe caffeine doses in milligrams. Coffee drinkers order espressos, cappuccinos and large mugs of filter coffee.
A café menu is not a dose chart.
A small espresso may contain less caffeine than a large filter coffee. A latte may contain one or two espresso shots. Adding milk or water changes the drink’s volume and concentration, not the total caffeine extracted into those shots.
Here are approximate reference values from Mayo Clinic and the US Food and Drug Administration. [10,11]
Drink Example serving Approximate caffeine Single espresso 30 ml 63 mg Double espresso 60 ml 126 mg Americano 1–2 espresso shots + hot water 63–126 mg Brewed coffee 237 ml 96 mg Cappuccino or latte 1–2 espresso shots 63–126 mg Instant coffee 237 ml 62 mg Decaf coffee 237 ml 2–15 mg Black tea 237 ml 48 mg Green tea 237 ml 29 mg Energy drink 237 ml About 79 mg Energy shot 60 ml Around 200 mg
These are reference examples, not guaranteed caffeine contents. Actual amounts depend on the beans, preparation, brand and serving size.
A large brewed coffee may contain much more caffeine than the reference serving. Cold brew and energy drinks can vary substantially, so checking the label or the producer’s information matters.
Tea, cola, chocolate, certain medicines and pre-workout supplements can also contribute to your daily caffeine intake.
The FDA cites 400 mg per day as a daily intake not generally associated with adverse effects for most healthy adults. It is not a threshold that guarantees undisturbed sleep. [11]
A single 400 mg dose disrupted sleep in controlled trials even when taken many hours before bed.
Can you keep the coffee and lose the caffeine?
Giving up an after-dinner espresso can feel like giving up a small ceremony.
Perhaps you care less about the stimulating effect than about the drink itself: freshly ground beans, a favourite roast, the preparation, the aroma, and the familiar espresso after dinner.
A good decaf preserves much of the experience, while removing most of the caffeine.
In the blinded dinner-coffee trial described earlier, the regular coffee contained 90 mg of caffeine and the decaf 4.5 mg. Participants reported worse sleep after the regular version. [2]
A much earlier laboratory experiment, conducted by Ismet Karacan and colleagues in 1976, compared regular coffee, decaf, isolated caffeine and warm water before bedtime. Regular coffee produced dose-related sleep disturbances, while decaf did not significantly alter the measured sleep characteristics. [12]
That study involved only 18 men and was partly supported by General Foods Corporation. It cannot establish that every coffee drinker will respond in the same way.
Taken together, however, these experiments support caffeine as a principal contributor to regular coffee’s acute effects on sleep.
Replacing a late regular coffee with decaf may therefore help, particularly if you are sensitive to caffeine.
Decaf is a substitution, not a treatment for insomnia.
Can decaf still taste like excellent coffee?
Yes. Decaf can be freshly ground, carefully roasted and genuinely enjoyable.
Whole-bean decaf works with the same grinder and brewing equipment as regular specialty coffee.
Most decaffeination happens while the beans are still green. Several methods remove caffeine before roasting; none alone can guarantee the taste of the finished cup. [13]
Optional detail: four ways to decaffeinate coffee beans
Decaffeination process How it works What it tells you Sugarcane / ethyl acetate (EA) A solvent extracts caffeine from prepared green beans The extraction method, not a guarantee of flavour Swiss Water Water-based coffee extract and carbon filtration remove caffeine No direct organic-solvent extraction CO₂ Pressurised carbon dioxide selectively extracts caffeine A different extraction method, not a quality ranking Methylene chloride A solvent selectively removes caffeine The processing method, not the taste of the finished coffee
The label describes a process, not the quality of the cup.
Origin, green-bean quality, processing, roasting and brewing all have a part to play.
Prefer bright, fruity filter coffee? Look for decaf beans with similar tasting notes. For a rich, chocolate-forward espresso, choose a roast that suits the style.
Try a small bag. One disappointing decaf says little about the next.
For very caffeine-sensitive drinkers, one detail remains: decaf is not caffeine-free.
The FDA gives a typical range of 2–15 mg per 237 ml cup. [11]
For most coffee drinkers, that represents a substantial reduction compared with regular coffee.
Choosing your last coffee of the day
Suppose you usually go to bed at 11 p.m.
You enjoy two coffees in the morning, another after lunch and sometimes an espresso after dinner.
Start by counting caffeine, not cups. Two small espressos and two large mugs of filter coffee represent very different doses.
If sleep is the priority, make regular coffee a morning or early-afternoon habit.
For an 11 p.m. bedtime, finishing a roughly 100 mg coffee around 2 p.m. gives nine hours before sleep. That is close to the meta-analysis’s 8.8-hour model estimate, but it is a planning reference, not an experimentally demonstrated safe boundary.
If you consume large caffeine doses, consider shifting them substantially earlier or reducing them. A single 400 mg dose affected objective sleep measures even twelve hours before bedtime in the controlled trial.
If you love an evening espresso, replace it with a well-chosen decaf. You can keep the beans, the grinder, the preparation and much of the pleasure.
If you regularly consume considerable amounts of caffeine, reduce gradually rather than stopping abruptly. Withdrawal can cause headaches, fatigue and other unpleasant symptoms. [11]
To test your own routine, keep bedtime fairly consistent and change your afternoon caffeine intake for a sustained period. Watch sleep duration, awakenings and daytime functioning, without changing several other habits at once.
A clear improvement is useful information, although an unblinded personal comparison cannot establish that caffeine caused it. Nor does feeling unchanged rule out subtler effects.
Persistent sleep difficulties deserve attention even after changing your caffeine habits.
These recommendations concern generally healthy adults. Pregnancy, medications and certain medical conditions can change how the body handles caffeine. The adult experiments discussed here should not be used to establish caffeine limits for children or adolescents.
What the evidence actually tells us
Different experiments illuminate different parts of the night. Read together, they distinguish what has been measured from what remains uncertain for a particular cup.
| Question | What the evidence shows | What remains uncertain |
|---|---|---|
| Can caffeine reduce sleep? | Controlled studies and a meta-analysis show reductions in sleep duration and changes in sleep structure. [1,3,9] | The effect of a particular cup on a particular person |
| Does dose matter? | A controlled trial found clear disturbances after 400 mg, but no significant deterioration after 100 mg. [1] | The exact threshold for each individual |
| Can the effect go unnoticed? | Objective sleep changes sometimes occurred without a significant change in overall perceived sleep quality. [1] | The long-term health importance of those particular changes |
| Does regular use create tolerance? | Some experiments are compatible with adaptation. [7] | How far findings in habitual users apply to people with different sensitivities |
| Can decaf help? | Controlled comparisons found better reported sleep after evening decaf than after regular coffee in caffeine-sensitive adults. [2] | How much benefit an individual will notice |
Experiments can show that caffeine can disturb sleep. They cannot tell you precisely what your next espresso will do to yours.
The coffee may be gone, but the caffeine may not be
Back to the espresso after dinner.
Perhaps you drink it for the flavour, not the alertness. Perhaps you fall asleep easily and never think about it again.
None of these studies establishes that your own evening espresso is harming your sleep.
You might wake refreshed and still never know whether the architecture of that night changed.
A high dose can leave measurable traces many hours later. For smaller doses, the evidence is less decisive. There is no experimentally established safe hour for everyone.
The ritual can remain, even if the caffeine does not.
References
- Gardiner CL et al. (2025; published online October 2024). Dose and timing effects of caffeine on subsequent sleep: a randomized clinical crossover trial. Sleep, 48(4), zsae230.
https://doi.org/10.1093/sleep/zsae230 - Lloret-Linares C et al. (2012). Does a single cup of coffee at dinner alter the sleep? A controlled cross-over randomised trial in real-life conditions. Nutrition & Dietetics, 69(4), 250–255.
https://doi.org/10.1111/j.1747-0080.2012.01601.x - Drake C et al. (2013). Caffeine Effects on Sleep Taken 0, 3, or 6 Hours before Going to Bed. Journal of Clinical Sleep Medicine, 9(11), 1195–1200.
https://doi.org/10.5664/jcsm.3170 - Nehlig A. (2018). Interindividual Differences in Caffeine Metabolism and Factors Driving Caffeine Consumption. Pharmacological Reviews, 70(2), 384–411.
https://doi.org/10.1124/pr.117.014407 - Kapellou A et al. (2023). Genetics of caffeine and brain-related outcomes: a systematic review of observational studies and randomized trials. Nutrition Reviews, 81(12), 1571–1595.
https://doi.org/10.1093/nutrit/nuad029 - Rétey JV et al. (2007). A genetic variation in the adenosine A2A receptor gene (ADORA2A) contributes to individual sensitivity to caffeine effects on sleep. Clinical Pharmacology & Therapeutics, 81(5), 692–698.
https://doi.org/10.1038/sj.clpt.6100102 - Weibel J et al. (2021). The impact of daily caffeine intake on nighttime sleep in young adult men. Scientific Reports, 11, 4668.
https://doi.org/10.1038/s41598-021-84088-x - Marcus GM et al. (2023). Acute Effects of Coffee Consumption on Health among Ambulatory Adults. New England Journal of Medicine, 388, 1092–1100.
https://doi.org/10.1056/NEJMoa2204737 - Gardiner C et al. (2023). The effect of caffeine on subsequent sleep: A systematic review and meta-analysis. Sleep Medicine Reviews, 69, 101764.
https://doi.org/10.1016/j.smrv.2023.101764 - Mayo Clinic. Caffeine content for coffee, tea, soda and more.
https://www.mayoclinic.org/healthy-lifestyle/nutrition-and-healthy-eating/in-depth/caffeine/art-20049372 - U.S. Food and Drug Administration. Spilling the Beans: How Much Caffeine Is Too Much?
https://www.fda.gov/consumers/consumer-updates/spilling-beans-how-much-caffeine-too-much - Karacan I et al. (1976). Dose-related sleep disturbances induced by coffee and caffeine. Clinical Pharmacology & Therapeutics, 20(6), 682–689.
https://doi.org/10.1002/cpt1976206682 - Pietsch A. (2017). Decaffeination: Process and Quality. In The Craft and Science of Coffee, pp. 225–243.
https://doi.org/10.1016/B978-0-12-803520-7.00010-4 - Marcus GM. (2023). Coffee’s effects on cardiac arrhythmias, physical activity, sleep and serum glucose: Insights from the Coffee and Real-time Atrial and Ventricular Ectopy trial. Clinical and Translational Medicine, 13, e1348.
https://doi.org/10.1002/ctm2.1348