-->

Caffeine and Sleep: How Late Is Too Late for Coffee?

Coffee cup and alarm clock on a table, with a sunny sky turning into a night sky

For many people, the day does not really start until the first cup of coffee. Caffeine helps us feel alert, focused, and ready to go. But the same drink that helps in the morning can quietly work against you at night, especially if you have it later in the day than you realize.

If you often lie awake at night, wake up feeling unrefreshed, or need more and more coffee to get through the afternoon, your caffeine timing may be part of the picture. This guide explains how caffeine affects sleep, how long it stays in your system, how much is generally considered reasonable, and simple ways to set your own caffeine cutoff.

This article is for general educational purposes and is not medical advice. Please see our medical disclaimer.

How Caffeine Keeps You Awake

Throughout the day, a natural chemical called adenosine slowly builds up in your brain. The more adenosine builds up, the sleepier you feel. This "sleep pressure" is one of the reasons you naturally feel tired by the evening.

Caffeine works mainly by blocking adenosine from doing its job. It does not remove your need for sleep. It simply hides the signal for a while. That is why caffeine can make you feel alert even when you are short on sleep, and why the tiredness often returns once the caffeine wears off.

How Long Does Caffeine Last?

According to MedlinePlus, from the U.S. National Library of Medicine, you may continue to feel the effects of caffeine for four to six hours. Even after you stop noticing it, some caffeine is still in your system, and the amount that remains can be enough to affect sleep.

How quickly your body clears caffeine varies from person to person. Genetics, age, pregnancy, some medicines, and liver function can all play a role. This is why one person can drink an espresso after dinner and sleep fine, while another feels wired after an afternoon cup of tea.

Caffeine Within 6 Hours of Bedtime Can Affect Sleep

A frequently cited study published in the Journal of Clinical Sleep Medicine in 2013 looked at what happened when adults took 400 mg of caffeine at bedtime, 3 hours before bed, or 6 hours before bed, compared with a placebo. All three timings disrupted sleep compared with the placebo, including the dose taken 6 hours before bedtime.

The researchers concluded that their results support the common advice to avoid substantial caffeine for at least 6 hours before bed. It is worth noting that 400 mg is a fairly large single dose, roughly what you might get from several cups of coffee, and the study was small. Still, it shows that caffeine can affect sleep even when you no longer feel "buzzed."

Some sleep experts suggest an even longer gap. The Sleep Foundation, for example, recommends avoiding caffeine at least 8 hours before bedtime for better sleep quality.

Timeline showing a caffeine cutoff 6 to 8 hours before a 10:30 p.m. bedtime

How Much Caffeine Is Too Much?

For most healthy adults, the U.S. Food and Drug Administration (FDA) has cited 400 milligrams a day as an amount not generally associated with negative effects. That is about two to three 12-ounce cups of regular coffee.

The FDA also notes that sensitivity to caffeine varies, and that people who are pregnant, trying to become pregnant, breastfeeding, or managing certain health conditions or medicines should talk with a health care provider about whether to limit caffeine.

Signs that you may be getting more caffeine than your body likes include:

  • trouble falling asleep or staying asleep;
  • jitters, restlessness, or anxiety;
  • a fast heartbeat or palpitations;
  • an upset stomach or nausea;
  • headaches.

Caffeine in Common Drinks

Caffeine content can vary a lot, even between two cups of the same type of drink. The FDA lists these typical ranges for a 12-ounce serving:

  • Regular brewed coffee: about 113 to 247 mg
  • Energy drinks: about 41 to 246 mg
  • Black tea: about 71 mg
  • Green tea: about 37 mg
  • Caffeinated soft drinks: about 23 to 83 mg

Decaf coffee is not completely caffeine-free either. The FDA notes it typically contains about 2 to 15 mg in an 8-ounce cup. Chocolate, some pain relievers, and pre-workout supplements can also contain caffeine, so it is worth checking labels.

Bar chart of typical caffeine in 12-ounce coffee, energy drinks, black tea, soft drinks, and green tea

How to Set Your Personal Caffeine Cutoff

There is no single perfect cutoff time for everyone, but a simple starting point is to count back from your usual bedtime:

  • Pick your usual bedtime. For example, 10:30 p.m.
  • Count back at least 6 hours. In this example, your last caffeinated drink would be around 4:30 p.m.
  • Try 8 hours if you are sensitive. If you still struggle to fall asleep, move your cutoff earlier, to around 2:30 p.m.
  • Watch hidden sources. An afternoon iced tea, cola, or chocolate dessert counts too.
  • Give it a week or two. Notice how quickly you fall asleep and how you feel in the morning.

Better Ways to Beat the Afternoon Slump

If you reach for coffee mainly to push through an afternoon dip, these alternatives may help without affecting your night:

  • Take a short walk, ideally outside in daylight.
  • Drink a glass of water, since even mild dehydration can make you feel tired. Our guide on how much water you need has simple hydration habits.
  • Try a short nap of 10 to 20 minutes, early in the afternoon. See our guide on how long a nap should be.
  • Switch to decaf or herbal tea later in the day if you enjoy the ritual of a warm drink.
  • Eat a balanced lunch with protein and fiber rather than a very large, sugary meal.
Six alternatives to afternoon coffee: a walk, water, a short nap, decaf or herbal tea, a balanced lunch, and daylight

Cutting Back Without the Headaches

If you are used to a lot of caffeine, stopping suddenly can cause withdrawal symptoms such as headaches, tiredness, irritability, and trouble concentrating. These usually ease within days, but a gradual approach is often more comfortable:

  • reduce by about half a cup or one drink every few days;
  • mix regular and decaf coffee as you transition;
  • move your last cup a little earlier each week rather than cutting it out entirely.

Pairing a caffeine cutoff with a calming evening routine can make the change easier. Our guide to building a wind-down routine walks through simple steps.

My Take

I used to think coffee did not affect my sleep because I could fall asleep fine after an afternoon cup. What I noticed, though, was that I woke up more often and felt groggier in the morning, which made me want even more coffee. Moving my last cup to early afternoon, and switching to decaf after that, was a small change that made my evenings feel noticeably calmer. Your ideal cutoff may be different, so treat it as an experiment and pay attention to how you feel.

Frequently Asked Questions

What time should I stop drinking coffee?

A common starting point is at least 6 hours before bedtime, based on research showing that caffeine taken 6 hours before bed can still disrupt sleep. If you are sensitive to caffeine, an 8-hour gap may work better.

Does caffeine affect sleep even if I fall asleep easily?

It can. Some people fall asleep without trouble but sleep more lightly or wake up more often after late caffeine. In the 2013 study, participants did not always notice the effect themselves even when sleep monitoring showed it.

Is decaf coffee okay in the evening?

Decaf contains only a small amount of caffeine, typically about 2 to 15 mg per 8-ounce cup according to the FDA, so many people find it fine in the evening. Very sensitive people may still prefer to limit it.

Is tea better than coffee for sleep?

Black and green tea usually contain less caffeine than brewed coffee, but they still contain some. Caffeine-free herbal teas are a better choice close to bedtime.

Who should limit caffeine?

People who are pregnant, trying to become pregnant, or breastfeeding, as well as people with sleep disorders, anxiety, heart rhythm problems, or certain medicines, should talk with a health care provider about how much caffeine is right for them.

The Bottom Line

Caffeine is a helpful tool for alertness, but timing matters. Its effects can last for hours, and research suggests that caffeine within 6 hours of bedtime can still disrupt sleep. Most healthy adults do well staying under about 400 mg a day, but your own sensitivity counts more than any general number.

If you are struggling with sleep, setting a caffeine cutoff is one of the simplest changes you can try. If sleep problems continue despite good habits, talk with a health care provider.

Sources