Skip to main content Skip to secondary navigation
Main content start

More awake, less rested: The hidden cost of caffeine on sleep quality

Research from MD-PhD scholar Ank Agarwal (2024 cohort) shows that by rethinking when and how we consume caffeine, we can optimize both wakefulness and restfulness.
One person holds a large sheet of paper with sketches and diagrams, sharing their ideas with others at a table.

Fatigue has become something of a modern epidemic, with people doing more, sleeping less, and chronically running on empty. In our efforts to combat fatigue, many of us instinctively turn to caffeine throughout the day. But what if our dependence on caffeine is paradoxically fueling the very exhaustion we are trying to cure? 

As an MD-PhD student at Stanford School of Medicine studying the impact of caffeine on sleep quality, I’ve examined how it affects energy, cognitive performance, and overall health. Here’s what I’ve learned from the scientific literature and from working with more than 200 patients and students to help improve their energy levels: Even if we are able to fall asleep after having caffeine, it can dramatically impact our sleep quality, causing us to feel tired the next day and experience significantly worse health in the long run. However, rather than viewing caffeine as the enemy of sleep and eliminating it entirely, the more strategic approach to improving sleep quality (and the many related health benefits) is to adjust the timing and dosage of your caffeine intake.

Not just how much you sleep but how well

Most people know that they need at least seven hours of sleep per night, but even 10 hours of fitful, interrupted sleep will not deliver the rest your body and brain need. The conversation around sleep quality is often vague and misleading because it focuses too heavily on a supposedly “optimal” number of sleep hours. But falling asleep with a seven-hour window ahead is only half of ensuring true rest. The other half depends on the depth and efficiency of sleep cycles, during which numerous essential biological processes take place.

The critical insight comes from how long caffeine actually impacts our bodies: Even if we can fall asleep after drinking caffeine, there are residual caffeine levels in the body that can impair sleep quality at a microscopic, cellular level. This is because caffeine has a highly variable half-life of approximately 2 to 10 hours, meaning that it takes that long for the body to eliminate just half of what was consumed. So, if you drink a cup of coffee (80-120 mg of caffeine) at 1 pm, you could still have too much circulating in your nervous system at 10 pm to be able to sleep properly. Given the wide variability in how quickly different people metabolize caffeine, I generally advise students and other patients to aim for 30 mg max left in their body, assuming an average six-hour half-life, and, if needed, to experiment and adjust.

Plenty of people claim that they “sleep just fine” after consuming caffeine late in the day, but studies show that caffeine reduces deep, slow-wave sleep, which is essential for memory consolidation, immune function, hormone regulation, and cellular repair. In other words, falling asleep is not the only goal: You may be unconscious, but that after-dinner espresso or tea can impair your body’s ability to rejuvenate and lead to next-day fatigue.

The consequences of poor sleep

We’re told to eat well and exercise, but quality sleep is the single most important thing we can do to improve and maintain our health. Most people assume that poor sleep translates to feeling sluggish, but the consequences are farther-reaching:

The research is clear: Sleeping with excessive caffeine in our bodies can dramatically increase our risks for devastating diseases, decrease our life expectancy, and prevent us from achieving the very fitness goals for which we consume caffeine or skimp on sleep.

A close-up of a person in a coral-colored shirt holding a small white coffee cup on a saucer, on a beige table.

Optimizing caffeine intake for more energy

Now that we know the catastrophic impacts of both short- and long-term sleep deprivation or poor sleep from caffeine, does that mean we should skip caffeine altogether? Fortunately, there are ways of taking advantage of caffeine’s benefits while avoiding its risks.

Caffeine can be useful in critical moments — when we need to be alert for a drive or for an energy boost when it’s not possible to get enough sleep — so how can we approach this paradox where the same substance that wakes us up can also make us tired? It comes down to when and how much

Techniques include:

  1. Set a caffeine cutoff: The general recommendation is to allow at least 8 to 10 hours before bedtime for caffeine to clear your system. If your goal is to get to sleep by 10 p.m., your last dose of caffeine should be no later than 12 p.m. to minimize sleep disruption. However, if you find yourself feeling tired the next day or feeling like you need caffeine in the morning despite sleeping eight hours, it could suggest that your body metabolizes caffeine more slowly. In that case, try moving your personal cutoff even earlier.
  2. Limit caffeine intake: Consuming smaller doses (e.g., one cup of coffee instead of multiple cups throughout the day) reduces the risk of accumulating excessive caffeine levels that linger into the night and disturb sleep. Each bit of caffeine adds up and even two cups can be too much for many folks.
  3. Gradually adjust consumption: If you have been consuming caffeine late in the day and want to reduce it, slowly taper off. If you’ve ever tried going “cold turkey” on coffee, you may have felt sluggish the next day or had a headache. Tapering slowly over a few weeks can minimize withdrawal effects and help your body naturally restore its energy regulation. For example, if you usually have three cups per day, try having 2.5 per day for a week, two the week after, and so on. Although at first you may feel tired, paradoxically, you will likely find that you begin to feel more energetic as you taper down.
  4. Consider alternatives: For moments when you need to be alert (e.g., driving late at night), caffeine remains a useful tool. But for everyday energy, other strategies such as prioritizing sleep hygiene, exposure to natural daylight outside, and hydration can be just as effective without incurring caffeine’s long-term costs.

Be a smart consumer

After working with hundreds of patients and students to refine their caffeine habits, I have consistently seen enormous improvements in their energy levels, cognitive performance, and overall well-being. I include myself in that cohort, having cut back from 3 to 4 cups per day in college to an average of zero these days — with the occasional ½ cup when needed.

By being more intentional about when they consume caffeine — and how much — people can still feel awake and alert while at the same time protect their long-term health. The key is understanding that true energy does not come from the caffeine — or only the caffeine — but rather from quality sleep that allows the body to repair and restore critical functions and perform at its highest level.

Look below at the graphs to see examples of when people drank caffeine and the estimated amounts of how much was left in their bodies at different times. These visualizations illustrate when caffeine levels theoretically dropped low enough (30 mg) to allow for healthy sleep without disruption. In some of the cases, they had excessive amounts of caffeine in their bodies all the way until the next day in the morning, indicating that their sleep that night would not have been restful.

Ank Agarwal (2024 cohort) is pursuing an MD and a PhD in biophysics at the Stanford School of Medicine. His interests lie at the intersection of machine learning, education, and health disparities.

The amount of caffeine in your body decreases based on the time since your last cup of coffee.

Knight-Hennessy scholars represent a vast array of cultures, perspectives, and experiences. While we as an organization are committed to elevating their voices, the views expressed are those of the scholars, and not necessarily those of KHS.

More News Topics

More News