Coffee can improve your focus and make mornings feel more manageable. But if your afternoon cup keeps you awake at 3 a.m., timing may be an issue. Here’s how to enjoy coffee while protecting your sleep.
Everyone responds differently to caffeine, so there isn’t a universal rule about when you should stop drinking coffee. However, avoiding coffee any time after early to mid-afternoon is usually recommended due to its caffeine content.
How long caffeine remains in the body can vary among individuals, with research suggesting a range of 2 to 10 hours before it’s fully eliminated. That means for some people, a 3 p.m. latte can still keep you up at bedtime.
The ideal timing varies, as multiple factors can influence how long caffeine stays in your body:
- Genetics: Some people metabolize caffeine quickly, while others process it slowly. Variations in genes can make caffeine’s effects last longer, increasing the chance it may disrupt your sleep.
- Sleep sensitivity: If you’re someone who already struggles with insomnia, even a small amount of caffeine late in the day may impact how well you sleep.
- Stress and sleep debt: Stress and poor sleep can increase caffeine’s effects. When you’re already wired or overtired, the effects of caffeine may feel stronger.
In other words, your body’s response matters more than the clock, so paying attention to how you respond to late-day caffeine can help you find your personal cutoff.
Many people drink coffee immediately after waking, while some choose to wait a bit before their first cup. Overall, the optimal time of day to drink coffee depends on individual responses.
Your body naturally produces cortisol in the morning. Cortisol is a stress hormone that helps you feel more awake, although how much cortisol your body produces in the morning can vary. If you drink coffee to help you wake up, it may make sense to wait and let your own hormones do their job.
There isn’t a lot of research suggesting the best time of day to drink coffee, but if you’re trying to align caffeine intake with waning energy levels, it may make sense to wait about 60 to 90 minutes after waking, once your natural cortisol levels begin to decline.
That said, if you look forward to a cup first thing, drinking coffee any time in the morning is likely fine if you don’t notice any difference in energy or sleep. For many people, enjoying coffee as part of a morning routine works well, provided caffeine intake doesn’t extend too late into the day.
The type of coffee matters because of the total caffeine intake, and not because of the type of coffee or roast level. The amount of coffee also consumed matters, as it contributes to your overall caffeine intake.
Espresso may taste stronger than drip coffee, but a single shot often contains less caffeine than a full brewed cup:
- Espresso (1 shot): ~65 mg of caffeine
- Drip coffee (8 oz): ~95 mg of caffeine
Many people drink much more than 8 ounces of coffee, so the amount of caffeine can add up
quickly. Other options, such as cold brew, may contain more caffeine per serving, depending on the preparation method. Eight ounces of cold brew can contain about 100 milligrams of caffeine.
Decaffeinated coffee contains such a small amount of caffeine (less than 5 milligrams in 6 ounces) that most people won’t be affected, but highly sensitive sleepers could notice an effect if they are drinking decaf late at night.
What ultimately influences sleep and coffee intake is less about the type of coffee and more about:
- Total amount of caffeine consumed
- Timing of intake
- Individual sensitivity to caffeine
If you love coffee but don’t want to compromise your sleep, try these strategies:
- Drink your caffeine earlier: Moving your last cup back by at least 1 to 2 hours reduces the likelihood that caffeine will disrupt your sleep. Some research suggests that the last cup of coffee should be consumed at least 8.8 hours before you want to go to sleep.
- Adjust portion sizes: A smaller size can help limit your total caffeine intake without completely cutting out coffee.
- Pair coffee with food: Drinking coffee on an empty stomach can cause jitters for some people. Combining caffeine with a meal or snack may help avoid this effect.
- Try half-caff: If caffeine is still a problem for you, consider mixing regular and decaf coffee to lower your intake while keeping the flavor and ritual.

