Caffeine and Sleep: When to Stop Drinking Coffee
How caffeine really works: adenosine blockade, half-life and CYP1A2 genetics, EFSA safe limits, and the evidence-based cut-off time from a 2023 meta-analysis.

Contents
For a standard cup of coffee — roughly 100 mg of caffeine — the safe cut-off is about 9 hours before bed; for a large dose of 200 mg or more it stretches to 13 hours, according to a 2023 meta-analysis of controlled trials. With an 11 pm bedtime that means your last ordinary coffee around 2 pm. But the number matters less than the mechanism behind it: caffeine does not supply energy, it blocks your perception of the tiredness you have already accumulated, which is why "I drink coffee late and sleep great" almost never means your sleep was untouched.
What caffeine actually does
Every hour you are awake, adenosine accumulates in the brain as a by-product of neuronal energy metabolism. It binds to A1 and A2A receptors and dampens neural activity, which you experience as gradually mounting sleepiness. Sleep researchers call this homeostatic sleep pressure — the longer you have been awake, the heavier it gets. Sleep clears it, and the next morning the cycle restarts from near zero.
Caffeine resembles adenosine closely enough to occupy the same receptors, but not closely enough to activate them. It sits in the lock without turning it. The adenosine itself does not disappear; it keeps building up in the background while the brain stops receiving the signal.
Three practical consequences follow, and they are rarely spelled out.
Caffeine is not a source of energy. A cup of coffee contains no calories and nothing that replenishes any resource. It releases a brake rather than adding fuel. The alertness you feel afterwards is your own baseline activity, temporarily un-inhibited.
Your sleep debt keeps growing. Nothing about caffeine substitutes for what sleep does — memory consolidation, metabolic and immune housekeeping, clearance of metabolic waste. Four hours of sleep plus three coffees is still four hours of sleep; you have only made yourself worse at noticing it.
The crash is built in. When caffeine clears the receptors, all the adenosine that accumulated in the meantime binds at once. That is the abrupt slump a few hours after a large dose, usually misattributed to a "sugar drop".
Half-life: why "it wears off in five hours" is misleading
In healthy adults, caffeine's half-life averages 4 to 6 hours — the time it takes to eliminate half a dose. So of 200 mg taken at 3 pm, roughly 100 mg is still circulating at 8 pm and around 50 mg at 1 am. That residue is the equivalent of drinking half an espresso as you get into bed.
The word carrying all the weight in that sentence is "averages". Between healthy individuals the range runs from about 2 to 10 hours, and it is a stable personal trait, not measurement noise. The same after-dinner cappuccino is gone by midnight for one person and still working at sunrise for another.
What sets your clearance rate
Around 95% of caffeine is broken down in the liver by the enzyme CYP1A2. Anything that changes that enzyme's activity changes how long caffeine stays with you.
Genetics. Carriers of the fast CYP1A2 variant metabolise caffeine substantially quicker than slow metabolisers. This explains a lot of apparent willpower differences: people who stop at one morning cup often do so not out of discipline but because a second one visibly wrecks their night.
Hormonal contraceptives. Oestrogen-containing formulations inhibit CYP1A2 and roughly double caffeine's half-life. In practice, if you are on a combined oral contraceptive, your personal cut-off belongs several hours earlier than the standard advice.
Pregnancy. The slowdown is larger still and deepens through gestation, with half-life in the third trimester reported at two to three times baseline. This is one reason pregnancy has its own, stricter limit rather than a proportional adjustment.
Smoking. Polycyclic aromatic hydrocarbons in tobacco smoke induce CYP1A2 and nearly halve caffeine's half-life. Hence an underappreciated side effect of quitting: your habitual five cups start behaving like eight, producing anxiety, jitteriness and insomnia that get blamed on nicotine withdrawal. Cutting coffee by about a third at the same time as quitting prevents most of it.
Age and liver function. Clearance slows in older adults and in liver impairment. Children and adolescents metabolise caffeine faster than adults but are more sensitive to its central effects.
The answer to the question in the title
The 2023 meta-analysis by Gardiner and colleagues pooled experimental studies in which caffeine was given in controlled doses and sleep was measured objectively — by polysomnography and actigraphy, not questionnaires. From the pooled data the authors derived quantitative guidance on when to stop so that caffeine does not shorten total sleep time:
- a standard cup of coffee, ~100 mg — about 8.8 hours before bed;
- a large dose, ~200 mg and above — up to 13 hours before bed.
An earlier trial by Drake and colleagues in 2013 shows why folk guidance falls short. Participants took 400 mg of caffeine 0, 3 and 6 hours before bed. Sleep disruption was significant in all three conditions, including the dose taken six hours ahead — and critically, participants in that condition did not notice any impairment, while objectively losing around an hour of sleep.
The practical rule that follows: go by the clock and the dose, not by how you feel.
| Bedtime | One cup (~100 mg) | 200 mg or more |
|---|---|---|
| 10:00 pm | by 1:00 pm | by 9:00 am |
| 11:00 pm | by 2:00 pm | by 10:00 am |
| 12:00 am | by 3:00 pm | by 11:00 am |
| 1:00 am | by 4:00 pm | by 12:00 pm |
For your own dose and bedtime, the calculator below runs the same arithmetic — including how much caffeine is still circulating when you lie down, which the table above does not show.
Or pick a drink
Still in your body at bedtime
What this means: Enough to delay sleep onset and cut slow-wave sleep. Even if you fall asleep quickly, the architecture of your sleep changes.
How the level falls
Half-life. Half the dose is gone by 19:00, and a quarter is still there at 00:00.
⏰ Your cut-off for this dose
To be under 30 mg by bedtime, this dose needs to be finished by 09:19 — 13.7 h before sleep. You are already past that time.
These are averages. Real clearance depends on your CYP1A2 genotype, medication and liver health, and varies several-fold between people.
Читайте также: Caffeine Calculator: How Long Will Caffeine Keep You Awake?
"But I fall asleep fine" is not evidence
The standard objection to any cut-off is that the person drinks an espresso after dinner and is asleep in ten minutes. It holds up right until someone measures the sleep rather than asking about it.
The systematic review by Clark and Landolt summarises the pattern: caffeine lengthens sleep onset latency, shortens total sleep time and — most importantly — reduces slow-wave sleep and delta power, the objective marker of sleep depth. It simultaneously increases the share of light stage 1 sleep and the number of awakenings.
The key point is that none of this requires insomnia to be present. You can fall asleep quickly, log a full eight hours and still get a night that is measurably shallower than it should have been. Subjectively it registers as "slept fine, woke up flat" — which is precisely the state that produces one more cup in the morning.
There is a circadian effect layered on top. Evening caffeine delays the rise of melatonin and shifts the internal clock later. So it is not only that tonight is worse; tomorrow night is harder to start on time.
Читайте также: Sleep Hygiene: 12 Rules That Actually Work
How much caffeine is in what you drink
The most common counting error is thinking in cups rather than milligrams. An espresso in a small cup carries less caffeine than a large mug of filter coffee, even though it tastes far stronger. Variation within a single category is wide too, driven by bean variety, grind, brew method and serving size.
| Drink or food | Serving | Caffeine, mg |
|---|---|---|
| Espresso | 30 ml (single shot) | 60–80 |
| Filter coffee / americano | 250 ml (8 oz) | 90–120 |
| Cappuccino, latte (single shot) | 250–350 ml | 60–80 |
| Instant coffee | 250 ml | 60–80 |
| Decaf coffee | 250 ml | 2–5 |
| Large takeaway coffee | 450 ml (16 oz) | 150–250 |
| Black tea | 250 ml | 40–50 |
| Green tea | 250 ml | 25–40 |
| Matcha | 250 ml | 60–70 |
| Cola | 330 ml | 30–40 |
| Energy drink, standard can | 250 ml | 80 |
| Energy drink, large can | 500 ml | 150–160 |
| Pre-workout supplement | 1 scoop | 150–300 |
| Dark chocolate, 70% | 50 g | 20–40 |
| Milk chocolate | 50 g | 5–10 |
Hidden sources deserve their own line: combination painkillers containing caffeine, cold and flu remedies, fat burners, chewing gums and sports gels. Someone convinced they drink "only two coffees" can easily be at 500 mg once a pre-workout scoop and a headache tablet are counted.
Safe intake: the EFSA numbers
The 2015 scientific opinion from the European Food Safety Authority remains the standard reference:
- up to 400 mg per day from all sources raises no safety concern for healthy adults;
- up to 200 mg in a single dose, including within two hours of intense exercise;
- up to 200 mg per day during pregnancy and breastfeeding;
- about 3 mg per kg of body weight per day as the reference point for children and adolescents.
One caveat matters more than the numbers themselves: 400 mg is a general safety ceiling, not a sleep threshold. You can stay comfortably inside the daily allowance and still ruin the night by taking all of it at 6 pm. Dose and timing are independent variables and both need watching.
Tolerance and withdrawal
Tolerance to some of caffeine's effects develops within days of regular use: the brain upregulates adenosine receptors to compensate for the blockade. This is why the habitual cup eventually stops producing a lift and merely restores baseline — you drink coffee to stop feeling bad rather than to feel good.
The important nuance is that tolerance to the subjective buzz builds faster than tolerance to the sleep disruption. People stop noticing the effect of an evening coffee long before that coffee stops damaging their sleep. That mismatch is the entire basis of the "it doesn't affect me" illusion.
Caffeine withdrawal is a well-characterised syndrome, not folklore. After stopping regular intake, symptoms appear within 12 to 24 hours, peak on day one or two, and resolve over roughly 2 to 9 days. The typical picture is headache (the most common symptom), fatigue, poor concentration, irritability, and sometimes nausea and muscle aches. It occurs at habitual intakes as low as about 100 mg a day — a single cup.
Energy drinks and teenagers
Two facts combine badly in adolescence. First, puberty shifts circadian timing later as a matter of biology, so natural sleep onset drifts while school start times do not — chronic sleep restriction arrives without any help from caffeine. Second, the 3 mg per kg reference means a 50 kg teenager reaches their daily ceiling at 150 mg, which one large energy drink exceeds on its own.
Temple's 2019 review of caffeine in children and adolescents describes the loop clearly: energy drinks are consumed to compensate for insufficient sleep, they degrade the following night, and that increases demand for the next can. Layered on top are a consistent association between energy drink use and other risk-taking behaviours, and the delivery pattern itself — a can is drunk in minutes, whereas coffee is sipped over an hour.
Practical family guidance: no energy drinks before 18, no caffeine after lunch on school days, and an audit of the non-obvious sources — caffeine tablets, gum, and pre-workout supplements among teenagers who train.
Читайте также: How to Manage Stress: Evidence-Based Techniques
A plan for moving your cut-off
- Spend a week counting milligrams, not cups. Log coffee, tea, cola, chocolate, painkillers and supplements. The total usually surprises people.
- Set your cut-off from the table. Count back 9 hours from your actual bedtime. If you take hormonal contraceptives, are pregnant, or suspect slow metabolism, use 11 to 12 hours.
- Move it gradually. Shifting by an hour every three or four days passes unnoticed; dropping the evening cup outright often produces a two-day headache.
- Cut the total by 25% at a time if you are above 400 mg. The easy method is blending regular and decaf in a changing ratio.
- Move volume to the morning rather than removing it. Your daily total can stay the same: a cup at 8 am and another at noon affects sleep incomparably less than the same two cups at noon and 5 pm.
- Judge the result after two weeks by how mornings feel, not by how fast you fall asleep. The sense of waking up restored is usually the first thing to return.
- Stop propping up sleep debt with caffeine. If your alertness exists only on top of a dose, the problem is the sleep, not the coffee.
Caffeine is among the best-studied and broadly safest psychoactive substances available, and giving it up for the sake of sleep is not the goal. The goal is to stop treating it as energy and start treating it as a drug with known pharmacokinetics: it has a dose, a duration and a last acceptable time of day. Getting the third one right usually does more for your sleep than the entire wind-down routine that follows it.
Читайте также: Heart Rate Zones: How to Calculate and Why Zone 2 Matters
FAQ
How many hours before bed should I stop drinking coffee?+
A 2023 meta-analysis puts the cut-off at roughly 8.8 hours before bedtime for a standard cup of coffee (about 100 mg of caffeine) and up to 13 hours for a large dose of 200 mg or more. For an 11 pm bedtime that means a last ordinary coffee around 2 pm, and before 10 am for the bigger doses.
I drink coffee at night and sleep fine. Does that mean caffeine does not affect me?+
It almost certainly affects you, just not your sleep onset. Controlled studies show caffeine reduces slow-wave sleep and delta power even in people who fall asleep quickly and report no difference. How your sleep feels is a poor guide to how it is structured.
How much caffeine per day is safe?+
EFSA considers up to 400 mg a day from all sources safe for healthy adults, and up to 200 mg in a single dose. During pregnancy and breastfeeding the limit is 200 mg a day. For children and adolescents the reference point is about 3 mg per kg of body weight.
Why does caffeine hit some people so much harder?+
The main driver is the CYP1A2 gene, which sets how fast your liver clears caffeine, plus anything that alters that same enzyme. Hormonal contraceptives and pregnancy roughly double or more the half-life; smoking nearly halves it.
Does coffee help after a bad night's sleep?+
It masks sleepiness without restoring what sleep provides. Worse, an afternoon or evening dose degrades the next night too, so you need more caffeine the following morning — a self-sustaining loop that keeps the underlying sleep debt in place.
What causes the headache when I quit coffee?+
That is caffeine withdrawal. Headache, fatigue and irritability start 12 to 24 hours after the last dose, peak on day one or two, and resolve within 2 to 9 days. Taper by about 25% every three or four days and most people avoid it entirely.
References
- 1.Gardiner C et al. The effect of caffeine on subsequent sleep: A systematic review and meta-analysis. Sleep Med Rev, 2023
- 2.EFSA Panel on Dietetic Products, Nutrition and Allergies (NDA). Scientific Opinion on the safety of caffeine. EFSA Journal, 2015
- 3.Drake C, Roehrs T, Shambroom J, Roth T. Caffeine effects on sleep taken 0, 3, or 6 hours before going to bed. J Clin Sleep Med, 2013
- 4.Clark I, Landolt HP. Coffee, caffeine, and sleep: A systematic review of epidemiological studies and randomized controlled trials. Sleep Med Rev, 2017
- 5.Nehlig A. Interindividual Differences in Caffeine Metabolism and Factors Driving Caffeine Consumption. Pharmacol Rev, 2018
- 6.Temple JL. Review: Trends, Safety, and Recommendations for Caffeine Use in Children and Adolescents. J Am Acad Child Adolesc Psychiatry, 2019
Read next

Sleep Hygiene: 12 Rules That Actually Work
Sleep hygiene rules sorted by strength of evidence: what genuinely improves sleep, what is oversold, and why chronic insomnia needs CBT-I instead.

Does Melatonin Work, and Who Actually Needs It?
Melatonin is a timing signal, not a sedative. The honest effect size, the dose and timing that matter, the supplement quality problem, and who really benefits.
Jet Lag: Why It Happens and How to Reset Faster
What jet lag is, why flying east is harder than west, and which methods — light, melatonin, schedule — genuinely speed up resetting your body clock.

Chronotypes: Night Owl, Early Bird and Living With Your Clock
What a chronotype is and how innate it really is, how to identify yours, what social jetlag costs you, and whether you can shift your schedule — with a realistic two-week plan.

Napping: How Long, When, and Who Benefits
The optimal nap is 10–20 minutes. Learn about sleep inertia after long naps, the coffee nap, when napping hurts night sleep, and who should skip it.

How Much Sleep Do You Need? Norms by Age
How many hours of sleep adults and children actually need, why long sleep also shows up in risk charts, and how to find the number that works for you.