A cup of coffee sitting beside a bedside clock showing late evening, suggesting caffeine lingering past a normal cutoff time.

How long does caffeine stay in your system?

By Yash Malviya·

Photo: Eren Li / Pexels

A dose timed 6 hours before bed still cut measured sleep by over an hour in a controlled study, and the people losing that sleep didn't notice it happening.

How long does caffeine stay in your system?

Caffeine's half-life, the time it takes your body to clear half of what you consumed, averages around 5 to 6 hours in a healthy adult, though it ranges from roughly 4 to 8 hours depending on the person. Because clearing the rest takes several more half-lives, full elimination can take 10 hours or longer. A 3pm coffee can still have a meaningful amount of caffeine circulating in your system at midnight, which is longer than most people assume when they reach for an afternoon pick-me-up.

What "half-life" actually means for your coffee habit

Half-life isn't the point at which caffeine disappears, it's the point at which half of it is still there. A commonly cited pharmacology study puts the average at 5.7 hours in healthy adults, so 200mg taken at noon still leaves roughly 100mg in your system by around 5:45pm, and a smaller but real amount well past that. The U.S. National Library of Medicine's consumer health service notes that caffeine reaches its peak level in your blood within about an hour of drinking it, and that its effects commonly last four to six hours, though it also stresses that "some people are more sensitive to the effects of caffeine than others." That sensitivity, not just the half-life number, is a big part of why the same afternoon coffee wrecks one person's sleep and does nothing to someone else's.

“Caffeine taken 6 hours before bedtime has important disruptive effects on sleep.”

Drake et al., Journal of Clinical Sleep Medicine, 2013

The sleep study that caught people off guard

The clearest direct test of this question is a small but carefully controlled 2013 study published in the Journal of Clinical Sleep Medicine. Researchers gave 12 healthy adults a 400mg caffeine pill, roughly the amount in two to three cups of coffee, at either 0, 3, or 6 hours before their normal bedtime, with a placebo at the other times, and measured their sleep at home with validated equipment rather than relying only on self-report. Even at the 6-hour mark, the dose most people would assume is "safely" cleared by bedtime, objectively measured total sleep time was reduced by more than an hour compared with placebo. The authors concluded plainly that "caffeine taken 6 hours before bedtime has important disruptive effects on sleep," and that the result supports advising people to avoid substantial caffeine for at least six hours before bed.

A 2013 sleep-lab study used an at-home EEG monitor, not just self-reports, to catch sleep loss that participants didn't notice themselves.
A 2013 sleep-lab study used an at-home EEG monitor, not just self-reports, to catch sleep loss that participants didn't notice themselves. Photo: Eren Li / Pexels

Why you might not feel caffeine working against you

The part of this study that should change how you think about your own habits is the gap between what participants felt and what the equipment recorded. Their sleep diaries, the subjective report of how well they thought they slept, showed little to no disruption at the 6-hour timing. The objective recording told a different story: real, measurable sleep loss that the people experiencing it did not notice. That mismatch is exactly why "I don't feel like caffeine affects my sleep" is weak evidence on its own. You can lose real sleep to a dose you can no longer feel in your bloodstream and still wake up blaming something else for feeling off.

What changes your personal caffeine clock

The 5 to 6 hour average hides a lot of individual variation, and some of it is extreme. A liver enzyme called CYP1A2 does most of the work of breaking caffeine down, and people with a less active version of that gene clear it noticeably slower. Liver function matters even more directly: one documented clinical case involving a person with alcoholic liver disease recorded a caffeine half-life of 168 hours, about a week, compared with the typical 5 to 6 hours in someone with a healthy liver. Pregnancy changes the picture too, not just through a slower personal clearance rate but because caffeine crosses the placenta to the baby, which is why health agencies advise pregnant people to talk with a provider about limiting intake rather than relying on their usual tolerance.

Fast metabolizers, slow metabolizers, and why your friend can nap after espresso

Genetics does a lot of the explaining here. The CYP1A2 enzyme handles most of caffeine's breakdown, and people carrying a less active version of that gene clear it meaningfully slower than average, which stretches both the half-life and the window during which it can interfere with sleep. Other genetic variants work in the opposite direction: research on a gene called PDSS2 has found some people metabolize caffeine unusually fast, which tracks with the real-world observation that a minority of people can drink coffee at dinner and still fall asleep on schedule. Tolerance adds another layer of confusion on top of genetics. Drinking coffee daily makes the jittery, wired feeling fade faster than the caffeine itself clears your bloodstream, so regular drinkers often feel like caffeine "doesn't affect them" long before it has actually left their system. Feeling awake is not the same measurement as having no caffeine left to metabolize, and the sleep-lab data above is a reminder that your body can still be processing a dose you can no longer feel.

“There is wide variation in both how sensitive people are to the effects of caffeine and how fast they eliminate it from the body.”

U.S. Food and Drug Administration

How much is too much, and when to cut yourself off

For most healthy adults, the FDA points to 400mg a day, about two to three 12-ounce cups of coffee, as the amount "not generally associated with negative effects," while adding that the real threshold depends on body weight, medications, medical conditions and individual sensitivity. If you already struggle to fall or stay asleep, the honest cutoff based on the sleep lab data is earlier than most people's instinct, closer to 8 to 10 hours before bed than the early afternoon many assume is fine. If quitting caffeine outright feels extreme, switching your last cup to decaf rather than cutting the ritual entirely is a reasonable middle step, and if you're using an afternoon nap to cover for bad nights, it's worth checking whether napping is actually making things worse rather than better.

Our take

Caffeine lingers longer than it feels like it does, and the sleep cost of a late dose shows up on a monitor well before you'd ever notice it yourself. You don't need to give up coffee to protect your sleep, but if you're waking up tired for no obvious reason, moving your last cup earlier is a cheap, well-supported experiment before you blame anything else.

This is general information, not medical advice. Talk to a clinician before changing anything, especially if you are pregnant, nursing, or managing a condition.

Frequently asked questions

How long does caffeine stay in your system?

Caffeine's half-life averages 5 to 6 hours in a healthy adult, though it ranges from about 4 to 8 hours depending on the person. Because it takes several half-lives to clear the rest, full elimination can take 10 hours or more, meaning an afternoon coffee can still be active in your system well into the evening.

What is caffeine's half-life?

Half-life is the time it takes your body to clear half of the caffeine you consumed. A commonly cited study puts the average at 5.7 hours in healthy adults, so 200mg taken at noon still leaves roughly 100mg in your system by around 5:45pm, with a smaller amount lingering well beyond that.

Does caffeine in the afternoon really affect sleep at night?

Yes, even when you don't notice it. A controlled 2013 sleep study gave healthy adults a 400mg dose 6 hours before their normal bedtime and found objectively measured sleep time fell by more than an hour, even though their own sleep diaries showed little disruption they were aware of.

How long before bed should I stop drinking coffee?

Sleep researchers behind the controlled caffeine study recommend avoiding substantial caffeine for at least 6 hours before bed, and that is a minimum, not a comfortable buffer. If you're sensitive to caffeine or already have trouble sleeping, 8 to 10 hours before bed is a more realistic cutoff.

Does pregnancy change how long caffeine stays in your body?

Yes. Caffeine crosses the placenta to the baby, and health agencies advise people who are pregnant, trying to become pregnant, or breastfeeding to talk with a health care provider about limiting intake, since a normal pre-pregnancy tolerance doesn't tell you what's appropriate during pregnancy.

How much caffeine is too much in a day?

The FDA points to 400mg a day, roughly 2 to 3 cups of coffee, as the amount not generally associated with negative effects in most healthy adults. The real safe amount for any one person depends on body weight, medications, medical conditions and individual sensitivity to caffeine.

Sources

  1. 1

    Spilling the Beans: How Much Caffeine Is Too Much?, U.S. Food and Drug Administration

  2. 3

    Caffeine, MedlinePlus, National Library of Medicine

  3. 4

    The Half-Life of Caffeine, Caffeine Informer