Sleep hygiene · 6 min read
How long caffeine really stays in your system
Caffeine has a half-life of about five to six hours in most adults. That afternoon coffee is still measurably present at bedtime — here is the arithmetic and what to do with it.
Published 27 October 2026 · Updated 15 November 2026
Caffeine does not remove tiredness; it blocks the receptor that tiredness signals through. The adenosine it displaces does not go away, which is why the effect wears off into a slump rather than a smooth decline.
The half-life arithmetic
In healthy adults, caffeine's half-life is commonly quoted as five to six hours, with a normal range of roughly three to seven hours depending on genetics, pregnancy, liver function and some medications. Half-life is not the same as "out of your system": after five half-lives — around 25 to 30 hours — a small fraction is still present.
| Hours after drinking | At 5 h half-life | At 6 h half-life |
|---|---|---|
| 0 | 200 mg | 200 mg |
| 5 | 100 mg | — |
| 6 | — | 100 mg |
| 10 | 25 mg | 35 mg |
| 12 | 12 mg | 25 mg |
| 16 | 3 mg | 16 mg |
That 16 mg at 10 PM sounds trivial next to a 200 mg morning dose. But sleep studies consistently find that doses in the 100 to 400 mg range taken up to six hours before bed measurably reduce total sleep time and deepen the disruption to sleep architecture, particularly slow-wave sleep.
The cut-off that fits most people
If your bedtime is 11 PM and your half-life is average, the last caffeine that reliably clears before sleep is somewhere around 2 to 3 PM. That is the origin of the common "no coffee after 2 PM" rule. It is a reasonable default, not a law: slow metabolisers need a stricter cut-off, fast metabolisers can sometimes drink later without consequence.
- Espresso at 3 PM is often still 50 mg at 9 PM.
- Cola, energy drinks and some pre-workouts contain as much as a coffee.
- Dark chocolate carries a small but non-zero dose; a 50 g block of 85% is roughly 40 mg.
- Decaf is not zero — usually under 10 mg per cup, but not nothing.
A two-week experiment worth running
Rules of thumb only go so far because metabolism varies. A cleaner approach is to test it on yourself:
- For one week, keep caffeine to before noon and log your sleep-onset time.
- For the next week, allow an afternoon coffee at 3 PM and log the same thing.
- Compare time to fall asleep and how many times you wake. Do not change anything else during the test.
- If the difference is under ten minutes, your cut-off can be later than the default. If it is 20 minutes or more, keep the early cut-off.
One trap: caffeine also masks the debt it creates. People who drink it late often report sleeping "fine" while their deep sleep is reduced. If you are relying on caffeine to get through the afternoon, that is itself a signal to look at the previous night rather than at the coffee machine.
Caffeine sensitivity varies widely and interacts with pregnancy, anxiety, reflux and some medications. If you are unsure how it affects you, a clinician or pharmacist is a better guide than a general article.
Half-life, and why the average misleads
Caffeine is cleared by an enzyme whose activity varies several-fold between people. The commonly quoted half-life of about five hours is a population average; in practice it ranges from roughly two hours to nine. That spread explains why one person can drink espresso at 6 PM and sleep at 11, while another is still awake at 2 AM after a 3 PM cup.
The arithmetic is worth doing once. At a five-hour half-life, 200 mg at 2 PM leaves about 100 mg at 7 PM, 50 mg at midnight and 25 mg at 5 AM. A quarter of the original dose is still circulating when the alarm goes off, which is enough to lighten sleep even if it does not keep you awake.
Where the two o clock rule comes from
The cut-off is not a law; it is a rule of thumb built backwards from a typical bedtime and a typical half-life. If you go to bed at 11 PM and want less than a quarter of the dose left, the last coffee needs to be around 2 PM. If your bedtime is 1 AM, the equivalent cut-off is closer to 4 PM. If you are a slow metaboliser, it is earlier still.
An individual test is easy and more useful than the rule. Move your last caffeine two hours earlier for four nights and note how long you take to fall asleep and how many times you wake. Most people find their own cut-off within a week.
What it does to the architecture of the night
Caffeine is an adenosine antagonist, which means it blocks the signal that builds sleep pressure rather than removing the pressure itself. The consequence is that sleep onset is delayed, total sleep time falls, and the deeper stages are reduced even when the person reports sleeping normally. Waking after the first cycle becomes more likely.
The subjective effect is smaller than the objective one, which is the recurring theme with caffeine: people underestimate how much it is costing them because the cost is paid in sleep depth rather than in minutes awake.
Withdrawal, and the week that feels worse
Cutting caffeine abruptly produces headache, irritability and daytime sleepiness for two to nine days, with a peak around day two. The effect is real and it is temporary, but it is also why most attempts to cut down fail on day three: the symptoms are interpreted as evidence that caffeine was necessary.
The workable version is to reduce by about a quarter every four or five days, keep the morning cup, and move the cut-off earlier first. Removing the afternoon dose is the highest-value change and the easiest to hold.
If you are already dependent
Dependence is not a moral failure and it is not the same as addiction in the clinical sense, but it does change what the morning coffee is doing. Once tolerance develops, the first cup restores normal function rather than improving it; the lift you feel is the reversal of overnight withdrawal.
The practical consequence: a morning cup is fine, an afternoon cup is a loan against the night, and an evening cup is a decision to sleep badly. None of those are forbidden. They are just better made deliberately than by habit.
Tea, cola, decaf and the rest
Tea contains roughly 30 to 50 mg per cup, less than coffee but not nothing, and the theanine in green tea softens the subjective edge without removing the adenosine blockade. Cola and energy drinks are frequently underestimated: a large energy drink can carry 150 to 200 mg, which is a strong coffee.
Decaf is not caffeine-free — typically 2 to 15 mg per cup — which matters only for the most sensitive people. Chocolate, some painkillers and several pre-workout supplements also carry meaningful doses, and those are the ones that get missed when someone insists they only drink one coffee a day.
Run the experiment on yourself
The population averages above are useful for setting a starting point, not for deciding your own cut-off. A four-night experiment settles it: keep everything else constant, move your last caffeine to noon, and record how long you take to fall asleep and how many times you wake. Repeat at 2 PM and at 4 PM on the following weeks.
The result is usually clearer than people expect. Most find that the 4 PM dose costs them twenty minutes of sleep onset and one extra waking, and that the 2 PM dose costs almost nothing. That is the whole answer, and it costs four nights rather than a decade of guesswork.
What this means in practice
Three rules cover most situations: keep the first cup at least an hour after waking rather than immediately, stop by early afternoon, and treat the late cup as a decision about tomorrow rather than about this afternoon. The third one is the only one that requires willpower, which is why it is worth making it a rule rather than a judgement call.
For anyone whose sleep is already poor, the caffeine is rarely the main cause — but it is the easiest lever to test, and removing it for two weeks is a cleaner experiment than most of what is sold as sleep advice.
The afternoon slump is not caffeine deficiency
The dip between one and three in the afternoon is a circadian feature present in most people, and it is smaller after a good night and larger after a poor one. Reaching for coffee at that point treats the symptom and pays for it at midnight. Light, movement and a ten-minute walk outside do more and cost nothing.
What to tell someone who says it does not affect them
Most people who report no effect are describing the absence of a subjective effect. The studies that measure sleep directly find reduced deep sleep and more fragmentation even in people who report sleeping normally. The polite version of the argument is: try two weeks without it after 2 PM, keep a note of how you feel at 10 AM, and then decide.
Frequently asked
How long does coffee stay in your system?
Most of a dose clears within five half-lives. At a typical five-to-six-hour half-life, that is roughly 25 to 30 hours for the last traces, with the meaningful sleep effects gone well before that if you stop early enough.
Does caffeine affect sleep if I fall asleep easily?
Yes. Studies show reduced total sleep time and altered sleep architecture even when people report no difficulty falling asleep, because caffeine suppresses deep sleep as well as delaying onset.
Is decaf safe before bed?
Usually, at under about 10 mg per cup. It is not literally caffeine-free, so very sensitive people may still notice an effect.