Sleep problems
How long before bed should I stop caffeine? A practical cut-off
Caffeine stays in your system for hours, quietly shaving down the quality of your sleep even when you manage to fall asleep.
Checked against NHS and other linked sources on 29 September 2026. Not reviewed by a doctor. How guides are made
The short answer
Stop caffeine at least six to eight hours before bed to protect your sleep quality. Caffeine blocks the brain chemical that makes you sleepy, its effects can last several hours, and its half-life runs anywhere from two to twelve hours depending on you. If you go to bed at 11pm, that usually means no caffeine after mid to late afternoon. Bear in mind this is guidance, not a promise. Some people are far more sensitive than others, and if you already struggle to sleep, stopping earlier or cutting back altogether is the safer choice.
This guide is general information, not medical advice. If you are worried about your symptoms, speak to a GP or pharmacist.

Let us start with the situation you are probably in right now. You finish work, sort dinner, and at some point reach for a coffee or a strong tea to get through the evening. Maybe it is a habit, maybe it is a genuine afternoon slump, maybe it is the thing that has been quietly sitting between you and a good night.
The question at the front of your mind is specific: how long before bed should I stop caffeine? The short version is that the safest, most widely given cut-off is to stop roughly eight hours before you plan to sleep, and some people find they need to stop even earlier. But a rule like that only helps if it makes sense to you. So this guide explains why caffeine matters at night, why the timing differs between people, and how to find the cut-off that actually works for your life.
Why caffeine matters at bedtime at all
To see why timing matters, it helps to know what caffeine actually does. It is a stimulant that works by blocking a brain chemical called adenosine. Adenosine builds up in your brain the longer you stay awake, and the more of it you have, the sleepier you feel. When caffeine blocks that chemical, you feel more alert and it is harder for sleepiness to take hold.
That is exactly what you want at 9am. It is the opposite of what you want at 10pm. If enough caffeine is still active in your system when you get into bed, it can make you fall asleep later and lead to less sleep overall. It can also reduce the deep restorative sleep that makes you feel refreshed the next day. Crucially, you do not need to be lying there wide awake for this to happen. Caffeine can be quietly degrading your sleep even when you find you do fall asleep without trouble.
This is the part people miss. A late coffee does not always announce itself by keeping you up. Sometimes it just makes your sleep shallower, or wakes you more easily in the night, and you blame the wrong thing. Understanding that caffeine can hurt sleep without causing obvious insomnia is the first step to treating it seriously.
The honest cut-off: six to eight hours before bed
So, how long before bed should you stop? The two numbers you will see most come from the two sources people actually rely on. The NHS advises avoiding tea and coffee at least six hours before you go to bed. Sleep researchers and the Sleep Foundation commonly recommend a cut-off at least eight hours before bedtime to protect sleep quality.
Here is why the guidance is not a single, tidy number. Caffeine is broken down at very different speeds in different people. It has a half-life of anywhere from two to twelve hours, meaning it can take that long for your body to clear half of what you drank. Some people clear caffeine quickly and can tolerate a mid-afternoon coffee without trouble. Others, including some pregnant people and people taking particular medicines, clear it much more slowly. Genetics, your usual intake, pregnancy and even whether you smoke can all change how long caffeine stays active in your body.
Because you cannot know your own metabolism from a chart, the practical approach is to use eight hours as your starting rule and adjust from there. An eight-hour rule means stopping around 3pm for an 11pm bedtime. The NHS's six-hour rule is the more lenient end, and it is still earlier than most people imagine they need to stop.

The half-life is the real reason timing is personal
It is worth slowing down on this because it explains why a rule that works for a friend may be useless for you. Everyone talks about the half-life of caffeine as if it is one number. It is not. It is a range, and your position in that range decides how late you can drink things.
Think of what a twelve-hour half-life looks like in practice. If you drink a coffee at 3pm, half the caffeine could still be in your system at 3am. That is active caffeine refusing to leave you alone while your body is trying to get into deep sleep. On the other end, a two-hour half-life means most of it is gone by evening, and a mid-afternoon coffee may cause you no trouble at all.
There is no way to find your number without paying attention to what happens after you drink caffeine late, which the plan below helps with. The key point now is simple: because caffeine can hang around for so long, stopping a mere hour or two before bed is rarely enough. By that point the damage to sleep quality may already be done.
Does caffeine actually keep you awake, or just make sleep lighter?
Caffeine affects sleep in more than one way, and this is why a late drink can be sneaky. On one hand it can keep you from falling asleep, because the sleepiness signal is being blocked. On the other hand, even when you do fall asleep, caffeine can reduce the deep, slow-wave sleep your body needs to feel rested. So a person can have a coffee, fall asleep fine, and still wake up feeling unrefreshed, all because the caffeine reduced the quality of the sleep rather than the amount.
It is also worth knowing that caffeine is not a substitute for rest. It can improve alertness for a while, especially if you are sleep-deprived, but it cannot undo the effects of ongoing sleep loss. Using caffeine to push through a tired evening can be what keeps the cycle going. You sleep worse because of the caffeine, feel more tired the next day, reach for more caffeine, and the pattern repeats.
There is an honest flip side to keep in mind. Caffeine affects people differently, and in one direction some people report that caffeine makes them feel tired rather than alert. This can happen for a few reasons, and it is one more sign that your own response matters more than a universal rule.
Finding your own cut-off: a three-day experiment
The most useful thing you can do is stop guessing and run a small, honest test. This is not another rigid routine; it is a short observation that tells you where your cut-off actually sits.
For three days, pick a caffeine cut-off time. A sensible starting point is eight hours before your normal bedtime. If you usually sleep at 11pm, that means no caffeine after 3pm. Watch how you feel at night and the next morning: how long it takes to fall asleep, whether you wake in the night, and how rested you feel when you get up. If you want a stricter test, move the cut-off earlier by an hour and compare.
The point is not to reach a perfect number on day one. It is to see whether an earlier cut-off changes anything for you. Many people who are genuinely caffeine-sensitive notice a real difference in sleep quality within a few days of stopping after mid-afternoon. People who tolerate caffeine well may notice little change, which is useful information in itself, because it tells them their earlier cut-off did not need to be as strict.
Writing down two or three lines a day is enough. You are not collecting a clinical data set; you are giving yourself a pattern you can actually look at, rather than a vague sense that a later coffee is fine.

It is not just coffee: hidden caffeine is easy to miss
When people think about cutting out caffeine, they picture coffee. The problem is that caffeine hides in plenty of things that do not look like a coffee cup.
Strong tea is an obvious one in the UK. So are cola, some fizzy drinks and chocolate. Energy drinks and pre-workout supplements can carry a hefty dose, and some cold and pain medicines contain caffeine too. If you are trying to find your cut-off and nothing changes, check the less obvious sources first. An afternoon square of chocolate or a can of pop can be exactly what is keeping your sleep shallower than it should be.
Read the label if you are unsure. A habit you do not think of as caffeinated may be the very thing undermining your sleep, and removing it can change more than you expect.

What if you are sensitive, or already struggling to sleep?
For most people, an earlier cut-off is enough. For some, even a small amount of caffeine causes problems, and for people already dealing with insomnia it is worth being stricter still.
If you have trouble sleeping in general, or if you notice that even an early-afternoon drink leaves you restless, consider stopping caffeine much earlier in the day. Or cut it out entirely for a couple of weeks to see what changes. Some people who treat chronic insomnia find that caffeine helps them cope with daytime tiredness, but that habit can often make the night-time problem worse. Reducing or removing it is a recognised part of improving sleep.
A couple of honest caveats, because a guide that told you caffeine is the whole story would be misleading. Caffeine is only one factor in sleep, and cutting it out will not fix a problem caused by stress, other habits, an underlying condition or a medicine. And stopping suddenly can cause withdrawal headaches for regular drinkers, which is normal and usually passes within a few days. If the discomfort is severe or you are unsure, a pharmacist can advise.
A few practical ways to hold the line in the evening
The science is easy to understand. The hard part is the habit, because a late coffee is often a small comfort you look forward to. Here are ways to make an earlier cut-off actually stick without feeling like a punishment.
Trade the evening drink for something warm and non-caffeinated. Tea drinkers can try decaf, herbal teas or a warm milky drink, which many people find genuinely settling. If the issue is partly that you want a thing to do at that moment, a warm mug of something that is not coffee covers the same need.
Put the cut-off on your routine rather than leaving it to willpower at 8pm. Set a point in your afternoon or early evening and make it part of your day, the way you might already have a moment you stop answering work messages.
If you find you are drinking a late coffee because you are genuinely exhausted, read that as a signal rather than overriding it. It may mean your sleep is already short or poor, and a better response is an earlier night or a short, early-afternoon nap that does not interfere with bedtime.

When should a coffee habit make you see a GP?
Most of the time you can handle caffeine timing yourself. But there are moments when a GP or pharmacist is the right call, because caffeine may not be the real issue.
See a GP if your sleep remains a problem even after you have stopped caffeine well before bed for a few weeks. Also see one if you have trouble sleeping for months, or if it is affecting your daily life to the point where it is hard to cope. Persistent tiredness during the day, waking repeatedly, or signs that your breathing is interrupted during sleep are worth mentioning too, because those need a different kind of assessment. And if you rely heavily on caffeine to function, or you suspect a medicine or another health condition is involved, get a proper look at the whole picture. That is wiser than assuming a stronger rule will fix it.
You do not need to feel embarrassed about it. Sleep problems are common, and working out whether caffeine, stress, something medical, or a mixture is behind yours is exactly the kind of question a GP is there to help answer.
The whole thing, on one page
- Aim to stop caffeine six to eight hours before bed; eight hours is the safer starting rule.
- Remember caffeine can degrade sleep quality even when you fall asleep fine.
- Run a three-day test to find your real cut-off, and watch for hidden caffeine in tea, cola, chocolate and energy drinks.
- If you are sensitive or sleep poorly in general, stop earlier or cut it out for a few weeks.
- Stop caffeine because the habit is a comfort, replace it with a warm non-caffeinated drink and keep the cut-off on your routine.
Do this honestly for a couple of weeks and you will have a clear answer for your body, not just a rule from the internet. If sleep still will not improve, that answer itself is useful, because it tells you and your GP that caffeine is not the whole story.

Sources & references
The health information in this guide is based on these sources. Links open in a new tab.
- NHS: Insomnia
- NHS Every Mind Matters: How to fall asleep faster and sleep better
- Sleep Foundation: Caffeine and Sleep
- Sleep Foundation: How to Fix Your Sleep Schedule
Sources last checked: 29 September 2026. Read how we use evidence.
