Caffeine and sleep are closely linked, and how late you have your last cup can make a meaningful difference to the night ahead. Leave about nine hours between a full-strength coffee and bedtime. That is the figure a 2023 meta-analysis arrived at, which put the gap at 8.8 hours for a coffee containing 107 mg of caffeine.
A single small cup may be more forgiving. In a 2025 randomised crossover trial, 100 mg of caffeine four hours before bed produced no measurable change in sleep efficiency, total sleep time or how long people took to fall asleep. The same trial gave 400 mg, roughly four cups, and found total sleep time cut by more than 50 minutes at that timing.
That gap between one cup and four is the whole story. Most people asking this question do not need to give up chai or coffee. They need to move the dose, and shrink the late one.
Caffeine and sleep relationship: How caffeine keeps you awake
Adenosine is the brain chemical that builds sleep pressure and makes you feel increasingly ready for sleep. Caffeine gets in its way.
A 2026 systematic review in Nutrients describes caffeine as acting “primarily through antagonism of adenosine A1 and A2A receptors, thereby reducing sleep pressure and promoting wakefulness”. The Institute of Medicine’s pharmacology review describes the same mechanism: caffeine and its metabolite paraxanthine compete with adenosine for the same receptors, and the review calls this ability to inhibit adenosine receptors “highly important” in caffeine’s effects on behaviour and cognitive function.
The important word is reducing. Caffeine does not create energy in the way food or sleep does. It temporarily blocks the brain’s signal that sleep pressure is building, making you feel more alert while that underlying pressure continues to accumulate.
The five-hour half-life, and why it misleads people
Caffeine gets into you fast. The Institute of Medicine review reports that 99 per cent is absorbed within 45 minutes, with blood levels peaking somewhere between 15 and 120 minutes after you drink it.
Getting rid of it takes far longer. The mean half-life in healthy adults is about five hours, but the review is clear that the real range runs from 1.5 to 9.5 hours.
That range is where most bad advice comes from. If you sit at the fast end, a 4 pm coffee is largely gone by bedtime. If you sit at the slow end, half of it is still circulating at midnight. The same cup, the same time, two completely different nights.
Some of what moves you along that range is known. The same review notes that oral contraceptive use can double caffeine’s half-life, and that smoking speeds up caffeine metabolism. Mayo Clinic puts the practical version plainly: caffeine affects some people more than others, and if you are one of those people, even small amounts can leave you restless or unable to sleep.
What the trials actually found
Three good pieces of evidence sit behind the timing advice, and they agree with each other more than they disagree.
The 2025 dose and timing trial
The most directly useful study is a placebo-controlled, double-blind, randomised crossover trial published in Sleep in April 2025 by Carissa Gardiner and colleagues. Twenty-three men, average age 25, took either 100 mg or 400 mg of caffeine at 12, 8 or 4 hours before bedtime, and their sleep was measured each time.
Read the numbers with that sample in mind. This was a small trial in young men, so the exact minute counts will not transfer cleanly to women, to older adults, or to heavy habitual drinkers.
At 100 mg, nothing measurable happened to sleep efficiency, total sleep time or how long it took to fall asleep, at any of the three timings.
At 400 mg, the picture changed sharply.
| When 400 mg was taken | What happened to sleep |
|---|---|
| 4 hours before bed | Sleep efficiency down 9.5 per cent, total sleep time down 50.6 minutes, time to fall asleep up 14.2 minutes |
| 8 hours before bed | Sleep efficiency down 6.9 per cent, time awake during the night up 29.1 minutes, deep sleep down 15.3 minutes |
| 12 hours before bed | Deep sleep down 20.6 minutes, time to reach settled sleep up 15.3 minutes |
The authors’ conclusion is worth reading twice: “A 100 mg dose of caffeine can be consumed up to 4 hours before bedtime, but 400 mg may negatively impact sleep when consumed as one dose within 12 hours of bedtime, with the adverse influence on sleep increasing the closer consumption occurs to bedtime.”
A single 400 mg hit at 11 am, in other words, may still show up in that night’s sleep if you go to bed at 11 pm.
The 8.8-hour rule
A 2023 systematic review and meta-analysis in Sleep Medicine Reviews, led by the same first author, set out specifically to find the time after which caffeine should not be consumed before bed. Across the studies it pooled, caffeine reduced total sleep time by 45 minutes and sleep efficiency by 7 per cent.
Its headline figure is the one that has travelled: a coffee containing 107 mg per 250 mL should be taken at least 8.8 hours before bedtime. For a pre-workout supplement at 217.5 mg, the review put the gap at 13.2 hours.
Note that 8.8 hours is a floor, not a target, which is why this article rounds it up to nine rather than down to eight.

The study that showed you will not notice
In 2013, Christopher Drake and a research team at the Henry Ford Sleep Disorders and Research Center gave 12 healthy sleepers 400 mg of caffeine at bedtime, three hours before bed, and six hours before bed. All three timings significantly disrupted sleep. Taken six hours before bed, caffeine reduced objectively measured total sleep time by more than an hour.
Then the part that matters most. According to the American Academy of Sleep Medicine’s write-up, “subjective reports suggest that participants were unaware of this sleep disturbance”. Drake’s own summary: people tend to be less likely to detect the disruptive effects of caffeine on sleep when it is taken in the afternoon.
So “coffee doesn’t affect my sleep” is not evidence. It is exactly what the people in the study said while losing an hour of it.
Caffeine does not only shorten sleep. It thins it
Even when you sleep the same number of hours, the sleep can be worse.
The 2026 Nutrients review examined 32 studies of caffeine’s effect on sleep brainwave activity. Its most consistent finding across those studies was suppression of slow-wave activity and the lowest delta frequencies, which is the deep, physically restorative part of the night. Caffeine also frequently increased faster brain activity, producing what the authors call “a lighter, more aroused, and more wake-like sleep EEG profile”.
The reviewers add a caution that explains a lot of arguments about this topic. Brainwave measures were more sensitive than conventional sleep-stage scoring at picking up the damage. Sleep that looks normal on a summary can still be measurably shallower.
Which matters if you have ever counted seven hours in bed and still felt short-changed the next day. Sleep that comes up shallow is one of several things worth ruling out when the daytime symptom is brain fog rather than obvious sleepiness.
It also shifts your body clock
There is a second effect, separate from the alertness one.
Researchers at the University of Colorado Boulder gave participants the caffeine equivalent of a double espresso, 200 mg, three hours before bedtime. The result, published in Science Translational Medicine in September 2015, was roughly a 40-minute delay in the nightly circadian rhythm.
For context, the team reported that this was about half the delay produced by three hours of bright overhead light.
An evening coffee, then, does two things at once. It blocks the sleep signal, and it nudges your body clock later.
How much caffeine is actually in your cup
Guidance in milligrams is useless unless you know what you are drinking. The US Food and Drug Administration gives these figures per 12 fluid ounce serving, which is about 350 mL, a large mug rather than a small cup.
| Drink (12 fl oz, about 350 mL) | Caffeine |
|---|---|
| Coffee | 113 to 247 mg |
| Black tea | 71 mg |
| Energy drinks | 41 to 246 mg |
Mayo Clinic works to a rougher rule that is easier to hold in your head: 400 mg is about four cups of brewed coffee, so a cup is around 100 mg. The FDA is less generous, describing 400 mg as about two to three of its 12 fl oz servings, which puts a serving somewhere between 133 and 200 mg.
Do not skip past that disagreement, because it decides whether the 100 mg allowance applies to you. A small home cup is plausibly near 100 mg. A large mug of strong coffee or a double shot is not, and should be treated as the 400 mg case rather than the 100 mg one.
The other figure worth noticing is the energy drink. At the top of its range, a single can at 246 mg carries well over twice that 100 mg rule of thumb, which is why an evening can is a poor idea, however light it feels.
The safe daily limits
For healthy adults, both major regulators land in the same place.
The FDA describes 400 mg a day as an amount not generally associated with negative effects in healthy adults. The European Food Safety Authority agrees on 400 mg a day spread across the day, and adds a second figure that matters more for sleep: single doses of up to 200 mg do not raise safety concerns for healthy adults.
EFSA also notes, in the same assessment, that single doses of 100 mg “may affect sleep duration and patterns in some adults, particularly when consumed close to bedtime”. That is one cup of coffee. Safety and sleep are two different questions, and the sleep threshold is the lower one.
For pregnancy, EFSA assesses that intakes from all sources of up to 200 mg a day do not raise safety concerns for the foetus. The ICMR-NIN Dietary Guidelines for Indians, published in 2024, are firmer in tone, advising that excess intake of caffeinated beverages adversely affects foetal growth and should be minimised. The FDA’s advice, sensibly, is to talk to your own doctor about it.
For children and adolescents, EFSA proposes 3 mg per kilogram of body weight per day. The FDA notes that medical experts advise against energy drinks for children and teenagers altogether, given the sugar and caffeine levels.
The Indian angle: it is not only about bedtime
Indian dietary guidance adds a second timing problem that has nothing to do with sleep.
The ICMR-NIN 2024 guidelines advise: “Don’t consume tea, coffee and other caffeinated drinks along with meals or soon after meals.” The reason is iron. The guidelines state that beverages such as tea bind dietary iron and make it unavailable, and that tea should be avoided before, during or soon after a meal, or while taking iron and folic acid supplements.
The guidelines do not define how long “soon after” means, so the practical version is to put a clear gap between the meal and the chai rather than drinking one on top of the other. If you are already watching for signs of a nutrient deficiency, moving your tea away from meals and supplements is a free fix.
Who should be stricter than the eight-hour rule
Some people need a wider gap than the average.
- Slow metabolisers. If caffeine has ever kept you up despite a morning-only habit, assume you sit at the long end of that 1.5 to 9.5 hour range.
- Anyone using oral contraceptives, given that the Institute of Medicine review reports these can double caffeine’s half-life.
- People with insomnia. The American Academy of Sleep Medicine’s general healthy sleep habits guidance already says to avoid caffeine in the afternoon or evening, with no dose allowance attached. If you are sleeping badly, that is the version to follow.
- People with reflux, who may already be avoiding drinks late in the evening. Our guide to acid reflux and GERD covers the wider trigger list.
- People managing blood pressure. Caffeine intake is worth raising with your doctor if you are already working on hypertension.
- Anyone prone to anxiety. Mayo Clinic notes that in sensitive people, even small amounts can cause restlessness. If that is you, the caffeine cut-off belongs alongside the rest of your stress and anxiety toolkit.
A cut-off you can actually keep
- Fix your bedtime first. The AASM advises setting a bedtime early enough for at least seven to eight hours of sleep, and getting up at the same time every day, including weekends. Every other rule here depends on knowing what time bed actually is.
- Count back nine hours for a full-strength cup. For an 11 pm bedtime, that is 2 pm. Make that your default last proper coffee.
- Shrink, do not just shift. If a 5 pm chai is non-negotiable, make it the small one. In the 2025 trial, a 100 mg dose behaved very differently from a 400 mg one.
- Add up the day, not just the cup. Coffee, tea, energy drinks and pre-workout supplements all count towards the same 400 mg daily ceiling.
- Watch the single big hit. A 400 mg pre-workout at 6 pm is not the same as 400 mg spread across a day. The 2023 meta-analysis put the gap for a 217.5 mg pre-workout serving at 13.2 hours, and a 400 mg dose is nearly double that.
- Replace the ritual, not just the drink. Most evening chai is about winding down, not caffeine. A wind-down practice such as yoga nidra does the same job without the pharmacology.
- Give it two weeks before judging. You are not testing how you feel tonight. You are testing what your mornings look like after a fortnight.
Frequently asked questions
Is it fine to have coffee at 4 pm?
It depends on the size. In the 2025 Sleep trial, 100 mg four hours before bed produced no measurable change in sleep efficiency, total sleep time or time taken to fall asleep, while 400 mg at the same point cut total sleep time by 50.6 minutes. One small cup at 4 pm before an 11 pm bedtime is defensible. A large or double-shot coffee is not. EFSA’s assessment is more cautious still, noting that even a single 100 mg dose may affect sleep in some adults when taken close to bedtime.
How long before bed should I stop caffeine?
The 2023 meta-analysis in Sleep Medicine Reviews put the gap for a coffee containing 107 mg at 8.8 hours before bedtime, and 13.2 hours for a 217.5 mg pre-workout dose. Nine hours is a safe working rule for a full-strength coffee. A small 100 mg cup may be fine closer in, but that is the less conservative reading.
Does caffeine still affect me if I fall asleep easily?
Very possibly. In the 2013 Henry Ford study, 400 mg six hours before bed cut measured sleep by more than an hour, yet participants did not report noticing any disturbance. Falling asleep quickly is not proof that the sleep itself was undamaged.
Does tea count, or only coffee?
It counts. The FDA puts black tea at 71 mg per 12 fl oz serving, against 113 to 247 mg for coffee. Tea is lower, not zero, and several small cups across an evening add up.
How long does caffeine stay in your system?
The mean half-life is about five hours, with a documented range of 1.5 to 9.5 hours. After one half-life, half the dose is still in you. That is why a 3 pm coffee is not necessarily gone by 11 pm.
How much caffeine a day is safe?
The FDA and EFSA both treat 400 mg a day as not generally raising concerns for healthy adults, with EFSA adding that single doses of up to 200 mg do not raise safety concerns either. Pregnancy is different: EFSA assesses up to 200 mg a day as safe for the foetus, and ICMR-NIN advises minimising caffeine.
Can caffeine damage my sleep even if I sleep the same number of hours?
Yes. In the 2026 Nutrients review, suppression of slow-wave activity, the deepest part of the night, was the most consistent finding across the 32 studies examined, alongside what the authors call a lighter, more wake-like sleep profile. In the 2025 trial, 400 mg taken a full twelve hours before bed still cut deep sleep by 20.6 minutes.
Will cutting caffeine fix my insomnia?
It may help, and the AASM includes avoiding afternoon and evening caffeine in its standard sleep habits guidance. But persistent insomnia has other drivers, and if poor sleep has lasted more than a few weeks, it is worth seeing a doctor rather than only adjusting your chai.
The bottom line
Nine hours before bed, for a full-strength coffee, is a rule with real evidence behind it. Dose matters at least as much as timing: one cup and four cups are pharmacologically different events, and the trials treat them that way.
And if you have ever said caffeine does not affect your sleep, the useful test is not how you feel tonight. It is what two weeks of an early-afternoon cut-off does to your mornings.
This article is for general information and is not a substitute for personal medical advice. If you have persistent sleep problems, a heart condition, high blood pressure, or you are pregnant, talk to your doctor about your caffeine intake rather than adjusting it on your own.
Sources
- Carissa L Gardiner, Jonathon Weakley, Louise M Burke, Francesca Fernandez, Rich D Johnston, Josh Leota, Suzanna Russell, Gabriella Munteanu, Andrew Townshend, Shona L Halson, ‘Dose and timing effects of caffeine on subsequent sleep: a randomized clinical crossover trial’, Sleep, 48(4), 2025.
- C Gardiner et al., ‘The effect of caffeine on subsequent sleep: A systematic review and meta-analysis’, Sleep Medicine Reviews, Elsevier, 2023.
- J Chmiel and D Kurpas, ‘The Caffeinated Brain Part 2: The Effect of Caffeine on Sleep-Related Electroencephalography (EEG), A Systematic and Mechanistic Review’, Nutrients, 18(8):1220, 2026.
- Institute of Medicine, ‘Pharmacology of Caffeine’, in Caffeine for the Sustainment of Mental Task Performance, National Academies Press.
- European Food Safety Authority, ‘EFSA explains risk assessment: Caffeine’, 2015.
- ICMR-NIN, ‘Dietary Guidelines for Indians’, National Institute of Nutrition, 2024.
- US Food and Drug Administration, ‘Spilling the Beans: How Much Caffeine is Too Much?’.
- American Academy of Sleep Medicine, ‘Late afternoon and early evening caffeine can disrupt sleep at night’, reporting Drake C et al., Journal of Clinical Sleep Medicine, 2013.
- American Academy of Sleep Medicine, ‘Healthy Sleep Habits’, Sleep Education.
- University of Colorado Boulder, ‘Caffeine at night delays human circadian clock’, reporting Burke T et al., Science Translational Medicine, 2015.
- Mayo Clinic, ‘Caffeine: How much is too much?’.
