Sleep

Caffeine and Sleep: How Late Can You Drink Coffee and Still Sleep Well?

Sleep · Published 2026-10-26

A handmade pale ceramic mug standing on a wooden table against a white wall
An afternoon mug can still be working at bedtime.

Most people who drink coffee know not to have an espresso just before bed. Fewer realise how long caffeine keeps acting: in controlled studies, a large dose taken six hours before bedtime still cut sleep by more than an hour, and the people affected often did not notice. Here is what the evidence says about caffeine and sleep, and how to pick a sensible cut-off time.

How caffeine keeps you awake

While you are awake, a substance called adenosine slowly builds up in the brain and adds to the pressure to sleep. Caffeine works mainly by blocking adenosine receptors, so the signal of growing tiredness is muffled. That is why coffee feels helpful in the morning or after lunch, and also why it can make it harder to fall asleep, sleep deeply or stay asleep later on. Caffeine does not remove the underlying need for sleep; it hides it for a while.

How long caffeine stays in the body

The European Food Safety Authority (EFSA) gives the average half-life of caffeine in healthy adults as about four hours, with a range of roughly two to eight hours. The half-life is the time it takes the body to clear half of the caffeine consumed. EFSA notes that it varies with age, body weight, pregnancy, medication and liver health; in pregnancy it becomes several times longer.

In practice, this means a strong coffee at 3 p.m. can leave a meaningful amount of caffeine in circulation at 11 p.m., and much more in people who clear it slowly. Two people drinking the same cup at the same time can have very different nights.

What the studies show

Caffeine six hours before bed

In a frequently cited study, Drake and colleagues gave 12 healthy adults who normally slept well a 400 mg dose of caffeine (or a placebo) at bedtime, three hours before bedtime and six hours before bedtime, and measured their sleep at home (Journal of Clinical Sleep Medicine, 2013). All three caffeine timings significantly disturbed sleep compared with placebo. Even the dose taken six hours before bed reduced objectively measured total sleep time by more than an hour, according to the American Academy of Sleep Medicine's summary of the study, yet participants did not report the loss in their sleep diaries. The authors concluded that avoiding substantial caffeine for at least six hours before bedtime is advisable. The study was small and used a high dose, roughly equivalent to several mugs of filter coffee at once.

A 2023 meta-analysis

Gardiner and colleagues pooled 24 studies on caffeine and subsequent sleep (Sleep Medicine Reviews, 2023). On average, caffeine reduced total sleep time by about 45 minutes and sleep efficiency by 7%, increased the time taken to fall asleep by about 9 minutes, and increased time awake after first falling asleep by about 12 minutes. It also reduced deep sleep. Based on their models, the authors suggested that a cup of coffee containing about 107 mg of caffeine should be drunk at least 8.8 hours before bedtime to avoid a reduction in total sleep time, and a typical pre-workout supplement (about 217 mg) at least 13.2 hours before.

These figures are averages from controlled studies, mostly in young healthy adults, and individual sensitivity varies widely. But they point in a consistent direction: the effect of caffeine on sleep lasts much longer than the alert feeling does.

The official view

EFSA's 2015 scientific opinion on caffeine safety concluded that single doses up to 200 mg and habitual intakes up to 400 mg a day do not raise safety concerns for healthy non-pregnant adults, and set 200 mg a day as the limit in pregnancy. It also noted that doses of about 100 mg can affect sleep in some people, particularly when consumed close to bedtime. The US Food and Drug Administration similarly cites 400 mg a day as an amount not generally associated with negative effects for most adults, and lists insomnia and sleep disruption among the signs of having too much.

How much caffeine is in common drinks

DrinkTypical caffeineSource
Filter coffee, 200 mlabout 90 mgEFSA
Espresso, 60 mlabout 80 mgEFSA
Energy drink, 250 ml canabout 80 mgEFSA
Tea, 220 ml cupabout 50 mgEFSA
Cola, 355 ml canabout 40 mgEFSA
Decaffeinated coffee, 8 fl oz (about 240 ml)typically 2 to 15 mgFDA

Real amounts vary a lot with the beans, the brewing method and the size of the cup: a large café coffee can contain far more than a 200 ml filter coffee. Caffeine is also found in chocolate, some painkillers and cold remedies, and in "pre-workout" products, which can contain high doses. Check labels if you are trying to cut down.

Choosing your cut-off time

No single cut-off suits everyone, but the evidence supports a few practical rules:

Caffeine is one of several things that shape sleep timing. Light is the strongest signal for the body clock: bright days and dim evenings help you feel sleepy at the right time, as explained in our guide to daylight and your body clock. Morning caffeine fits more comfortably with good sleep, a point covered in our science-based morning routine.

Who should be more careful

In short

This page is general information, not medical advice. If you have persistent trouble sleeping, are pregnant, or take regular medication, talk to a doctor or pharmacist about caffeine.

Sources

Read next

More in Sleep