How late in the day can you drink coffee? What time you can have your last cup and still fall asleep at night

Handsome stylish man in casual clothes looking at laptop computer screen enjoying coffee in home office room during the day while standing and leaning with one hand on table next to window with white curtains.
You may want to think twice before you grab your afternoon latte.
Getty Images

We’ve all faced that midday slump when 3 p.m. rolls around and you just can’t keep your eyes open. But should you make an afternoon coffee run, or ride it out until you can crash in bed later that evening? 

If you want to have a good night’s rest, experts suggest you stop drinking caffeine within six to eight hours of your bedtime. So if you typically hit the hay around 10 p.m., you’ll want to plan your last cup of coffee between 2 p.m. to 4 p.m.

This is because “it can take six to eight hours for your body to process and eliminate the caffeine you consume in one sitting,” Kristine Dilley, lead outpatient dietitian in nutrition services at the Ohio State University Wexner Medical Center, previously told Fortune.

“A good rule of thumb is to avoid caffeine after lunchtime,” says Terry Cralle, registered nurse and representative of the Better Sleep Council. “Consuming caffeine six hours before bedtime can reduce total sleep time by one hour.”

Why caffeine keeps you awake

Caffeine is a stimulant that can help increase alertness and give you more energy. According to the Centers for Disease Control & Prevention, it takes about 30 minutes for caffeine to kick in, although the range is anywhere from 15 to 45 minutes; however, it takes much longer to leave your system. The half-life for caffeine is roughly four to six hours, which means half of the dosage of caffeine is still in your system four to six hours after consumption.

However, some people become more sensitive to caffeine as they get older and may need more than eight hours to process caffeine, according to Dr. Marie-Pierre St-Onge, an associate professor of nutritional medicine at Columbia University Irving Medical Center.

“Caffeine works by blocking adenosine receptors, a chemical in the brain that makes us feel sleepy,” explains Cralle. “As a result, we feel less sleepy. However, caffeine doesn’t provide any of the restorative properties of sleep that will help you think clearly, function optimally, or maintain good health.” 

How do you know if you’ve had too much caffeine 

For most people, it’s safe to consume 400 milligrams of caffeine per day. To put that in perspective, an eight-ounce cup of coffee has about 95–200 milligrams of caffeine, and a 12-ounce of soda has about 35–45 milligrams. But caffeine impacts everyone differently.

Some signs of overconsumption of caffeine include:

  • Restlessness 
  • Jitters
  • Insomnia
  • Upset stomach
  • Fast heart rate
  • Dizziness
  • Anxiety
  • Dehydration
  • Dependency 

What to do instead of drinking caffeine 

If you’re looking to cut back on your caffeine intake, you could swap out your afternoon coffee for one of these tips to get through your midday slump:

  • Plan ahead and have a protein-rich breakfast
  • Drink lemon water, decaffeinated herbal tea, or a smoothie instead
  • Take a 30-minute power nap
  • Take a walk outside
  • Take a cold shower

Incorporating multiple microbreaks into your workday can help replenish your energy and improve your well-being, all without a sip of caffeine. 

“Taking a 10-minute break between a working interval of up to 90 minutes can help reset your attention span and keep cognitive momentum going for another focused 90-minute work interval,” Tanya Tarr, behavioral scientist and president of Cultivated Insights, previously told Fortune. “You have to pace yourself and let your brain catch its figurative breath.”

Subscribe to Well Adjusted, our newsletter full of simple strategies to work smarter and live better, from the Fortune Well team. Sign up today.