The JournalSleep Science

Caffeine and Sleep: Why Your Last Coffee Matters More Than You Think

How long does caffeine affect sleep? Explore half-life, hidden sources and a practical way to find your last coffee time without giving up the ritual.

Daniel, Somnia Editor 6 min
Caffeine and Sleep: Why Your Last Coffee Matters More Than You Think

You can drink an espresso after dinner and still fall asleep. Does that mean caffeine does not affect your sleep? Not necessarily. Falling asleep is only one part of the picture: caffeine can also influence how long you sleep, how often you wake and how much deep sleep you get. The effects are not always obvious the next morning.

Coffee does not need to become the villain of your evening. For many people, it is an enjoyable ritual that fits comfortably into a healthy day. The useful question is more specific: how much caffeine is still active when you want to sleep, and would changing its timing make your nights easier?

1. Caffeine turns down the signal for sleep

During waking hours, a chemical messenger called adenosine helps build the pressure to sleep. Caffeine blocks adenosine receptors, temporarily reducing the sleepiness you feel. It does not remove your need for sleep or provide the recovery that sleep delivers. It makes one of the signals harder to hear.

That distinction explains why a coffee can make a short night feel more manageable without undoing its effects. As caffeine wears off, the underlying sleepiness can become more noticeable. If another coffee follows, the cycle may extend into the afternoon, leaving less time for the caffeine to clear before bed.

"Feeling more awake is not the same as needing less sleep."
— Daniel, Somnia Editor

Regular users develop tolerance to some of caffeine’s effects, but that does not guarantee their sleep is unaffected. Equally, not every person experiences a meaningful problem. The aim is not to judge your coffee habit by someone else’s sensitivity, but to understand your own pattern.

2. Half-life explains why an afternoon coffee can linger

Caffeine’s half-life is the time your body takes to eliminate half a dose. In healthy adults, it is commonly around four to six hours, although individual values can fall well outside that range. Genetics, pregnancy, certain medicines and other factors can change how quickly caffeine is cleared.

Imagine a coffee containing 100 mg of caffeine at 4 pm. With a five-hour half-life, roughly 50 mg would remain at 9 pm, and around 25 mg at 2 am. This is an illustration, not a personalised prediction. Earlier drinks also contribute to the amount in your system; your afternoon cup does not start from zero.

The stimulating feeling can fade before the caffeine has disappeared. This is why ‘I no longer feel wired’ is an unreliable guide to whether it could still affect bedtime. People also differ in how sensitive their sleep is to the caffeine that remains.

A universal rule such as ‘no coffee after 2 pm’ therefore has limits. It may suit someone with an early bedtime, yet be unnecessarily restrictive for another person. Your dose, intended bedtime and response all matter.

3. Sleep can change even when falling asleep feels easy

Research links caffeine with longer time to fall asleep, reduced total sleep and changes in sleep depth. The size of the effect depends on the dose and timing, as well as the person. You might notice difficulty dropping off, but you might instead experience a shorter or more interrupted night.

In a small controlled study published in the Journal of Clinical Sleep Medicine in 2013, a 400 mg caffeine dose disrupted sleep even when taken six hours before bedtime. That was a substantial dose, not a stand-in for every cup of tea. The finding supports caution with large afternoon doses; it does not establish one perfect cut-off for everyone.

The European Food Safety Authority’s 2015 caffeine assessment also noted that 100 mg close to bedtime may affect sleep in some adults. An intake considered safe for general health is therefore not automatically sleep-neutral. ‘Within the daily limit’ and ‘right for my night’ are different questions.

This does not mean you need to monitor every sleep stage on a wearable. Consumer devices estimate sleep rather than measuring it like a clinical sleep study. Look for a consistent change in your nights and daytime functioning, not a single deep-sleep score.

4. Count the caffeine, not just the coffees

Cup size is a poor measure of caffeine. Beans, brewing method, serving size and the number of espresso shots all matter. A large café drink may contain substantially more than your usual home coffee. Where information is available, check the café’s nutrition details or product label.

  • Tea and matcha: both contain caffeine, with amounts affected by the product, quantity and preparation.
  • Energy drinks and pre-workout supplements: check caffeine per serving and how many servings the container holds.
  • Cola, chocolate and cocoa: these can add to your total, although amounts vary considerably.
  • Some headache medicines: caffeine may be an active ingredient. Read the leaflet and ask a pharmacist if unsure.
  • Decaffeinated coffee: usually much lower in caffeine, but not entirely caffeine-free.

In Dubai, a late dinner may end with Arabic coffee, and a small cup can feel too modest to count. Strength and repeated refills still matter. You can keep the hospitality and pause the caffeine: choose water, a caffeine-free infusion, or simply enjoy the conversation without another refill.

5. Find your cut-off with a gentle experiment

Rather than abandoning coffee overnight, test whether an earlier finish helps. Around eight hours before your intended bedtime is a reasonable starting point, not a guaranteed clearance window. Some people need longer, especially with larger doses or greater sensitivity.

Medical-safety note: if you are pregnant, breastfeeding, taking medicines that may interact with caffeine, or have been advised to limit it for a health condition, ask your clinician or pharmacist for individual guidance. Persistent insomnia or significant daytime sleepiness deserves assessment rather than repeated caffeine adjustments alone. CBT-I is a first-line treatment for chronic insomnia.

  1. For three ordinary days, note your caffeine sources, approximate amounts and times. Add a brief morning note about sleep and alertness.
  2. Choose an earlier last-caffeine time based on your usual bedtime. Keep your wake-up time reasonably consistent while testing it.
  3. Move or reduce the latest serving first. If your intake is high, taper over several days to reduce withdrawal headaches and fatigue.
  4. Try the new pattern for one to two weeks. Avoid judging it during the first withdrawal-affected days or after one unusually stressful night.
  5. Review the overall pattern. If sleep improves, keep the smallest useful change. If it does not, consider other contributors rather than assuming caffeine explains everything.

Your next step can be small: check what is in your usual afternoon drink, then bring it forward or replace it tomorrow. The goal is a coffee ritual that works with your sleep, not another rule to worry about at bedtime.

The Somnia Letter

One quiet email. Better nights, delivered.

New essays on sleep science, evening ritual and calmer nights — sent occasionally, never noisily.

No spam. Unsubscribe any time.