Caffeine: when the last cup should be
For most adults the last caffeinated drink belongs at least 6 hours before bed, and earlier is better. The NHS sets the cut-off for tea and coffee at 6 hours; in a 2013 placebo-controlled trial, 400 mg of caffeine taken 6 hours before bedtime still cut measured sleep by more than an hour, while the 12 participants' own diaries registered only 41 minutes of it. A 2023 analysis of 24 studies puts a standard 107 mg coffee at least 8.8 hours before bed to protect sleep length, so with a 23:00 bedtime the last cup lands at about 14:00.
What the NHS and EFSA advise
The NHS keeps it simple. Its insomnia guidance says do not drink tea or coffee for at least 6 hours before going to bed. It also gives the numbers that frame the question: adults need 7 to 9 hours on average, and trouble sleeping that lasts 3 months or longer counts as long-term insomnia, a reason to see a GP rather than to try harder.
The European Food Safety Authority (EFSA) examined caffeine itself in a 2015 scientific opinion. For healthy adults it found no safety concern with up to 400 mg a day, about 5.7 mg per kilogram of body weight, or with single doses of up to 200 mg, about 3 mg per kilogram. Pregnant women should stay within 200 mg a day, and for children and adolescents the panel proposed 3 mg per kilogram a day. The line that matters for bedtime is smaller: single doses of 100 mg, about 1.4 mg per kilogram, may affect sleep duration and patterns in some adults, particularly when taken close to bedtime.
EFSA also published typical contents per serving, from 80 mg in a 60 mL espresso to 10 mg in a 50 g bar of milk chocolate, with the caution that portions and strengths vary between countries. The table below gives them in full.
| Serving (EFSA figures) | Caffeine | Left after 5 hours | Left after 10 hours |
|---|---|---|---|
| Espresso, 60 mL | 80 mg | about 40 mg | about 20 mg |
| Filter coffee, 200 mL | 90 mg | about 45 mg | about 22 mg |
| Energy drink, 250 mL can | 80 mg | about 40 mg | about 20 mg |
| Black tea, 220 mL | 50 mg | about 25 mg | about 12 mg |
| Cola, 355 mL can | 40 mg | about 20 mg | about 10 mg |
| Plain chocolate, 50 g bar | 25 mg | about 12 mg | about 6 mg |
| Milk chocolate, 50 g bar | 10 mg | about 5 mg | about 2 mg |
The trial that put 6 hours to the test
The 6-hour rule rests mainly on one small but careful experiment, published in 2013 in the Journal of Clinical Sleep Medicine. Twelve healthy sleepers, 6 women and 6 men aged 19 to 48, with a modest habitual intake of about 115 mg of caffeine a day, took 400 mg of caffeine in pill form at bedtime, 3 hours before bed or 6 hours before bed, and a placebo on a fourth night, in random order and double-blind. They slept at home, bedtimes between 21:00 and 01:00 and 6.5 to 9 hours in bed, wearing a single-channel EEG headband, and kept a sleep diary.
All three caffeine nights looked alike on the monitor. Total sleep time fell by 1.1 to 1.2 hours compared with placebo whether the pill came at bedtime, 3 hours before or 6 hours before. The time taken to reach steady sleep grew by 17.2 minutes in the 3-hour condition, the only one of the three where that measure reached statistical significance, and by 22.4 and 24.1 minutes at 0 and 6 hours. Wake time during the night rose by 27.6 minutes at 3 hours and 8 minutes at 6 hours, and light sleep (stages 1 and 2) lost 40.6 to 44.1 minutes in every condition.
The diaries told a different story. Participants noticed the disturbance when caffeine came at bedtime or 3 hours before, but at 6 hours their self-reported sleep was only 41 minutes shorter, a difference that did not reach statistical significance, while the monitor recorded a loss of more than an hour. The authors read this as caffeine fragmenting sleep with brief awakenings that people do not remember, and suggested that afternoon caffeine should stop before 17:00. The limits are plain: 12 people, one night per condition, a 400 mg pill (roughly four cups of filter coffee at once) rather than a drink, and good sleepers rather than people with insomnia.
What 24 studies add up to
A 2023 systematic review and meta-analysis in Sleep Medicine Reviews pooled 24 studies of caffeine and the night that followed. On average, caffeine cut total sleep time by 45 minutes and sleep efficiency (the share of time in bed spent asleep) by 7 percentage points, added 9 minutes to the time taken to fall asleep and 12 minutes of wakefulness after sleep began. Sleep also got lighter: stage N1 gained 6.1 minutes and 1.7 percentage points of the night, while deep sleep (N3 and N4) lost 11.4 minutes and 1.4 percentage points.
The review then modelled how dose and timing trade off, which turns a warning into a clock. To avoid a reduction in total sleep time, a standard coffee of 107 mg in 250 mL should be taken at least 8.8 hours before bedtime, and a standard serve of a pre-workout supplement with 217.5 mg at least 13.2 hours before. Double the dose and the safe distance grows by more than 4 hours.
Read those figures as averages from studies with different doses, drinks and ways of measuring sleep, not as a threshold for everyone. Habitual intake, body weight and the genes that govern caffeine metabolism all shift the response. The direction is consistent across the evidence; the exact hour is not.
| Caffeine taken | Measured sleep lost | Extra time to reach steady sleep | Extra wake during the night | Noticed in the diary |
|---|---|---|---|---|
| At bedtime | 1.1 to 1.2 hours | 22.4 minutes, not significant | increased, not significant | yes |
| 3 hours before | 1.1 to 1.2 hours | 17.2 minutes | 27.6 minutes | yes |
| 6 hours before | 1.1 to 1.2 hours | 24.1 minutes, not significant | 8 minutes | no (41 minutes less by diary, not significant) |
Why your cut-off is personal
The reason timing matters is arithmetic. Caffeine's half-life, the time the body takes to clear half of a dose, averages about 5 hours in adults, according to the pharmacology reference on the National Library of Medicine's bookshelf. A 90 mg filter coffee at 14:00 leaves roughly 45 mg in the blood at 19:00 and about 22 mg at midnight. A 160 mg double espresso at 16:00 still supplies about 80 mg at 21:00, close to the 100 mg dose EFSA links with disturbed sleep. The liver enzyme CYP1A2 does most of the clearing.
That average hides a wide spread. The same reference puts the half-life anywhere between 1.5 and 9.5 hours from one person to the next, depending on pregnancy, body weight, oral contraceptive use, smoking and altitude. At the slow end, near 9.5 hours, clearance takes about twice as long as at the 5-hour average: the same 90 mg coffee drunk at 14:00 would still leave about 45 mg at 23:30 instead of 22 mg. Pregnancy and oestrogen-containing contraceptives push people towards that end, smoking towards the other. The spread is why published advice differs so much: the authors of the 2013 trial note recommendations ranging from 4 to 11 hours before bed.
Setting your last cup, and when to ask a doctor
Start from your bedtime, not from the clock on the wall. Count back 6 hours for the NHS minimum, or 8 to 9 hours if you sleep badly, and that is the last coffee or tea. For a 23:00 bedtime that means 17:00 at the latest and about 14:00 for the stricter version; a night owl who sleeps at 01:00 can shift both by 2 hours, which is one reason it helps to know your chronotype. The Caffeine Clock does the half-life sums for your own drinks and bedtime.
Count everything, not just coffee. A 250 mL energy drink carries the same 80 mg as an espresso, and two cups of tea reach the 100 mg that EFSA says can alter sleep, while a cup of tea with a bar of plain chocolate comes to 75 mg. Keep single doses under 200 mg and the day under 400 mg. If you move your cut-off earlier, do it 1 hour at a time and hold each step for about 2 weeks.
Some people should talk to a professional first. In pregnancy the limit is 200 mg a day from all sources, and pregnancy is one of the states that slow caffeine clearance, so ask your midwife about timing as well as amount. If you have a heart condition such as an irregular heartbeat or high blood pressure, or you take medicines for the heart, for asthma or for anxiety, ask your doctor or pharmacist how caffeine fits in. Children and adolescents should stay within EFSA's 3 mg per kilogram a day, which for a 30 kg child is 90 mg, barely more than one energy drink, and none of it in the evening. If you have slept badly for 3 months or more, or poor sleep makes daily life hard to cope with, the NHS advice is to see a GP; cutting caffeine is part of the answer, not a substitute for one. Our guides on how much sleep adults need and screens in the evening cover the other levers.
Finding your last-cup time
- Write down your usual bedtime and count back 6 hours; that is the NHS minimum for tea and coffee
- If you sleep poorly, count back 8 to 9 hours instead, in line with the 2023 meta-analysis
- Count every source: an energy drink (80 mg), a cup of tea (50 mg) or a bar of plain chocolate (25 mg) in the evening counts as much as coffee
- Keep single doses under 200 mg and the day under 400 mg, the EFSA limits for healthy adults
- Move the cut-off earlier 1 hour at a time and keep each step for about 2 weeks before judging
- Track how long you take to fall asleep and how often you wake; the loss at 6 hours barely showed in the trial diaries
- In pregnancy, with a heart condition or an irregular heartbeat, on heart, asthma or anxiety medicines, or for anyone under 18, ask a doctor or pharmacist before changing intake
Frequently asked
Is 6 hours before bed enough?
It is the NHS minimum, and in the 2013 trial 400 mg of caffeine taken 6 hours before bed still cut measured sleep by more than an hour. The 2023 meta-analysis places a standard 107 mg coffee at least 8.8 hours before bed to protect sleep length, so treat 6 hours as the floor and move earlier if your sleep is poor.
I sleep fine after an evening coffee, so why change?
In the trial, sleepers who took caffeine 6 hours before bed lost more than an hour on the EEG monitor while their diaries recorded only 41 minutes less, a difference that was not statistically significant. Caffeine fragments sleep with short awakenings that people rarely remember, so feeling fine is not proof of an undisturbed night.
Does tea count?
Yes. EFSA puts a 220 mL cup of black tea at about 50 mg, more than half the caffeine of a filter coffee, and the NHS 6-hour rule names tea and coffee together. Two cups in the evening reach the 100 mg that EFSA says may affect sleep in some adults.
Does decaffeinated coffee count?
Decaffeinated coffee still contains a little caffeine, but far less than the 80 to 90 mg in a regular espresso or filter cup, so for most people it is a reasonable evening substitute. If you are very sensitive, a herbal drink avoids the question altogether.
What changes in pregnancy?
EFSA sets the pregnancy limit at 200 mg a day from all sources, roughly two cups of filter coffee. Pregnancy is also one of the states that slow caffeine clearance, so a morning cup lingers longer than usual; talk to your midwife or doctor about both amount and timing.
How much caffeine is safe in a day?
EFSA concluded in 2015 that up to 400 mg a day, about 5.7 mg per kilogram of body weight, and 200 mg in a single dose raise no safety concern for healthy adults. That is a safety limit, not a sleep limit; the sleep effects begin at about 100 mg when taken near bedtime.
Sources
- NHS: Insomnia · Do not drink tea or coffee at least 6 hours before bed; adults need 7 to 9 hours; insomnia of 3 months or longer is long-term; see a GP if changing habits has not helped or daily life suffers
- EFSA: Caffeine, summary of the 2015 Scientific Opinion on the safety of caffeine · 400 mg a day and 200 mg single doses for healthy adults; 100 mg may affect sleep near bedtime; 200 mg a day in pregnancy; 3 mg per kg for children; typical caffeine per serving (espresso 80 mg, filter coffee 90 mg, black tea 50 mg, cola 40 mg, energy drink 80 mg, chocolate 25 and 10 mg)
- Drake et al. 2013, Journal of Clinical Sleep Medicine (full text at PubMed Central): Caffeine effects on sleep taken 0, 3, or 6 hours before going to bed · 12 healthy sleepers aged 19 to 48, 400 mg, randomised double-blind placebo-controlled crossover at home with a single-channel EEG headband; total sleep time down 1.1 to 1.2 hours at all three timings; diaries did not register the loss at 6 hours
- Gardiner et al. 2023, Sleep Medicine Reviews (open access copy in the Leeds Beckett University repository): The effect of caffeine on subsequent sleep, a systematic review and meta-analysis · 24 studies; total sleep time down 45 minutes, sleep efficiency down 7%, sleep onset 9 minutes longer, 12 minutes more wake after sleep onset; coffee of 107 mg at least 8.8 hours before bed, pre-workout supplement of 217.5 mg at least 13.2 hours
- StatPearls, NCBI Bookshelf (National Library of Medicine): Caffeine withdrawal · Toxicokinetics section: mean caffeine half-life about 5 hours, range 1.5 to 9.5 hours depending on pregnancy, body weight, oral contraceptive use, smoking and altitude; peak plasma level 15 to 120 minutes after intake; metabolised in the liver by CYP1A2
Read on
Health
How much sleep adults really need: 7 to 9 hours, and why
Life
Screens in the evening and sleep: what the studies found
Life
Early bird or night owl: what your chronotype meansTools that fit
This guide is for general information. It does not replace medical advice or an examination.