Skip to main content

Caffeine and sleep: why your afternoon coffee is still at work at night

Caffeine blocks your sleep pressure and has a half-life of about 5-6 hours. Even coffee six hours before bed shortens and worsens your sleep — often without you noticing.

· Last reviewed July 12, 2026· 5 min read
BMatig bewijsWe zijn redelijk zeker; verder onderzoek kan de conclusie nog bijstellen.

Caffeine is the most widely used psychoactive substance in the world, and for most people a beloved part of the day. But caffeine and sleep are at odds — and the sting is in the timing. Many people think coffee only bothers them in the evening, while a cup from mid-afternoon can still be at work at night. This article explains how caffeine affects your sleep, why the effects last longer than you think, and until what time you can sensibly drink it.

In brief: what does the evidence say?

BMatig bewijs

  • Caffeine blocks adenosine, the substance that builds up your sleep pressure — it masks your sleepiness.
  • The half-life is on average about 5 to 6 hours: drinking in the afternoon is still at work at night.
  • Caffeine can shorten sleep and reduce deep sleep, often without you noticing.
  • Sensitivity varies greatly from person to person, partly due to your genes.
  • Practical rule of thumb: stop about 6 hours before bedtime — earlier if you are sensitive.

How caffeine switches off your sleep pressure

While you are awake, a substance called adenosine builds up in your brain. The longer you are awake, the more adenosine, and the stronger the signal "time to rest." That accumulating sleep pressure is one of the two engines of your sleep.

Caffeine closely resembles adenosine in molecular shape. As a result it can occupy the same receptors — but without delivering the rest signal. Caffeine thus blocks the spots where adenosine would normally do its work [4]. The result: you do not feel your sleepiness, even though the sleep pressure is very much there. Caffeine therefore does not remove your fatigue, it hides it temporarily. As soon as the caffeine has been broken down, the accumulated adenosine can still hit you.

Caffeine masks, it does not restore

Caffeine does not give you extra energy — it only blocks the sleep signal. The underlying sleep pressure keeps rising. That is why you can still be exhausted after a strong cup in the evening once the substance has worn off.

The half-life: why afternoon coffee is still at work at night

The key concept is the half-life: the time your body needs to break down half of the caffeine. That is on average around 5 to 6 hours. If you drink a double espresso at 3 p.m., then around 8-9 p.m. about half is still in your system, and around midnight still a quarter. Precisely when you are trying to fall asleep, your adenosine is therefore still partly blocked.

That this is not just theory was shown by a controlled study in which participants received 400 mg of caffeine (roughly four cups of coffee) at various moments. Even caffeine taken six hours before bed shortened objectively measured sleep by more than an hour [3]. Notably, the participants barely noticed this themselves. Thuisarts.nl therefore also advises against consuming any caffeine in the six hours before bedtime [1].

Effect on falling asleep and on deep sleep

Caffeine affects your sleep in two ways. First, it can lengthen your sleep-onset time and make you wake up more often during the night. Second — and this is often forgotten — caffeine reduces deep (slow-wave) sleep, the phase that is most restorative. Your sleep thereby becomes lighter and more fragmented, even if the total duration still looks reasonable.

⚠️ Falling asleep well ≠ sleeping well

Many people say "I fall asleep fine after coffee." That can be true and still be a problem: caffeine can reduce your deep sleep while you are not aware of it. The quality of your night suffers, even if falling asleep itself works.

Why one person is more affected than another

Caffeine sensitivity varies enormously from person to person. Part of that is genetically determined: differences in the enzyme that breaks down caffeine in your liver and in the sensitivity of your adenosine receptors determine whether you are a "fast" or "slow" metabolizer [4]. In slow metabolizers the half-life rises considerably, and the same cup of coffee is at work much longer.

In addition, age, smoking (which actually speeds up the breakdown), pregnancy, some medications, and habituation play a role. With regular use, tolerance develops in part to the waking effect — but that does not automatically mean the disruption of your sleep disappears too.

Practical cut-off time and caffeine sources

A workable rule of thumb is: stop caffeine about 6 hours before bedtime. If you go to sleep around 11 p.m., then 5 p.m. is a reasonable limit — and if you are sensitive or have sleep complaints, stopping after lunch (around 2 p.m.) is wiser. Experiment for a few weeks and watch your own nights; that is how you discover your limit.

ℹ️ Caffeine is in more than coffee

Do not think only of coffee. Black and green tea, cola, energy drinks, dark chocolate, and some painkillers and pre-workout supplements also contain caffeine. If you are sensitive in the evening, add up all sources — not just that last espresso.

Cutting back on caffeine is one of the simplest knobs to turn for a better night. It is no miracle cure for insomnia — for persistent sleep complaints a behavioral approach such as CBT-I remains the core [2] — but anyone who moves their last cup of coffee a few hours earlier gives deep sleep more room right away.

Frequently asked questions

How long does caffeine stay in your body?

Caffeine has an average half-life of about 5 to 6 hours. That means that after 5-6 hours roughly half of the caffeine is still active in your body, and after another 5-6 hours a quarter. An espresso at 3 p.m. therefore is still working in the evening. The half-life varies greatly from person to person, due to factors such as your genes, age, smoking, pregnancy, and medication use.

What time should I stop drinking coffee?

A practical rule of thumb is to stop caffeine about 6 hours before bedtime. In research, 400 mg of caffeine (about four cups of coffee) still measurably shortened sleep even when taken six hours before bed. If you are sensitive to caffeine or sleep badly, it is often wiser to stop after lunch (around 2 p.m.).

I fall asleep fine after coffee. So it can't do any harm, right?

Not necessarily. Research shows that caffeine can shorten your sleep and reduce deep, restorative sleep, even when you are not aware of it yourself. Falling asleep easily therefore does not automatically mean your sleep is unaffected.

Why does caffeine affect me more strongly than my partner?

That is largely due to differences in your genes, which determine how quickly your liver breaks down caffeine and how sensitive your adenosine receptors are. 'Fast' metabolizers notice little in the evening; 'slow' metabolizers feel the effect of the same cup for hours. Age, smoking, and habituation also play a role.

Where is caffeine found?

Not only in coffee. Black and green tea, cola, energy drinks, dark chocolate, and some painkillers and pre-workout supplements also contain caffeine. So if you are sensitive in the evening, watch not just coffee but all sources combined.

Sources

  1. Thuisarts.nl / NHG (2024). Ik wil beter slapen: slaapadviezen. Thuisarts.nl. source
  2. NHG (2024). NHG-Standaard Slaapproblemen. NHG. source
  3. Drake C, Roehrs T, Shambroom J, Roth T (2013). Caffeine Effects on Sleep Taken 0, 3, or 6 Hours before Going to Bed. J Clin Sleep Med. doi:10.5664/jcsm.3170
  4. Reichert CF, Deboer T, Landolt HP (2022). Adenosine, caffeine, and sleep–wake regulation: state of the science and perspectives. J Sleep Res. doi:10.1111/jsr.13597