Caffeine and Sleep: How Late Is Too Late?
Caffeine can trim your sleep even when you fall asleep easily. Here is what the research says about timing and dose, and how to set a personal cutoff that protects your night.

Quick answer
For most adults, a typical cup of coffee should be finished about 8 to 9 hours before bed. A 2023 review of 24 studies found that a cup with about 107 mg of caffeine needs 8.8 hours to avoid cutting total sleep, and a larger dose of about 218 mg needs 13.2 hours [1]. Smaller amounts matter less: in one trial, 100 mg taken 4 hours before bed had no measurable effect [2].
Key takeaways
- Caffeine keeps you alert by blocking adenosine, a natural brain chemical that helps regulate sleep [3].
- Across studies, caffeine shortened total sleep by about 45 minutes and reduced deep sleep [1].
- A large dose (400 mg) taken 6 hours before bed cut sleep by more than an hour, yet people's sleep diaries did not pick up the problem [4].
- For most adults, up to 400 mg a day is not generally linked to dangerous effects, but timing still matters for sleep [5, 1].
- Older adults and people with certain gene variants tend to be more sensitive to caffeine's effects on sleep [6].
In this article
How does caffeine affect sleep?
Caffeine makes it harder to fall asleep, shortens sleep, and makes sleep lighter [6, 1]. It works by blocking receptors for adenosine, a natural substance that helps regulate the urge to sleep [3]. Caffeine reaches its peak level in your blood within about an hour, and its effects can last 4 to 6 hours [7].
A 2023 meta-analysis (a study that pools the results of many trials) put numbers on the effect. On average, caffeine [1]:
- Cut total sleep time by 45 minutes
- Lowered sleep efficiency, the share of time in bed spent asleep, by 7%
- Added 9 minutes to the time it takes to fall asleep
- Added 12 minutes of time awake after first falling asleep
- Reduced deep sleep by about 11 minutes and increased light sleep by about 6 minutes
An earlier systematic review found the same pattern, with less slow-wave (deep) sleep and more brief awakenings [6].
Caffeine may also shift your body clock. In a controlled study, a dose equal to a double espresso taken 3 hours before bedtime delayed the body's nightly melatonin rhythm by about 40 minutes [8]. Melatonin is the hormone that signals to your body that it is night.
How late is too late for caffeine?
For a regular cup of coffee, about 8 to 9 hours before bed is a sensible cutoff for most people, and for high-caffeine drinks it is closer to 13 hours [1]. The exact line depends on how much you have and how sensitive you are.
Three studies shape this advice:
- 400 mg at 0, 3 or 6 hours before bed. All three timings disrupted sleep compared with a placebo. Even at 6 hours, sleep fell by more than an hour on an objective monitor [4].
- Pooled data from 24 studies. To avoid losing sleep, a 107 mg coffee should come at least 8.8 hours before bed, and a 217.5 mg dose at least 13.2 hours before [1].
- 100 mg versus 400 mg at 4, 8 or 12 hours before bed. The 100 mg dose had no measurable effect even at 4 hours. The 400 mg dose delayed sleep when taken any time within 12 hours of bed and made sleep more broken within 8 hours [2].
The two single trials were small (12 adults in the 2013 study and 23 young men in the 2025 one), so treat the numbers as a guide rather than a hard rule [4, 2].
Your caffeine cutoff by bedtime
This chart applies the 8.8-hour and 13.2-hour cutoffs from the 2023 meta-analysis to common bedtimes [1].
| Your usual bedtime | Last regular coffee (about 107 mg) | Last high-caffeine drink (about 218 mg) |
|---|---|---|
| 9:00 p.m. | About 12:10 p.m. | About 7:50 a.m. |
| 10:00 p.m. | About 1:10 p.m. | About 8:50 a.m. |
| 11:00 p.m. | About 2:10 p.m. | About 9:50 a.m. |
| Midnight | About 3:10 p.m. | About 10:50 a.m. |
A simple decision rule
- About 100 mg or less (for example, 12 ounces of black or green tea [5]): one trial found no measurable sleep effect even 4 hours before bed [2]. Allow more time if you sleep lightly.
- About 107 mg (a standard 250 mL, or 8.5-ounce, cup of coffee): finish it at least 8.8 hours before bed [1].
- About 200 mg or more (a 12-ounce brewed coffee or energy drink can reach about 247 mg [5]): finish it at least 13.2 hours before bed, which means mornings only [1].
How much caffeine is in common drinks?
Caffeine content varies widely, especially in coffee. Here are typical ranges for a 12-ounce serving [5]:
| Drink (12 fl oz) | Caffeine |
|---|---|
| Brewed coffee | 113 to 247 mg |
| Black tea | 71 mg |
| Green tea | 37 mg |
| Caffeinated soft drink | 23 to 83 mg |
| Energy drink | 41 to 246 mg |
For most adults, the FDA cites 400 mg a day, about two to three 12-ounce cups of coffee, as an amount not generally linked to dangerous effects [5]. That daily limit is about safety, not sleep. Three cups before noon and three cups with the last one at 4 p.m. can add up to the same total, but the late cup is far more likely to cost you sleep [1].
Why does caffeine affect some people more than others?
People differ a lot in how fast they clear caffeine and how strongly they react to it [5]. A liver enzyme called CYP1A2 handles about 95% of caffeine breakdown, and gene variations help explain why people break caffeine down at very different speeds [9].
Other factors also change how long caffeine stays in your body [10]:
- Smoking speeds up caffeine clearance, so its effects wear off sooner.
- Birth control pills slow clearance, so caffeine lingers longer.
- Pregnancy, obesity, alcohol and some medicines can also change how caffeine is processed.
Age matters too. The sleep of older adults appears to be more sensitive to caffeine than that of younger adults [6]. Some medicines, including certain antibiotics, asthma drugs and heart medicines, can interact with caffeine [7].
Can you sleep well after an evening coffee?
Some people seem to, but you may not notice the harm. In the 6-hour condition of one study, an objective monitor showed lost sleep while people's own sleep diaries did not [4]. A 2025 trial reached a similar conclusion: people had trouble judging how caffeine affected their sleep [2].
Real-life studies are more mixed. In a study of 785 African American adults, with an average age of about 64, caffeine within 4 hours of bedtime was not linked to that night's sleep length, efficiency or wake time as measured by a wrist monitor [11]. Studies like this cannot prove cause and effect, and people who drink caffeine at night may be the ones least bothered by it.
A daily habit does not seem to fully protect you, either. In a small study of 20 young men, 10 days of daytime caffeine (three 150 mg doses a day) did not change total sleep but delayed dream (REM) sleep, and the men felt more tired on waking than on placebo [12].
How can you cut back without feeling worse?
You can usually trim late-day caffeine with a few small changes:
- Pick a cutoff time from the chart above and set a phone reminder.
- Count every source, including tea, soft drinks and energy drinks [5].
- Taper slowly. Stopping suddenly can cause headaches, sleepiness, irritability, nausea and trouble focusing, which usually ease after a couple of days [7].
- Replace the 3 p.m. coffee with a short walk or another pick-me-up. Our guide to the afternoon energy crash covers what works.
- Look at your sleep. If you need caffeine to function every afternoon, you may simply be short on sleep. See how much sleep adults need.
When to see a doctor
Talk with a health professional if:
- You still have insomnia after cutting caffeine for a few weeks. People with sleep disorders are advised to ask a provider about limiting caffeine [7].
- You are very sleepy during the day despite enough time in bed. Ask about a possible sleep disorder, and see our guide to the signs of sleep apnea.
- You have heart rhythm problems, high blood pressure, anxiety, migraines or acid reflux. People with these conditions are advised to check with a provider about caffeine [7].
- You are pregnant, trying to become pregnant or breastfeeding [5].
- You get a racing heart, jitters, anxiety, upset stomach or headaches from caffeine [5].
Get emergency care for a seizure or signs of a severe reaction after a large amount of caffeine. Toxic effects such as seizures can occur after taking about 1,200 mg quickly, and pure or highly concentrated caffeine products can be deadly [5].
Frequently asked questions
How long does caffeine stay in your system?
Caffeine peaks in your blood within about an hour, and you may feel it for 4 to 6 hours [7]. Its effect on sleep can last much longer: pooled studies suggest a typical coffee needs at least 8.8 hours to avoid cutting into sleep [1]. How quickly you clear it varies with genes, smoking, birth control pills and pregnancy [9, 10].
Can an afternoon coffee make me wake up at night?
It can. In pooled studies, caffeine added about 12 minutes of wake time after people first fell asleep and shifted sleep toward lighter stages [1]. A 400 mg dose made sleep more broken when taken within 8 hours of bed [2]. If that sounds familiar, see our guide to waking up at 3 a.m.
Is tea a better choice than coffee in the afternoon?
Usually, yes, because it has less caffeine. A 12-ounce cup of green tea has about 37 mg and black tea about 71 mg, compared with 113 to 247 mg for brewed coffee [5]. In one trial, 100 mg taken 4 hours before bed had no measurable effect on sleep, so a cup of tea in the mid-afternoon is less likely to cause problems [2].
Does caffeine affect deep sleep even if I fall asleep fine?
If I drink coffee every day, am I used to its effects?
Not completely. Sleep effects can remain with daily use. In a 10-day study of young men, daily caffeine delayed REM sleep and left them feeling more tired on waking compared with placebo [12].
This article is for general information and isn't a substitute for advice from your doctor. Health needs differ from person to person. See our medical disclaimer.
References
Every health claim in this article links to one of these sources. How we write and check articles.
- Gardiner C, Weakley J, Burke LM, et al. The effect of caffeine on subsequent sleep: A systematic review and meta-analysis. Sleep Med Rev. 2023;69:101764 pubmed.ncbi.nlm.nih.gov
- Gardiner CL, Weakley J, Burke LM, et al. Dose and timing effects of caffeine on subsequent sleep: a randomized clinical crossover trial. Sleep. 2025;48(4):zsae230 pmc.ncbi.nlm.nih.gov
- Reichert CF, Deboer T, Landolt HP. Adenosine, caffeine, and sleep-wake regulation: state of the science and perspectives. J Sleep Res. 2022;31(4):e13597 pmc.ncbi.nlm.nih.gov
- 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;9(11):1195-1200 pmc.ncbi.nlm.nih.gov
- US Food and Drug Administration. Spilling the Beans: How Much Caffeine Is Too Much? Content current as of August 28, 2024 fda.gov
- Clark I, Landolt HP. Coffee, caffeine, and sleep: A systematic review of epidemiological studies and randomized controlled trials. Sleep Med Rev. 2017;31:70-78 pubmed.ncbi.nlm.nih.gov
- MedlinePlus. Caffeine. Updated September 8, 2021 medlineplus.gov
- Burke TM, Markwald RR, McHill AW, et al. Effects of caffeine on the human circadian clock in vivo and in vitro. Sci Transl Med. 2015;7(305):305ra146 pmc.ncbi.nlm.nih.gov
- Nehlig A. Interindividual Differences in Caffeine Metabolism and Factors Driving Caffeine Consumption. Pharmacol Rev. 2018;70(2):384-411 pubmed.ncbi.nlm.nih.gov
- Grzegorzewski J, Bartsch F, Köller A, König M. Pharmacokinetics of Caffeine: A Systematic Analysis of Reported Data for Application in Metabolic Phenotyping and Liver Function Testing. Front Pharmacol. 2021;12:752826 pmc.ncbi.nlm.nih.gov
- Spadola CE, Guo N, Johnson DA, et al. Evening intake of alcohol, caffeine, and nicotine: night-to-night associations with sleep duration and continuity among African Americans in the Jackson Heart Sleep Study. Sleep. 2019;42(11):zsz136 pmc.ncbi.nlm.nih.gov
- Weibel J, Lin YS, Landolt HP, et al. Regular Caffeine Intake Delays REM Sleep Promotion and Attenuates Sleep Quality in Healthy Men. J Biol Rhythms. 2021;36(4):384-394 pmc.ncbi.nlm.nih.gov


