The short answer #
Coffee before bed does not affect everyone in the same way, but it can delay sleep, shorten the night and make sleep less efficient. Dose and timing both matter. So do genetics, pregnancy, smoking, medicines, habitual caffeine use and existing sleep problems.
If protecting sleep is the priority, a sensible experiment is to stop regular coffee at least 6 to 8 hours before bedtime. Move the cut-off earlier if sleep remains light or broken. This is a practical starting point, not a universal medical rule. A small coffee and a 400 mg laboratory dose are not equivalent, and no clock time can predict every person's response.
The European Food Safety Authority notes that even 100 mg close to bedtime may affect sleep duration and patterns in some adults. It is therefore possible to remain below the general daily safety level and still drink caffeine too late for a good night.
Why caffeine can interfere with sleep #
During waking hours, adenosine signalling contributes to the pressure to sleep. Caffeine occupies adenosine receptors and temporarily reduces that signal. It can make you feel more alert, but it does not remove the biological need for sleep.
Caffeine is absorbed fairly quickly, then cleared over several hours. Its half-life, the time required for the body to remove half of a dose, varies substantially. The remaining amount also halves rather than disappearing all at once. Coffee at 17:00 can therefore still be relevant at 23:00 even if the obvious feeling of stimulation has faded.
Tolerance complicates perception. A regular coffee drinker may feel less of a buzz than an occasional drinker, yet still experience a change in sleep duration or structure. Falling asleep quickly is not the only outcome that matters. Night-time waking, sleep efficiency and total sleep time count too.
What the studies actually show #
A frequently cited 2013 crossover trial gave 12 healthy adults 400 mg of caffeine at bedtime, three hours before bedtime or six hours before bedtime. Sleep was measurably disrupted in all three conditions. The open-access paper, Caffeine Effects on Sleep Taken 0, 3, or 6 Hours before Going to Bed, is useful evidence that a large dose can remain active for many hours.
Its limitation is equally important: 400 mg is not one modest espresso. It can represent several coffees, depending on the drink. The sample was also small. The study supports caution with substantial late doses, not the claim that every small coffee exactly six hours before bed will disturb every sleeper.
A 2023 systematic review and meta-analysis combined 24 controlled studies. Across the included conditions, caffeine reduced total sleep time by about 45 minutes on average, lowered sleep efficiency and increased the time needed to fall asleep. Its dose-and-timing model estimated that a coffee containing 107 mg would need to be consumed roughly 8.8 hours before bedtime to avoid a statistically detectable reduction in total sleep time. That is a population estimate from a model, not a precise personal deadline.
A more recent randomised crossover trial on dose and timing tested 100 mg and 400 mg at 4, 8 and 12 hours before bed in 23 healthy men. The 100 mg dose produced no statistically significant sleep change in this small sample, while 400 mg altered sleep even when taken 12 hours before bed and increased fragmentation within eight hours. Together, these results show why advice must account for dose, timing and uncertainty rather than naming one magic hour.
What time should the last coffee be? #
Work backwards from your real bedtime, not from an arbitrary afternoon hour.
| Bedtime | First cut-off to test | If sleep is still poor |
|---|---|---|
| 22:00 | 14:00 to 16:00 | Move the last caffeine to noon or morning |
| 23:00 | 15:00 to 17:00 | Try 13:00 to 15:00 |
| 00:00 | 16:00 to 18:00 | Try 14:00 to 16:00 |
| Daytime sleep after a night shift | 6 to 8 hours before planned sleep | Move earlier according to symptoms |
The later end of each range is only a starting test for someone who normally sleeps well and drinks a moderate dose. Choose the earlier end when you are sensitive, already sleep poorly, are pregnant or take a medicine that slows caffeine clearance. A double espresso, large filter coffee or concentrated cold brew also justifies an earlier cut-off than a small single coffee.
For context, the guide to daily coffee and caffeine intake explains how to estimate total exposure. Both the daily sum and the timing of the final dose matter.
"Coffee at night does nothing to me" #
That experience can be genuine. People metabolise caffeine at different rates and do not have identical sensitivity to adenosine signalling. Habituation can also reduce the consciously felt stimulant effect.
It is still worth separating three questions:
- Can you fall asleep?
- Do you stay asleep and obtain enough sleep?
- Do you feel restored at the usual waking time?
A person may answer yes to the first question and no to the other two. Subjective impressions and objective sleep measurements do not always agree. This does not mean every evening coffee causes hidden harm. It means "I fell asleep" is not a complete test.
Run a useful two-week test #
Changing several habits at once makes the result difficult to interpret. Use a simple comparison:
- For one week, note the time and type of every caffeinated drink, bedtime, approximate time to fall asleep, night waking and morning alertness.
- Keep the morning routine and total bedtime as stable as practical.
- During the second week, move the last caffeinated drink two or three hours earlier, or replace it with decaf.
- Do not compensate by increasing the morning dose unless necessary.
- Compare several nights, not a single unusually stressful evening.
If sleep improves, keep the earlier cut-off. If nothing changes, test a lower total dose or consider other major influences such as alcohol, screen use, room conditions, pain and an irregular schedule. Persistent insomnia deserves clinical assessment rather than endless coffee experiments.
What can replace an evening coffee? #
Decaffeinated coffee is the closest substitute for the flavour and ritual. It contains much less caffeine than regular coffee, but not always zero. Someone who is highly sensitive should still observe the effect of several cups.
Other caffeine-free options include:
- rooibos;
- chamomile, lemon balm, linden or verbena infusion;
- chicory drink for a roasted flavour;
- warm milk or an unsweetened plant-based drink;
- hot water with citrus peel or spices.
Black tea, green tea, matcha, maté, cola, cocoa and energy drinks are not caffeine-free alternatives. Chocolate can also contribute to the total. Check labels on evening supplements, pre-workout products, headache remedies and cold medicines.
When extra caution is appropriate #
Pregnancy can prolong caffeine clearance, and EFSA advises keeping total intake from all sources to no more than 200 mg per day. Breastfeeding, childhood and adolescence also call for a cautious, individual approach.
Ask a doctor or pharmacist about caffeine if you have persistent insomnia, troublesome anxiety, a heart-rhythm condition, poorly controlled high blood pressure, significant reflux, or a medicine whose information mentions caffeine or stimulant interactions. Seek urgent care for severe chest pain, fainting or other acute symptoms.
The practical conclusion is simple: coffee in the evening is not automatically disastrous, but the absence of an obvious buzz does not prove that sleep is unaffected. Begin with a 6 to 8 hour caffeine-free window, account for the actual dose, and move the cut-off earlier if your own sleep data point that way.