“No coffee after lunch” is common advice, but it is rarely explained. Why lunch? Why does one person sleep soundly after an evening espresso while another lies awake after a mid-afternoon tea? The answers come down to how long caffeine stays in the body and how much that varies between people. This article looks at the evidence on timing and sets out a practical way to find your own cut-off. For caffeine’s effect on daytime anxiety, see our companion piece on caffeine, alcohol and anxiety.
How long caffeine lasts
The useful measure is half-life: the time it takes your body to clear half of the caffeine in your bloodstream. According to a review published by the US Institute of Medicine, the mean half-life of caffeine in healthy people is about five hours. That means that five hours after a coffee, roughly half of its caffeine is still circulating, and a meaningful amount remains for several hours after that.
The average hides a wide spread. The same review reports that caffeine’s half-life may range from about 1.5 to 9.5 hours. It attributes this to natural differences between individuals and to a number of physiological and environmental factors that influence caffeine metabolism, including pregnancy, obesity, use of oral contraceptives, smoking and altitude.
This is why blanket rules fit so badly. For someone at the fast end of that range, an afternoon coffee has largely gone by bedtime. For someone at the slow end, a late-morning one may not have.
What a sleep study found
A 2013 study in the Journal of Clinical Sleep Medicine tested timing directly. Participants took a fixed 400 mg dose of caffeine at bedtime, three hours before bedtime, or six hours before bedtime, and the results were compared with a placebo. Sleep was measured at home, both by the participants’ own reports and with a portable sleep monitor.
Caffeine taken at all three times significantly disrupted sleep compared with placebo. The finding that drew attention was the last one: caffeine taken six hours before bed still reduced total sleep time by a meaningful amount. The authors concluded that their results support advice to avoid substantial caffeine use for a minimum of six hours before bedtime.
Two cautions apply. The study used a single 400 mg dose, which the authors describe as moderate. Smaller amounts may have smaller effects, which the study did not test. And it reports average effects, which, given the range in half-life described above, will overstate the problem for some people and understate it for others.
Working out your own cut-off
There is no single correct time, so treat this as an experiment.
- Start from six hours. Count back six hours from your usual bedtime and make that your last caffeine of the day. For an 11 pm bedtime, that is 5 pm. This is the minimum the study supports, not a guarantee.
- Hold it for a week and note how long you take to fall asleep and how you feel in the morning.
- If sleep is still poor, move the cut-off earlier by two hours and try another week.
- Change one thing at a time. If you alter your bedtime, alcohol intake and caffeine in the same week, you will not know which change made the difference.
Our timed evening wind-down routines cover the rest of the evening.
Remember the less obvious sources
The NHS points out that tea, coffee and some soft drinks contain caffeine, which can make you feel more awake, and suggests a warm milky drink or herbal tea in the evening instead. If you are trying to keep your evenings caffeine-free, check the labels on energy drinks and any other products you are unsure about.
If you are cutting down
You do not have to stop altogether. Moving your last cup earlier, and then swapping later drinks for caffeine-free ones, is a gentler change that many people find easier to keep up. If you take medicines, are pregnant or have a health condition, ask a pharmacist or GP about caffeine, because guidance differs for some groups.
When it is not the caffeine
Caffeine is only one influence on sleep. The NHS lists avoiding caffeine late in the day alongside other simple steps, such as making your bedroom more comfortable and putting your phone away before bed. If you have moved your cut-off well back and sleep has not improved after a few weeks, caffeine is probably not the main cause. Our guide to sleep hygiene covers the other common factors, and persistent sleep problems are worth raising with a GP.
The bottom line
Caffeine lingers for longer than most people expect: about five hours for half of it to clear on average, and considerably longer for some. A controlled study found that a large dose taken six hours before bed still cut into sleep, which makes six hours a sensible minimum. Because people vary so much, the reliable approach is to set a cut-off, test it for a week, and move it earlier if you need to.
Sources
- Drake et al., “Caffeine effects on sleep taken 0, 3, or 6 hours before going to bed,” Journal of Clinical Sleep Medicine (2013)
- Institute of Medicine, “Pharmacology of Caffeine,” in Caffeine for the Sustainment of Mental Task Performance (NCBI Bookshelf)
- NHS Every Mind Matters, “Fall asleep faster and sleep better”
- NHS Every Mind Matters, “Sleep problems”
Last reviewed: 19 September 2026. This article is general information about everyday relaxation and is not medical advice.

