Health & Fitness9 min read

How Long Does Caffeine Stay in Your System? (And Why It Wrecks Your Sleep)

How long caffeine really stays in your body, what a half-life of 5 to 6 hours means for your afternoon coffee, why it ruins sleep even when you feel fine, and how to time caffeine so it does not keep you up.

You had a coffee at 4pm, felt completely normal, went to bed at 11pm, and then lay there wide awake wondering why. The answer is simple and surprising: that coffee was still working. Caffeine stays in your system far longer than most people realize, and it disrupts sleep even when you no longer feel alert.

This guide explains exactly how long caffeine lasts in your body, what the often-quoted half-life really means, why it sabotages sleep silently, and how to time your caffeine so you get the boost without the 2am ceiling-stare.

The Short Answer

Caffeine has a half-life of roughly 5 to 6 hours in a healthy adult. Half-life means the time it takes your body to clear half of a dose. So if you drink a coffee with 200 mg of caffeine at 3pm:

  • By around 8pm, about 100 mg is still in your system
  • By around 1am, about 50 mg is still there
  • By around 6am, about 25 mg remains

That afternoon coffee is still measurably active in your bloodstream in the middle of the night. You stopped feeling it hours ago, but feeling and clearance are not the same thing. This is the core reason caffeine and sleep problems are so often linked without people making the connection.

What Half-Life Really Means

A half-life of 5 to 6 hours does not mean caffeine is gone in 5 to 6 hours. It means half of it is gone. It takes roughly 5 half-lives for a substance to be effectively cleared, which for caffeine is around 25 to 30 hours for full elimination of a single dose.

That sounds alarming, and for the small remaining amounts it is not a practical problem. But the period that matters for sleep is the first two half-lives, roughly 10 to 12 hours, because that is when enough caffeine is still circulating to interfere with falling and staying asleep.

This is why the timing of your last caffeine matters so much more than the total amount. A 200 mg coffee at 8am is almost entirely cleared by bedtime. The exact same coffee at 4pm is still half-present when you try to sleep.

Why It Wrecks Sleep Even When You Feel Fine

Caffeine works by blocking adenosine, a chemical that builds up in your brain through the day and creates the pressure to sleep. The longer you are awake, the more adenosine accumulates, and the sleepier you feel. Caffeine fits into the same receptors and blocks adenosine from docking, which is why you feel alert.

Here is the catch. Blocking adenosine does not remove it. The sleep pressure keeps building behind the blockade. You stop feeling the caffeine because your body adjusts, but the adenosine receptors are still partly occupied. When you lie down to sleep, the caffeine that is still present keeps interfering, even though you feel perfectly calm.

Studies measuring sleep quality have found that caffeine taken even 6 hours before bed measurably reduces total sleep time and deep sleep, and people in those studies often did not notice the effect subjectively. Their sleep was worse, but they did not feel like the caffeine had done it. That gap between how you feel and what is actually happening is exactly why afternoon caffeine is so easy to get wrong.

What Affects How Fast You Clear Caffeine

The 5 to 6 hour half-life is an average. Your personal rate varies a lot based on:

  • Genetics. A gene that controls the main caffeine-metabolizing enzyme makes some people fast metabolizers and others slow. Slow metabolizers can take twice as long to clear caffeine and are far more sensitive to its sleep effects.
  • Pregnancy. Caffeine clearance slows dramatically in pregnancy, with the half-life sometimes doubling or tripling.
  • Certain medications. Some, including certain oral contraceptives and antidepressants, slow caffeine metabolism significantly.
  • Smoking. Smoking speeds caffeine clearance, which is why people who quit smoking often suddenly feel jittery on their usual coffee.
  • Liver function and age. Both affect how quickly caffeine is broken down.

If you are sensitive to caffeine, drink it earlier than the average person should, or skip it later in the day entirely.

How Much Caffeine Is in Common Drinks

Knowing the timing is only useful if you know the dose. Rough amounts:

DrinkTypical Caffeine
Brewed coffee (240 ml)95 to 165 mg
Espresso (single shot)60 to 75 mg
Black tea (240 ml)40 to 70 mg
Green tea (240 ml)30 to 50 mg
Energy drink (250 ml)80 to 150 mg
Cola (350 ml)30 to 45 mg
Dark chocolate (50 g)25 to 40 mg

People routinely underestimate how much they consume because the doses add up. Two morning coffees, a tea after lunch, and a chocolate bar in the afternoon is well over 300 mg, with a meaningful chunk arriving late enough to touch your sleep.

The Practical Fix: A Caffeine Cutoff Time

The simplest, most effective change is a caffeine cutoff time. Based on the half-life, a good default is to stop all caffeine at least 8 to 10 hours before bed. If you sleep at 11pm, that means your last caffeine no later than 1pm to 3pm. Sensitive or slow metabolizers should aim earlier still.

This single habit, with no reduction in total intake, fixes a surprising amount of "I cannot fall asleep" frustration. You keep your morning coffee. You just move the afternoon one earlier or swap it for something without caffeine.

Tracking this is easier with a tool that does the math for you. Decaf logs what you drink from a database of over 100 drinks and shows a live decay curve estimating how much caffeine is still in your system right now, plus when you will be sleep-ready. Instead of guessing whether that 4pm coffee will haunt you, you can see it. You can download Decaf free and start logging today.

The Bottom Line

Caffeine has a half-life of about 5 to 6 hours, stays meaningfully active for 10 to 12 hours, and disrupts sleep even when you no longer feel it. The fix is not necessarily drinking less. It is drinking earlier. Set a cutoff time, respect your personal sensitivity, and watch how much easier falling asleep becomes.

If you want to go further and cut back overall, see our guides on quitting caffeine without the withdrawal headache and how much caffeine per day is actually safe.

Frequently Asked Questions

Does caffeine affect sleep even if I fall asleep fine?

Yes. Studies show caffeine taken even 6 hours before bed measurably reduces total sleep time and deep sleep, and people usually do not notice the effect. You can fall asleep normally and still get lighter, shorter sleep because caffeine is still blocking adenosine receptors.

How many hours before bed should I stop drinking caffeine?

A good default is 8 to 10 hours before bed. If you sleep at 11pm, that means your last caffeine no later than 1pm to 3pm. Slow metabolizers and caffeine-sensitive people should stop earlier still.

Is caffeine completely out of your system after 24 hours?

Not quite. Full elimination of a single dose takes roughly 25 to 30 hours, about 5 half-lives. The window that matters for sleep is the first 10 to 12 hours, when enough caffeine is still circulating to interfere with falling and staying asleep.

Why does coffee affect me more than other people?

Mostly genetics. A gene controlling the main caffeine-metabolizing enzyme makes some people slow metabolizers who can take twice as long to clear caffeine. Pregnancy, certain medications, age, and whether you smoke also change how fast you process it.

Try Decaf: Caffeine Tracker

Mentioned in this article. Download free from the App Store.

More Articles