Caffeine and sleep: why there's no cutoff time that works for everyone
AI-generated content. How we make it
In brief
- There's no cutoff time that works for everyone. In a healthy adult, it takes caffeine about four hours on average to drop by half, but depending on the person it ranges from two to eight hours.1
- The dose matters, not just the time: a meta-analysis estimates a margin of about 8.8 hours for a 107 mg coffee and 13.2 hours for 217.5 mg.5
- EFSA's 400 mg a day is a general safety figure, not a sleep figure: according to EFSA itself, a single 100 mg dose close to bedtime can already affect some adults' sleep.1
- How fast it's cleared changes with genes, smoking, oral contraceptives, pregnancy or the liver, and sensitivity varies too.286
- Our suggestion: find your margin by changing one thing for a few weeks and writing it down, bearing in mind that the effect can be there even if you don't notice it.4
“No coffee after five,” “six hours before bed,” “eight, to be safe.” The cutoff times going around don't match, and that makes sense: the same cup, at the same time, doesn't leave the same amount of caffeine in two people's bodies at bedtime.
Here you'll see what that time depends on and a simple way to find yours.
How long caffeine stays in the body
Caffeine is absorbed quickly and almost completely: its effects can start 15 to 30 minutes after you take it and last several hours.1 How long they last depends mainly on its half-life, the time it takes the body to clear half of it. According to the European Food Safety Authority (EFSA), in healthy adults it averages about four hours, with a range of two to eight.1 The scientific committee of the Spanish agency, AESAN, puts it at three to seven hours and stresses that it varies a lot from one person to another, and even within the same person.2
That's why the question of when to stop drinking coffee has no single answer. With the same cup at the same time, one person has little caffeine left at bedtime and another quite a bit more:
Figure 1. How much caffeine would be left at midnight from a coffee at 4 p.m.
How much caffeine is in what you drink
The dose matters as much as the time, and it varies a lot from one drink to another. Even among coffees: it depends on the bean, how it's made and the size of the cup.1
| Drink | Serving | Approximate caffeine |
|---|---|---|
| Brewed coffee | 200 ml cup | 90 mg2 |
| Espresso | 60 ml | 80 mg2 |
| Energy drink | 250 ml can | 80 mg3 |
| Energy drink | 500 ml can | 160 mg3 |
| Black tea | 220 ml cup | 50 mg2 |
| Cola | 355 ml can | 40 mg2 |
According to EFSA, up to 400 mg a day spread over the day raises no safety concerns in healthy adults, except during pregnancy, and neither do single doses of up to 200 mg.1 But these are general safety figures, not sleep figures: EFSA itself notes that a single 100 mg dose—a little more than a cup of brewed coffee—can affect the duration and pattern of sleep in some adults, especially if taken close to bedtime.1
And caffeine adds up: tea, colas, energy drinks and chocolate contain it too.13
What the studies add to the question of timing
When we went over the sleep habits with the most support, we already summarized two key studies: an experiment with 400 mg of caffeine taken at different times and a meta-analysis of 24 studies. This is what they add to the question of timing:
- The dose changes the margin. The meta-analysis estimates that, to avoid losing sleep time, a 250 ml cup of coffee with 107 mg should be had at least 8.8 hours before bed, and the usual serving of a pre-workout supplement, with 217.5 mg, at least 13.2 hours before.5 An earlier systematic review had already found that the effect depends on both the dose and the timing.6
- It can affect you without your noticing. In the experiment, caffeine taken six hours before bed reduced sleep measured with a device; in the participants' diaries the difference wasn't clear (about 41 minutes less, without reaching statistical significance). The authors suggest that brief awakenings, which are poorly remembered, could explain part of that difference.4
- It can also shift the clock. According to a review, in a laboratory study under dim light, about 200 mg of caffeine in the early evening delayed the melatonin rhythm, one of the signals of the body clock, by about 40 minutes; that's almost half the delay produced by bright light at bedtime.7 The same review cautions that it isn't clear whether caffeine shifts the clock by itself or increases the clock's response to light.7
Why there's no single time for everyone
The differences are of two kinds: how fast the body clears caffeine and how sensitive it is to it. Habit adds to that.
- Clearance speed. About 95% of caffeine is processed in the liver by a single enzyme, and genetic variants of that enzyme are a likely cause of the differences between people in how fast they clear it.2 Smoking speeds up clearance: it can double the rate.8 Slowing it down, on the other hand, are oral contraceptives, which tend to double the half-life;8 pregnancy, by the end of which the half-life is three to four times longer;2 and liver disease.28 EFSA adds age, body weight and taking certain medicines.1
- Sensitivity. With the same caffeine in the body, not everyone is affected the same way. Some variants of the gene for one of the receptors caffeine acts on are associated with caffeine disrupting sleep more in certain people, including some who consider themselves sensitive to it.78 And older people's sleep may be more sensitive to caffeine than younger people's.6
- Habit. With daily use, the time it takes to fall asleep and sleep efficiency adapt to caffeine; how far tolerance develops in people is still unclear.7 Even so, in population studies, consuming more caffeine is associated with sleeping less or worse, also among people who have it every day.7
None of this can be seen with the naked eye. To decide, the practical thing is to watch how you respond: we explain how below.
If you're pregnant, EFSA gives a separate reference: up to 200 mg a day, counting all sources, raises no safety concerns for the fetus; it applies the same figure to breastfeeding, where what's assessed is the breastfed baby.18 What's right in your case is something to discuss with your midwife or your doctor. And if you take medication regularly, AESAN recommends checking with your health professional before having energy drinks.3
How to find your own margin
A review describes a common cycle: when people sleep too little, they turn to caffeine in the morning to wake up, and that caffeine can cut into their sleep again.8 If you suspect something like this is happening to you, the most useful way to find out is to test it. What follows is our suggestion based on the sources, not the protocol of any study:
- Look at how much you have and when. For a few days, write down every caffeinated drink and its time, including tea, sodas and energy drinks.
- Change just one thing. Move your last dose a few hours earlier, cut it down or switch it to decaf, without touching anything else. It helps to decide it as a concrete plan, such as “if it's after five, decaf”; in the habits guide we explain how these “if–then” plans work.
- Give it a few weeks and write it down. A simple sleep diary is enough: what time you went to bed, how long it took you to fall asleep, how many times you woke up and how you felt when you got up. Keep in mind that the effect can be there even if you don't notice it.4 If you use a watch or a ring, it's worth knowing what they can estimate about your sleep and what they can't.
- Don't judge by the first few days. If you have caffeine every day and stop suddenly, you may get headaches, tiredness or trouble concentrating; these usually start 12 to 24 hours later and last three to seven days.8 Cutting down gradually can help you avoid mistaking those symptoms for the result of the test.
To set up the test more carefully—what to compare, for how long and how not to fool yourself with the result—see how to turn a wellness data point into a question and a test.
If your sleep doesn't improve
Adjusting caffeine is a change of habits, not a treatment. If trouble sleeping persists, see a health professional; in the article on sleep habits we explain when it's worth doing so.
And if some night you try to make up for it with a drink, keep in mind that falling asleep sooner with alcohol isn't sleeping better.
Keep reading
Sleep better without complicating your routine
Which sleep habits have the most support, from caffeine and alcohol to light and regularity, and which one to start with without complicating things.
How to turn a wellness data point into a question and a test
How to frame a change as a question and a test, so you know whether it really works for you without fooling yourself with the result.
Watches and rings that track sleep: what they get right and what they don't
What a watch or a ring can and can't estimate about your sleep, before you use one to judge a change in habits.
Alcohol and sleep: falling asleep faster isn't resting better
Why alcohol helps you fall asleep sooner but disrupts the second half of the night.
Want to turn information into action?
naro helps you prioritize 2–3 high-potential habits and sustain them over time, with context and follow-up.
Sources
Each small number in the text leads to the source that statement rests on. Practical advice without a number is a deduction from these sources, and examples with a person's name are made up. It is general information: it does not replace an assessment by a health professional. How we make this content
Sources consulted up to 26 October 2026.
- Plain-language summary of a scientific opinion. European Food Safety Authority (EFSA) (2015). EFSA explains risk assessment: Caffeine. EFSA. Summarizes EFSA's 2015 scientific opinion on the safety of caffeine in healthy people; it doesn't assess people with illnesses.
- Scientific committee report. Comité Científico de la AESAN (Rubio Armendáriz C, coord., et al.) (2021). Informe del Comité Científico de la Agencia Española de Seguridad Alimentaria y Nutrición (AESAN) sobre los riesgos asociados al consumo de bebidas energéticas. Revista del Comité Científico de la AESAN, no. 33. Focused on energy drinks; it reports EFSA's figures for other drinks.
- Institutional recommendations. Agencia Española de Seguridad Alimentaria y Nutrición (AESAN) (2022). Recomendaciones de consumo de bebidas energéticas. AESAN. Agreed by a working group with several ministries, consumer and family associations, and also beverage and food industry associations.
- Crossover trial. Drake C, Roehrs T, Shambroom J, Roth T (2013). Caffeine effects on sleep taken 0, 3, or 6 hours before going to bed. Journal of Clinical Sleep Medicine. Twelve healthy people with low or moderate habitual caffeine intake; a high dose, 400 mg. The study was funded by the maker of the device used to measure sleep.
- Systematic review and meta-analysis. Gardiner C, Weakley J, Burke LM, et al. (2023). The effect of caffeine on subsequent sleep: a systematic review and meta-analysis. Sleep Medicine Reviews. 24 studies; the margins it proposes are group estimates. We could only read the abstract.
- Systematic review. Clark I, Landolt HP (2017). Coffee, caffeine, and sleep: A systematic review of epidemiological studies and randomized controlled trials. Sleep Medicine Reviews. Most of the studies reviewed were done with adult men from Western countries. We could only read the abstract.
- Narrative review. Reichert CF, Deboer T, Landolt HP (2022). Adenosine, caffeine, and sleep-wake regulation: state of the science and perspectives. Journal of Sleep Research. Brings together animal and human studies; only findings observed in humans are cited here.
- Narrative review. Temple JL, Bernard C, Lipshultz SE, et al. (2017). The Safety of Ingested Caffeine: A Comprehensive Review. Frontiers in Psychiatry. Commissioned by the American Association for the Advancement of Science; one of the authors has served as an expert witness in lawsuits over energy drinks.