Is Coffee Bad for Sleep?

Almost every adult enjoys a cup of coffee every day. It’s warming, comforting, and—for many—essential to getting through the day. In fact, 2 in 3 Americans make coffee at home daily, and 87% say they’re at least somewhat coffee-obsessed [1].
But the same ingredient that helps you stay active during a morning meeting can quietly interfere with your sleep later that night.
That ingredient is caffeine. It’s present not only in coffee, but also in tea, soda, energy drinks, chocolate, and even some over-the-counter medicines.
While moderate caffeine intake can have benefits, caffeine is a stimulant. And stimulants and sleep don’t always mix well.
What does caffeine actually do in your body?
Caffeine works by blocking the effects of adenosine, a chemical that naturally builds up in the brain over the course of the day. Adenosine plays a role in making you feel sleepy [2]. By blocking its signal, caffeine can delay tiredness and make you feel more awake.
But this “delay” in sleepiness isn’t harmless. You may still feel wired even when your body is biologically ready for sleep. Over time, this can reduce your total sleep, shift your body clock, and interfere with the quality of your rest.
How does coffee affect sleep?
Sleep researchers have studied caffeine for decades. In general, the evidence shows that caffeine can interfere with multiple parts of the sleep process—not just how long you sleep, but how well.
You may fall asleep more slowly
A 2023 meta-analysis of 24 studies found that people who consumed caffeine took an average of 9 minutes longer to fall asleep compared to those who didn’t [3]. This might not seem like much on paper. But if you’re already prone to lying awake in bed, caffeine can add noticeable time to your sleep onset.
Your total sleep time may be reduced
In the same review, caffeine users slept 45 minutes less per night on average. This was true across studies involving different age groups, caffeine doses, and timing [3]. If you’re drinking several cups of coffee a day—especially in the afternoon—this could be cutting nearly an hour off your nightly rest.
Your sleep becomes lighter and more fragmented
Caffeine doesn’t just affect how long you sleep. It also affects sleep architecture—the structure and depth of your sleep.
Research shows that caffeine reduces the amount of deep sleep (slow-wave sleep) you get and increases the amount of light sleep. Specifically, the meta-analysis found that caffeine reduced deep sleep by about 11 minutes per night, while increasing time in light sleep by about 6 minutes [3].
This matters because deep sleep is when your body repairs itself. It’s important for memory, the immune system, and feeling rejuvenated in the morning. Losing even 10 to 15 minutes can add up over time.
REM sleep and caffeine
Unlike deep sleep, REM sleep—the phase when most dreaming occurs—is less consistently affected by caffeine in research studies. Some studies show that caffeine may delay the onset of REM [3], while others show minimal changes [4].
Still, anything that reduces your total sleep time will naturally shorten REM sleep as well. And disruptions to your sleep cycle—especially if you wake up more often—can interfere with how much REM your brain gets.
FDA recommendations
The U.S. Food and Drug Administration (FDA) considers up to 400 milligrams of caffeine per day—roughly four or five cups of coffee—to be a generally safe level for healthy adults [5]. But even within this range, individual reactions vary widely. Those with a sleep disorder, anxiety, or high sensitivity to stimulants may notice sleep problems at much lower doses.
Also Read: 5 Natural Ways to Enhance Your Sleep Quality
Timing matters more than most people think
A common misconception is that as long as you don’t drink coffee in the evening, your sleep won’t be affected. But caffeine’s effects last much longer than many people realize.
The half-life of caffeine is 4 to 6 hours—but that’s just the average
In a healthy adult, the average half-life of caffeine is about 5 hours [7]. That means if you drink a strong cup of coffee (roughly 200 mg of caffeine) at 3 p.m., you’ll still have 100 mg in your system at 8 p.m., and some caffeine will remain active well into the night.
But the range varies. In some people, the half-life can be as short as 1.5 hours or as long as 9 hours, depending on genetics, medications, and other factors.
Even afternoon coffee can shorten your sleep
In one well-known study, participants consumed 400 mg of caffeine at bedtime, 3 hours before bed, or 6 hours before bed [4]. All three conditions led to significant reductions in total sleep time, showing that caffeine can interfere with sleep even when taken as early as six hours before bedtime.
This highlights how caffeine consumed close to bedtime or even in the late afternoon can quietly disrupt sleep.
Why does caffeine affect people differently?
Genetics
Some people carry a version of the CYP1A2 gene—often called the “coffee gene”—that helps them break down caffeine faster (known as “fast metabolizers”). Others process caffeine more slowly. These “slow metabolizers” may feel the effects of caffeine longer and are more likely to have their sleep disrupted by even modest amounts [8].
There’s also the ADORA2A gene, which affects how sensitive your brain is to caffeine’s stimulation [9]. Certain variations make you more prone to anxiety and restlessness after drinking coffee.
Habitual intake and tolerance
If you drink coffee every day, you may build some tolerance to its stimulating side effects. You may not feel as jittery or alert as someone who rarely drinks it.
But tolerance doesn’t fully protect your sleep. Even long-term coffee drinkers show changes in sleep quality and reduced deep sleep when studied in sleep labs, even if they don’t subjectively feel more tired the next day [3].
Body size, medications, and hormone levels
Caffeine sensitivity also varies depending on your weight, sex, and health status. For example:
-
Women on oral contraceptives metabolize caffeine more slowly
-
Pregnancy can double the half-life of caffeine
-
Certain medications slow caffeine clearance
-
Smoking speeds it up
Age matters, too
Adolescents and teens
Teenagers need more sleep than adults, but many get far less—often due to busy schedules and nighttime screen use. Adding caffeine to the mix can make things worse.
Even low doses of caffeine have been shown to reduce deep sleep and worsen perceived sleep quality in teens [10]. One study found that 40 mg of caffeine in the evening—about the amount in a small soda—had measurable effects on sleep in adolescent boys [11].
For this reason, the American Academy of Pediatrics advises that teens avoid caffeine or limit intake to no more than 100 mg per day. Children under 12 should avoid it entirely.
Older adults
As people age, they naturally experience lighter and more fragmented sleep. Deep sleep becomes less abundant, and the ability to fall back asleep after waking may decline.
At the same time, the body’s ability to metabolize caffeine slows down. A cup of coffee in the afternoon may linger in the bloodstream longer than it did in your 30s or 40s [12]. This increases the chance of disrupted sleep in the evening or early night.
Some older adults find they sleep better when they reduce caffeine to one morning cup or switch to decaf after noon.
Also Read: How to Sleep Better as You Get Older
Can coffee cause insomnia?
In people prone to insomnia, caffeine often plays a role—either as a trigger or a contributor. Even modest amounts of caffeine, especially close to bedtime, can lead to:
-
Difficulty falling asleep and staying asleep through the night
-
Shorter total sleep time
-
Waking up feeling tired in the morning
This can lead to a cycle where people drink more coffee to fight fatigue, which then worsens their sleep, creating more fatigue the next day.
Sleep doctors often recommend eliminating caffeine entirely for a few weeks if you’re dealing with chronic insomnia. If symptoms improve, you can gradually reintroduce it while keeping an eye on the timing and amount.
Coffee and the circadian rhythm
Your circadian rhythm is the internal clock that governs your sleep-wake cycle. It regulates body temperature, hormone release (like melatonin), and when you feel sleepy.
Caffeine can interfere with this rhythm, particularly when consumed late in the day. One study found that drinking a double espresso three hours before bedtime delayed melatonin production by about 40 minutes, effectively shifting the body clock later [13].
This disruptive effect is comparable to the impact of bright light exposure at night and can contribute to staying up later than intended [14].
What should I drink before bed instead of coffee?
If you're looking to replace your evening coffee, there are several options that may help support relaxation and ease the transition to sleep. Some of these have been studied for their sleep-promoting benefits, while others are more traditional remedies passed down over time.
Chamomile tea
Chamomile is one of the most widely used herbal teas for sleep. While evidence is limited, a few small studies suggest it may help improve sleep quality and reduce nighttime awakenings, especially in older adults [15]. A warm cup of chamomile tea can be a gentle alternative to coffee.
Tart cherry juice
Tart cherries are a natural source of melatonin. In one small randomized trial, adults who drank tart cherry juice twice a day for two weeks experienced an increase in sleep duration and improved sleep efficiency, compared to a placebo group [16].
Warm milk
Milk contains tryptophan, an amino acid that serves as a precursor to serotonin and melatonin. In a study of hospitalized heart patients, those who drank warm milk mixed with honey for three nights reported improvements in sleep quality [17].
Banana smoothie
Bananas provide magnesium and potassium, both of which support muscle relaxation. One small study in healthy adults found that eating a banana before bed increased circulating melatonin levels [18].
Almond milk
Almond milk contains magnesium and tryptophan, and unsweetened versions are low in sugar. These nutrients may support melatonin production and promote a calming effect, making it a good alternative to coffee at night.
These drinks are unlikely to have strong effects on their own, but they can be part of a helpful wind-down routine—especially when paired with other healthy sleep hygiene habits, like dimming lights, limiting screens, and sticking to a consistent bedtime.
The bottom line
So, is coffee bad for sleep?
It can be—especially when consumed late in the day or in high amounts. Caffeine shortens total sleep time, reduces deep sleep, increases light sleep, and may delay your body clock. Even coffee lovers experience these effects, whether they realize it or not.
The good news is that you don’t have to give up coffee completely. Most people can enjoy it in moderation and early in the day without hurting their sleep. There’s no standard recommendation for when to stop drinking coffee, but many experts suggest cutting it off at least six to eight hours before bedtime.
Still, if you’re having trouble sleeping, it’s worth taking a close look at your caffeine intake. Your cup of coffee might be doing more than just waking you up—it might be keeping you up, too.
Frequently asked questions about coffee and sleep
Q: How long does caffeine affect sleep?
A: Caffeine has a half-life of about five to six hours, but it can take up to ten hours for your body to fully clear it. Even if you no longer feel wired, caffeine may still interfere with sleep by delaying your body clock, reducing deep sleep, or increasing nighttime awakenings. These effects can be especially noticeable if you drink coffee in the afternoon or evening.
Q: Can small amounts of caffeine still affect sleep?
A: Yes. While 25 to 50 milligrams of caffeine might sound minimal—about what you’d get from decaf coffee or green tea—research suggests that even these low doses can delay sleep onset in sensitive individuals. Genetics, body weight, and liver metabolism all play a role in how your body processes caffeine.
Q: Are there any benefits to drinking coffee at night?
A: For some people—such as those working irregular schedules, night shifts, or students pulling an all-nighter—drinking coffee at night may provide a short-term boost in alertness. But for most people, especially those with a typical daytime routine, the downsides outweigh the benefits. Night-time caffeine use is more likely to reduce overall sleep quality, especially by disrupting REM sleep and shortening total sleep time.
Q: I drank coffee and now I can't sleep — what can I do?
A: Try to wind down with calming routines that help ease your body into sleep. That could mean dimming the lights, listening to soft music, or drinking a warm, caffeine-free beverage. Some people find that taking a gentle, plant-based sleep aid like Sip2Sleep®—made with Montmorency tart cherry and Rafuma leaf—30 to 60 minutes before bed helps counteract the lingering effects of caffeine and supports natural melatonin production.
References:
-
Drive Research. (2024, February 1). Coffee Statistics: Consumption, Preferences, & Spending. https://www.driveresearch.com/market-research-company-blog/coffee-survey/
-
NIH News in Health. (2020, October). Tired or Wired? National Institutes of Health. https://newsinhealth.nih.gov/2020/10/tired-or-wired
-
Gardiner C, Weakley J, Burke LM, Roach GD, Sargent C, Maniar N, Townshend A, Halson SL. The effect of caffeine on subsequent sleep: A systematic review and meta-analysis. Sleep Med Rev. 2023 Jun;69:101764. doi: 10.1016/j.smrv.2023.101764. Epub 2023 Feb 6. PMID: 36870101.
-
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.
-
U.S. Food and Drug Administration. (2024, August 28). Spilling the Beans: How Much Caffeine is Too Much? https://www.fda.gov/consumers/consumer-updates/spilling-beans-how-much-caffeine-too-much
-
Institute of Medicine (US) Committee on Military Nutrition Research. Caffeine for the Sustainment of Mental Task Performance: Formulations for Military Operations. Washington (DC): National Academies Press (US); 2001. 2, Pharmacology of Caffeine. Available from: https://www.ncbi.nlm.nih.gov/books/NBK223808/
-
Berg, S. (2025, July 25). What doctors wish patients knew about the impact of caffeine. American Medical Association. https://www.ama-assn.org/public-health/prevention-wellness/what-doctors-wish-patients-knew-about-impact-caffeine
-
Mahdavi S, Palatini P, El-Sohemy A. CYP1A2 Genetic Variation, Coffee Intake, and Kidney Dysfunction. JAMA Netw Open. 2023;6(1):e2247868. doi:10.1001/jamanetworkopen.2022.47868
-
Banks, N.F., Tomko, P.M., Colquhoun, R.J. et al. Genetic Polymorphisms in ADORA2A and CYP1A2 Influence Caffeine’s Effect on Postprandial Glycaemia. Sci Rep 9, 10532 (2019). https://doi.org/10.1038/s41598-019-46931-0
-
Aepli A, Kurth S, Tesler N, Jenni OG, Huber R. Caffeine Consuming Children and Adolescents Show Altered Sleep Behavior and Deep Sleep. Brain Sci. 2015 Oct 15;5(4):441-55. doi: 10.3390/brainsci5040441. PMID: 26501326; PMCID: PMC4701022.
-
Reichert, C. F., Veitz, S., Bühler, M., Gruber, G., Deuring, G., Rehm, S. S., Rentsch, K. M., Garbazza, C., Meyer, M., Slawik, H., Lin, Y.-S., & Weibel, J. (2021). Wide awake at bedtime? Effects of caffeine on sleep and circadian timing in male adolescents – A randomized crossover trial. Biochemical Pharmacology, 191, 114283. https://doi.org/10.1016/j.bcp.2020.114283
-
Clark I, Landolt HP. Coffee, caffeine, and sleep: A systematic review of epidemiological studies and randomized controlled trials. Sleep Med Rev. 2017 Feb;31:70-78. doi: 10.1016/j.smrv.2016.01.006. Epub 2016 Jan 30. PMID: 26899133.
-
Burke TM, Markwald RR, McHill AW, Chinoy ED, Snider JA, Bessman SC, Jung CM, O'Neill JS, Wright KP Jr. Effects of caffeine on the human circadian clock in vivo and in vitro. Sci Transl Med. 2015 Sep 16;7(305):305ra146. doi: 10.1126/scitranslmed.aac5125. PMID: 26378246; PMCID: PMC4657156.
-
Wright, K. P., Myers, B. L., Plenzler, S. C., Drake, C. L., & Badia, P. (2000). Acute effects of bright light and caffeine on nighttime melatonin and temperature levels in women taking and not taking oral contraceptives. Brain Research, 873(2), 310-317. https://doi.org/10.1016/S0006-8993(00)02557-9[1]
-
Adib-Hajbaghery M, Mousavi SN. The effects of chamomile extract on sleep quality among elderly people: A clinical trial. Complement Ther Med. 2017 Dec;35:109-114. doi: 10.1016/j.ctim.2017.09.010. Epub 2017 Oct 13. PMID: 29154054.
-
Howatson G, Bell PG, Tallent J, Middleton B, McHugh MP, Ellis J. Effect of tart cherry juice (Prunus cerasus) on melatonin levels and enhanced sleep quality. Eur J Nutr. 2012 Dec;51(8):909-16. doi: 10.1007/s00394-011-0263-7. Epub 2011 Oct 30. PMID: 22038497.
-
In a study of hospitalized heart patients, those who drank warm milk mixed with honey for three nights reported improvements in sleep quality.
-
Sae-Teaw M, Johns J, Johns NP, Subongkot S. Serum melatonin levels and antioxidant capacities after consumption of pineapple, orange, or banana by healthy male volunteers. J Pineal Res. 2013 Aug;55(1):58-64. doi: 10.1111/jpi.12025. Epub 2012 Nov 9. PMID: 23137025.