How Coffee Affects Your Sleep
Many people believe they can drink coffee and still sleep. In fact caffeine may still be at work inside you all night without your noticing.
But · 4 min read · Sep 5, 2026While you are awake, a substance called adenosine builds up in the brain. It is what creates that heavy-eyed feeling and the urge to go to bed. Caffeine works by taking adenosine's place, so the brain no longer receives the signal to sleep.
The important part is that caffeine does not clear adenosine away. It only masks the signal. When the caffeine wears off, all the accumulated tiredness arrives at once — that is the moment you feel your energy drop and want another cup.
How long caffeine stays in your body
The body needs a good many hours to clear even half of a dose of caffeine, and the speed differs from person to person. Age, the liver, medication you are taking, smoking and pregnancy all change that speed.
So an afternoon coffee can still be at work when you get into bed, even if you feel you drift off as usual. What is most often affected is not whether you fall asleep, but how deep your sleep is.
Caffeine is not only in coffee
- Strong tea, green tea, milk tea
- Energy drinks, brown fizzy soft drinks
- Dark chocolate
- Some painkillers and combination cold remedies
A few things worth noting
Drinking coffee regularly makes the body used to it, so you notice less disturbance to your sleep than before. Being used to it does not mean there is no longer an effect.
If you plan to cut back, do it gradually. Stopping suddenly can cause headaches, tiredness and irritability for a few days.
Coffee is not bad for everyone either. The question is only how much you have and at what time of day.
When to see a doctor
See a doctor if insomnia lasts more than a month despite changes to your habits; if you have a fast heartbeat, palpitations, trembling hands or marked anxiety after caffeine; or if you have heart disease, a rhythm disorder, high blood pressure or a stomach condition, or you are pregnant or breastfeeding and are not sure how much you should have.
This information is for general reference only and does not replace advice from your doctor.