On average, caffeine costs you about 45 minutes of sleep a night. That is the headline from a 2023 meta-analysis in Sleep Medicine Reviews, which pooled 24 studies on caffeine and sleep. It also found caffeine made it take longer to fall asleep, cut deep sleep and increased time spent awake during the night. The researchers' practical conclusion: to avoid those effects, a standard cup of coffee should be finished at least 8.8 hours before bed.
For anyone going to sleep at 11pm, that means your last kopi should land around 2pm. Here is why, and how to work out your own cut-off.
Key takeaways
- Caffeine has an average half-life of around five hours in healthy adults, but it varies widely, from a couple of hours to around ten.
- A 2013 study found 400 mg of caffeine taken six hours before bed still reduced total sleep by more than an hour.
- A 2023 meta-analysis recommends stopping coffee at least 8.8 hours before bed, and high-dose pre-workouts at least 13 hours before.
- Caffeine can reduce deep sleep even when you fall asleep easily, so "coffee doesn't affect me" is not a reliable test.
- The US FDA considers up to 400 mg a day generally safe for healthy adults; during pregnancy, the NHS advises no more than 200 mg.
How do caffeine and sleep interact?
From the moment you wake up, a chemical called adenosine gradually builds up in your brain. The more of it there is, the sleepier you feel. This "sleep pressure" is one of the two main systems that time your sleep, alongside your circadian body clock.
Caffeine works by blocking adenosine receptors. It does not remove adenosine; it simply stops your brain from noticing it. That is why you feel alert after a coffee, and why you can crash when it wears off and all that accumulated adenosine hits at once. It is also why caffeine late in the day is a problem: it masks sleep pressure right when you need it to do its job.
The effects go beyond falling asleep. Studies consistently show caffeine reduces slow-wave or deep sleep, the stage most associated with physical restoration, and increases lighter, more fragmented sleep. You can sleep for seven hours and still wake up feeling like you slept five.
How long does caffeine stay in your system?
Caffeine's half-life, the time it takes your body to clear half of it, averages about five hours in healthy adults. So if you drink a 200 mg coffee at 3pm, around 100 mg may still be circulating at 8pm and 50 mg at 1am.
That average hides a big range. Factors that change how fast you clear caffeine include:
- Genetics. Variations in the liver enzyme CYP1A2 make some people fast metabolisers and others slow.
- Pregnancy. Clearance slows considerably, especially in later pregnancy.
- Oral contraceptives. These can roughly double caffeine's half-life.
- Smoking. Speeds up clearance, which is why people who quit smoking sometimes find coffee suddenly hits harder.
- Some medicines and liver conditions can slow clearance too.
What does the research say about timing?
A well-known 2013 study in the Journal of Clinical Sleep Medicine gave healthy sleepers 400 mg of caffeine, or a placebo, at bedtime, three hours before and six hours before. Every caffeine condition disrupted sleep. Even the dose taken six hours before bed reduced total sleep time by more than an hour, measured with an in-home sleep monitor. The authors concluded that people should avoid substantial caffeine for at least six hours before bed.
The 2023 meta-analysis went further, estimating that the effects of a typical coffee (about 107 mg) wear off after roughly 8.8 hours, and those of a typical pre-workout supplement (about 217 mg) after around 13.2 hours. That second number surprises many people who train after work and then wonder why they lie awake.
Two caveats. The 400 mg dose in the 2013 study is high, about four regular coffees at once. And individual responses vary. But the direction is clear: the common "no coffee after 5pm" rule is too late for most people.
How much caffeine is in your drinks?
Values vary with brewing method and cup size, so treat these as rough guides based on figures from the US FDA and Mayo Clinic:
| Drink | Typical caffeine |
|---|---|
| Brewed coffee, 240 ml | ~95 mg |
| Espresso, single shot | ~63 mg |
| Black tea, 240 ml | ~47 mg |
| Green tea, 240 ml | ~28 mg |
| Cola, 330 ml can | ~30–35 mg |
| Energy drink, 250 ml | ~80 mg |
| Pre-workout, 1 scoop | often 150–300 mg |
A local wrinkle: traditional kopi in Malaysia and Singapore is often made with robusta or liberica beans, and robusta contains roughly twice the caffeine of arabica by weight. A strong kopi-O from your neighbourhood kopitiam may carry more caffeine than you think, and a large iced latte with an extra shot can easily pass 150 mg.
Also watch for hidden caffeine in some painkillers (certain paracetamol combinations contain 65 mg per tablet), matcha, dark chocolate, chocolate malt drinks and "energy" supplements containing guarana.
How to find your caffeine cut-off time
- Start with your usual bedtime and count back at least 8–9 hours for coffee, or 13 hours for a high-dose pre-workout.
- Use the table below as a starting point.
- Run a two-week experiment. Move your last caffeine earlier and note how quickly you fall asleep and how you feel on waking.
- Swap, do not just stop. Replace the afternoon coffee with decaf, a caffeine-free herbal tea, cold water, or a short walk outside. Our breakdown of the 3pm slump has more ideas for getting through the afternoon without it.
| Your bedtime | Last regular coffee by | Last pre-workout by |
|---|---|---|
| 10pm | 1pm | 9am |
| 11pm | 2pm | 10am |
| Midnight | 3pm | 11am |
| 1am | 4pm | Noon |
This also frees you to enjoy your morning coffee without guilt. There is no strong evidence you need to delay it after waking, as we noted in our guide to realistic morning routines. It is the afternoon cups that do the damage.
But I can drink coffee at night and still sleep
Some people genuinely are fast metabolisers, and regular heavy users develop partial tolerance to caffeine's alerting effects. But falling asleep is not the only measure. Studies measuring sleep with lab equipment find caffeine can reduce deep sleep even when people report sleeping fine. If you wake up unrefreshed despite enough hours in bed, late caffeine is worth testing. Our guide to why so many of us sleep too little covers the other common culprits.
This article is general information, not medical advice. Speak to a doctor or pharmacist about caffeine if you are pregnant, have a heart condition, anxiety, reflux or insomnia, or take regular medication.
Frequently asked questions
How many hours before bed should I stop drinking coffee?
A 2023 meta-analysis suggests finishing a regular cup of coffee at least 8.8 hours before bed, and a high-dose pre-workout at least 13 hours before. For an 11pm bedtime, that means a last coffee around 2pm. Sensitive people may need an even earlier cut-off.
Does decaf coffee affect sleep?
Decaf contains only a small amount of caffeine, usually a few milligrams per cup, so it is unlikely to affect sleep for most people. Very sensitive people drinking several cups in the evening might notice a difference. It is generally a good afternoon swap.
Is tea better than coffee for sleep?
Tea usually contains less caffeine per cup, around half for black tea and less for green tea, so it is gentler. But several cups of strong teh in the late afternoon can add up to a coffee's worth. Caffeine-free herbal teas are the safest evening choice.
How much caffeine is safe per day?
The US FDA considers up to 400 mg a day generally safe for healthy adults, roughly four cups of brewed coffee. During pregnancy, the NHS recommends no more than 200 mg a day. People with heart conditions, anxiety or sleep problems may benefit from less.
Why do I feel tired even after drinking coffee?
Caffeine blocks the signal of sleepiness but does not remove the underlying sleep pressure. If you are short on sleep, you may feel tired as soon as it wears off. Regular users also build tolerance, so the same dose has less effect over time.
Sources
- Drake et al. (2013), Caffeine effects on sleep taken 0, 3, or 6 hours before going to bed, Journal of Clinical Sleep Medicine (PubMed)
- Gardiner et al. (2023), The effect of caffeine on subsequent sleep: a systematic review and meta-analysis, Sleep Medicine Reviews (PubMed)
- US FDA — Spilling the Beans: How Much Caffeine Is Too Much?
- Mayo Clinic — Caffeine: How much is too much?
- Sleep Foundation — Caffeine and Sleep
- NHS — Foods to avoid in pregnancy (including caffeine limits)

