Caffeine and sleep: how late is too late for your last coffee?
How long caffeine stays in your body, what the key studies found about coffee 6 hours before bed, and a simple table to work out your own cut-off time.
In this article
For most people, caffeine is too late once you are within about eight to nine hours of bed. A strong dose still disturbed sleep when taken six hours before bedtime. A 2023 meta-analysis suggests finishing a standard coffee at least 8.8 hours before bed. For an 11pm bedtime, that puts your last coffee at around 2pm.
This guide explains why caffeine lingers so long and what the key studies actually measured. It also lists the caffeine in everyday UK drinks, and shows how to find the cut-off that suits your body.
Key takeaways
- Caffeine keeps you alert by blocking adenosine, the chemical that builds up sleep pressure while you are awake.
- How fast you clear caffeine varies a lot. The Sleep Foundation puts caffeine's half-life anywhere between 2 hours and 12 hours.
- In a home study, 400mg of caffeine disturbed sleep compared with a placebo. That held whether it was taken 0, 3 or 6 hours before bed.
- A 2023 meta-analysis of 24 studies found caffeine cut total sleep by 45 minutes. Deep sleep fell by about 11 minutes. It suggests a standard coffee at least 8.8 hours before bed, and a pre-workout at least 13.2 hours before.
- Test your own cut-off over two weeks, changing one thing at a time.
How does caffeine affect sleep?
From the moment you wake up, your brain builds up a chemical called adenosine. The longer you are awake, the more it accumulates and the sleepier you feel. This is part of what sleep scientists call sleep pressure.
Caffeine works by blocking adenosine receptors, as the Sleep Foundation's guide to caffeine and sleep explains. The adenosine is still there, but your brain cannot "hear" it as clearly. That is why a coffee makes you feel more awake. It is also why caffeine in your system at bedtime can make it harder to fall asleep and stay asleep.
Caffeine does not only affect whether you drop off. Research also shows it changes the structure of the night, with more light sleep and less deep sleep. For the background on those stages, our guide to light, deep and REM sleep covers what each one does.
How long does caffeine stay in your system?
The key number is caffeine's half-life: the time your body takes to clear half of it. According to the Sleep Foundation, it ranges anywhere between 2 hours and 12 hours. That range explains a lot. One person can drink an espresso after dinner and sleep well. Another lies awake after a 3pm tea.
Several things change how quickly you clear it. The Sleep Foundation notes that genetics play a part. People who use nicotine clear caffeine faster, and pregnancy slows it down considerably.
Here is a worked example to show why the afternoon matters. It assumes a half-life of 5 hours, which sits inside that range. It is an illustration, not a measurement of you.
| Time | Caffeine left from a 200mg coffee at 2pm (assuming a 5-hour half-life) |
|---|---|
| 2pm | 200mg |
| 7pm | 100mg |
| Midnight | 50mg |
| 5am | 25mg |
If your half-life is longer, those numbers stay higher for longer. That matters because single doses of around 100mg can affect sleep in some people, particularly close to bedtime. The European Food Safety Authority noted this, as summarised in EUFIC's overview of the EFSA caffeine opinion.
What does the research say about caffeine timing?
The Drake study: 0, 3 or 6 hours before bed
The most quoted study is Drake and colleagues, in the Journal of Clinical Sleep Medicine in 2013. Participants took a fixed 400mg dose of caffeine at bedtime, 3 hours before or 6 hours before. On another night they took a placebo. They slept at home, kept a sleep diary and wore a portable monitor that measured sleep objectively.
Caffeine disturbed sleep compared with placebo at all three timings, including 6 hours before bed. The authors concluded that caffeine 6 hours before bedtime has important disruptive effects on sleep. Their results support avoiding substantial caffeine for at least 6 hours before bed.
Keep the dose in mind. 400mg is a lot to take in one go. The NHS puts a cup of instant coffee at about 100mg, so it is roughly four cups at once. The study tells you a big afternoon dose can still reach your night. It does not tell you exactly where a single small tea sits.
The 2023 meta-analysis: 24 studies combined
A broader answer comes from a 2023 systematic review and meta-analysis by Gardiner and colleagues in Sleep Medicine Reviews. It pooled 24 studies. Compared with no caffeine, caffeine:
- reduced total sleep time by 45 minutes
- reduced sleep efficiency by 7%
- added 9 minutes to the time taken to fall asleep
- added 12 minutes of time awake after first falling asleep
- increased light N1 sleep by about 6 minutes and reduced deep sleep by about 11 minutes
The authors then estimated how far before bed caffeine needs to be taken to avoid losing sleep. For a coffee containing 107mg per 250ml, the answer was at least 8.8 hours. For a standard serve of pre-workout supplement, 217.5mg of caffeine, it was at least 13.2 hours.
What the NHS advises
The NHS advice on insomnia is simpler: do not drink tea or coffee for at least 6 hours before going to bed. That lines up with the Drake study. The meta-analysis suggests a longer gap to protect every minute of sleep, especially with stronger drinks.
So how late is too late for caffeine?
Work backwards from the time you usually go to sleep. The table uses the two cut-offs from the 2023 meta-analysis, rounded to the nearest 10 minutes.
| Your usual bedtime | Last standard coffee (8.8 hours before) | Last pre-workout (13.2 hours before) |
|---|---|---|
| 10pm | about 1.10pm | about 8.50am |
| 11pm | about 2.10pm | about 9.50am |
| Midnight | about 3.10pm | about 10.50am |
Treat these as a starting point. If you are sensitive to caffeine, pregnant or already sleeping badly, move the cut-off earlier. If you train in the evening, the pre-workout column is the one that catches people out. A scoop at 6pm is still very much in your system at midnight.
How much caffeine is in your drinks?
Caffeine adds up across the day, and it is not only in coffee. These are the NHS estimates.
| Drink or food | Approximate caffeine |
|---|---|
| Cup of instant coffee | 100mg (filter and coffee-shop coffee can contain more) |
| Cup of tea, black or green | 75mg |
| 250ml can of energy drink | 80mg |
| Can of cola | 40mg |
| 50g bar of plain dark chocolate | less than 25mg |
| 50g bar of plain milk chocolate | less than 10mg |
Source: NHS, foods to avoid in pregnancy. Tea is easy to forget. Two afternoon cups of tea add up to 150mg, more than one cup of instant coffee.
How much caffeine is safe in a day?
Safety and sleep are two separate questions. EFSA published a scientific opinion on the safety of caffeine in 2015. For healthy non-pregnant adults, habitual intakes up to 400mg a day raised no safety concerns. Nor did single doses up to 200mg. In pregnancy, up to 200mg a day raised no safety concerns for the unborn baby. The NHS also advises staying under 200mg a day in pregnancy.
Those limits are about overall safety, not sleep. You can stay well within 400mg a day and still sleep worse. It depends on how much comes late in the afternoon. Timing matters as much as the total.
How to find your own caffeine cut-off
People clear caffeine at such different speeds that the best cut-off is the one you test yourself. A simple approach:
- Pick a starting cut-off from the table above, based on your usual bedtime.
- Keep everything else as steady as you can: bedtime, wake time, alcohol and evening training.
- Hold the new cut-off for two weeks. Single nights vary too much to judge.
- Note how long you take to fall asleep, how often you wake, and how you feel mid-morning.
- If nothing changes, try moving it an hour or two earlier. If you sleep well, you have found your window.
Change one habit at a time. Cut caffeine, drink less and go to bed earlier in one week, and you cannot tell which helped. Our 14-night sleep experiment sets out the method step by step. The guide on how to get more deep sleep covers the other habits worth testing next.
A wearable makes this experiment easier to read. PulseRing Pro tracks your sleep stages, heart rate, HRV and blood oxygen every night. It builds a personal baseline over roughly two weeks of wear. Then you can compare nights with and without that late coffee. Each morning you get one readiness score and one plain call: push, maintain or rest. Its sleep staging is an estimate that has not been independently validated, so read the trend. No subscription, and every metric is included for £89.
Ways to cut back without an afternoon slump
- Move your biggest coffee to the morning, when it does the most good and has the longest time to clear.
- Switch afternoon drinks to decaf or caffeine-free options rather than stopping all at once.
- Check labels on energy drinks and pre-workouts, which can carry far more caffeine than a coffee.
- Watch for "hidden" afternoon caffeine: a cola with lunch, a tea at 4pm, dark chocolate after dinner.
- Rely on caffeine to get through every afternoon? Look at your sleep first. Caffeine can cover up tiredness, but it cannot replace sleep.
Frequently asked questions
Is 2pm too late for coffee?
It depends on your bedtime. A 2023 meta-analysis suggests finishing a standard coffee at least 8.8 hours before bed. So 2pm works for a bedtime of around 11pm or later. If you go to bed at 10pm, aim for about 1pm. Sensitive people, or those already sleeping badly, may need an earlier cut-off.
Does quitting caffeine improve sleep?
Cutting late caffeine is the part most likely to help. In the 2023 meta-analysis, caffeine cost 45 minutes of total sleep on average. You may not need to quit entirely. Moving your last cup earlier may be enough. Test the change over two weeks before deciding.
Does tea affect sleep as much as coffee?
Tea contains less caffeine per cup than coffee, but it still counts. The NHS estimates about 75mg in a cup of black or green tea. A cup of instant coffee has about 100mg. Two afternoon teas can add up to more than one coffee, so give tea the same cut-off.
Why can some people drink coffee at night and still sleep?
People clear caffeine at very different speeds. The Sleep Foundation puts the half-life anywhere between 2 hours and 12 hours. Genetics, smoking and pregnancy all play a part. Feeling fine is not the same as sleeping well either. Caffeine can shorten sleep and reduce deep sleep without you noticing.
Does caffeine reduce deep sleep?
Yes, on average. A 2023 meta-analysis of 24 studies found caffeine reduced deep sleep by about 11 minutes. It also increased light N1 sleep by about 6 minutes and cut total sleep by 45 minutes. Deep sleep comes early in the night, so caffeine left at bedtime is well placed to interfere.
How much caffeine is safe per day in the UK?
For healthy adults who are not pregnant, EFSA found intakes up to 400mg a day raised no safety concerns. Single doses up to 200mg were also fine. The NHS advises no more than 200mg a day in pregnancy. These limits are about safety, not sleep. Late caffeine can still disturb your night well within them.
Sources
- Drake C, Roehrs T, Shambroom J, Roth T. Caffeine effects on sleep taken 0, 3, or 6 hours before going to bed, Journal of Clinical Sleep Medicine, 2013
- Gardiner C et al. The effect of caffeine on subsequent sleep: A systematic review and meta-analysis, Sleep Medicine Reviews, 2023
- EFSA Panel on Dietetic Products, Nutrition and Allergies. Scientific Opinion on the safety of caffeine, EFSA Journal, 2015
- EFSA opinion on the safety of caffeine, EUFIC, 2015
- Caffeine and Sleep Problems, Sleep Foundation, 2025
- Insomnia, NHS, 2024
- Foods to avoid in pregnancy, NHS, 2026
This article is for general information and is not medical advice. PulseRing Pro is a wellness device, not a medical device, and does not diagnose or treat any condition. If you are worried about your health, speak to your GP or a qualified clinician.
Morning Light and Your Circadian Rhythm: How to Reset Your Body Clock
Why morning light is the strongest signal for your body clock, what studies of daylight and sleep show, how bright and how long is enough, and how to get more of it on dark wint...
Sleeping With a Partner: Snoring, Temperature and Better Nights
What the research says about sharing a bed, practical fixes for snoring, heat and different bedtimes, and the snoring signs that mean it is time to see a GP or doctor.
Sleeping Heart Rate by Age: What Is Normal and What to Watch
What a normal sleeping heart rate looks like at each age, taken only from studies that say how they measured it, plus why your heart slows at night, how to read your own tracker...




















