CircadianHub
← Back to calculator

← All articles

Caffeine and Sleep: How Long Does It Stay in Your System?

Better Sleep  About 9 minutes to read

Caffeine and Sleep: How Long Does It Stay in Your System?

That afternoon coffee feels harmless. You drink it at 15:00, feel fine by evening and fall asleep at your usual time. So why do you wake at 03:00, or feel flat the next morning? Caffeine lasts far longer in the body than the buzz does, and it can reduce your sleep without you noticing. This guide explains how long caffeine stays in your system, what the research says, and how to choose a cutoff time that suits your own bedtime.

How caffeine works

While you are awake, a chemical called adenosine builds up in the brain and increases your pressure to sleep. Caffeine blocks the receptors adenosine uses, so you feel less sleepy. It does not remove tiredness or replace sleep. It masks the signal, and the adenosine keeps accumulating behind the scenes. Our coffee nap article shows how this can be used on purpose.

After you drink it, caffeine is absorbed quickly. Levels in the blood usually peak somewhere between 30 and 60 minutes later, and you feel the strongest effect around then.

How long does caffeine stay in your body?

The key number is the half-life: the time it takes the body to clear half of the caffeine. In healthy adults the average is around five hours, which matches the five to six hours mentioned in our coffee nap guide. Individual values vary a great deal, and reported ranges run from under two hours to around ten.

A half-life of five hours has a surprising consequence. Half of the caffeine is still there five hours later, and a quarter is still there ten hours later. Here is what that looks like for a 200 mg dose, which is roughly two cups of brewed coffee, drunk at 15:00:

TimeHours after drinkingCaffeine still in your body (5-hour half-life)
15:000200 mg
20:005100 mg
22:007about 76 mg
01:001050 mg
06:001525 mg

At 22:00 you would still have more caffeine in your system than a typical cup of black tea contains. That is why a late-afternoon coffee can matter at bedtime even though the buzz is long gone.

What the research says about timing

A well-known 2013 study, led by Christopher Drake and published in the Journal of Clinical Sleep Medicine, tested a 400 mg dose of caffeine, about two to three cups of coffee. Volunteers took it at bedtime, three hours before bed, or six hours before bed, and on a separate occasion a placebo. All three caffeine times disrupted sleep. Even the dose taken six hours before bed cut measured total sleep time by more than an hour. The participants did not reliably notice the effect, because their own reports of how they slept did not match what the sleep monitor recorded.

The study was small, with only 12 healthy adults, and it used a large dose, so the effect of a smaller cup may be smaller. But the authors concluded that avoiding substantial caffeine for at least six hours before bed is supported by the evidence, and they suggested generally avoiding it after about 17:00.

The most important point is that you may not feel the damage. People tend to judge their sleep by how quickly they fell asleep, and caffeine can leave that unchanged while still making sleep lighter and shorter. Our article on sleep latency explains why falling asleep quickly is not always a sign of good sleep.

How to choose your cutoff time

A sensible rule is to stop caffeine at least six hours before your bedtime, and eight or more hours if you are sensitive or already sleep poorly. Count back from when you plan to fall asleep, not from when you go to bed.

BedtimeMinimum cutoff (6 hours)Cautious cutoff (8 to 10 hours)
21:3015:3011:30 to 13:30
22:3016:3012:30 to 14:30
23:3017:3013:30 to 15:30
00:3018:3014:30 to 16:30

If you are not sure where you sit, try a simple experiment. For two weeks, move your last caffeinated drink to before 14:00, and keep the rest of your routine the same. Note how long it takes to fall asleep, how often you wake and how you feel in the morning. The CircadianHub calculator can help you find a consistent bedtime to count back from.

Why caffeine affects people differently

Two people can drink the same coffee and have very different nights. The main reasons are:

How much caffeine is in your drink?

The figures below are approximate and vary by brand, size and brewing method, so check the label where you can.

DrinkTypical caffeine
Brewed coffee, 240 ml (8 oz)About 95 mg, often 70 to 140 mg
Espresso, single shotAbout 60 mg
Black tea, 240 mlAbout 45 mg
Green tea, 240 mlAbout 30 mg
Cola, 330 ml (12 oz)About 35 mg
Energy drink, one canAbout 80 to 300 mg or more
Decaf coffee, 240 mlAbout 2 to 15 mg
Dark chocolate, 30 gAbout 10 to 25 mg

Do not forget hidden sources, such as pre-workout powders, some painkillers and chocolate desserts. Food and drink regulators generally consider up to 400 mg a day, roughly four cups of brewed coffee, to be a safe limit for most healthy adults, but that is an upper limit for health and not a sleep-friendly target. Many people sleep better on much less.

Caffeine and night shift workers

For night workers the cutoff is counted from the time you plan to sleep, not from midnight. If you finish a shift and go to bed at 08:00, a coffee at 06:00 on the way home is only two hours from bed, and the research above suggests it can cut your daytime sleep short. Count back six hours from your planned sleep and your last caffeinated drink should be around 02:00. Our night shift nutrition guide and night shift sleep schedule use the same rule.

The caffeine and sleep debt loop

Poor sleep makes you reach for more caffeine, and more caffeine makes the next night worse. After a few rounds of this you can be running on short sleep and several cups a day without noticing. If this sounds familiar, read our article on sleep debt and weekend catch-up sleep, since paying back the debt usually reduces the urge for extra coffee.

How to cut back without a headache

  1. Move the cutoff first. Bring your last caffeine earlier by an hour or two every few days, before changing the amount.
  2. Then reduce the amount gradually. Cut by about a quarter each week, or swap one cup for half-caffeine or decaf.
  3. Expect some symptoms. Withdrawal headaches, tiredness and irritability are common in the first days and usually pass within about a week.
  4. Replace the ritual. A warm drink like herbal tea keeps the routine without the stimulant.
  5. Add morning light and movement. See morning sunlight and your circadian rhythm for how daylight supports alertness.

Signs caffeine may be affecting your sleep

For more ideas, see how to fall asleep faster and our pre-bed routine guide.

Frequently asked questions

Does decaf affect sleep?

Decaf has very little caffeine, but it is not zero. A cup or two is unlikely to matter for most people, but very sensitive people may notice small amounts.

I fall asleep easily after an evening coffee. Is it really a problem?

It may be. Research suggests that caffeine can reduce total sleep time and the depth of sleep without changing how fast you drop off, and people often do not notice. Try the two-week experiment above and see how you feel.

Does caffeine affect deep sleep?

Studies suggest that caffeine, especially late in the day, can reduce deep, slow-wave sleep and increase lighter sleep. The effect depends on the dose and the person.

What about tea, cola and energy drinks?

They all contain caffeine, just in different amounts, so the same timing rules apply. Energy drinks can contain very high doses.

Can I speed up getting caffeine out of my system?

Not really. Water, exercise or a cold shower will not clear it faster. Only time does. If you have taken too much, wait it out, and seek medical help if you have chest pain, a very fast heartbeat or severe symptoms.

Is caffeine safe for everyone?

No. People with anxiety, heart rhythm problems, reflux, high blood pressure or who are pregnant should ask a doctor about caffeine limits.

Summary

Medical disclaimer: This article is for general information only and is not medical advice. If you have persistent sleep problems, excessive daytime sleepiness, or concerns about caffeine and a health condition or medication, speak with a doctor or pharmacist.