Skip to main content
Caffeine Half-Life: How Long Coffee Stays in Your System (My 3 p.m. Flat White Was Still Awake at Midnight)
Back to all articles

Caffeine Half-Life: How Long Coffee Stays in Your System (My 3 p.m. Flat White Was Still Awake at Midnight)

SimpleCalculators.net Team13 min read

The clocks went back, it was dark by 4:45, and somewhere around 3 p.m. every afternoon I'd reach for a large flat white to get through the rest of the day. Then I'd lie in bed at 11:30 wondering why my brain was replaying every email I'd sent since Tuesday.

"It can't be the coffee," I told myself. "That was eight hours ago."

So I did the maths. Caffeine has a half-life of roughly five hours in a healthy adult. Eight hours after a 200 mg coffee, about 66 mg is still circulating — roughly the same as drinking a fresh shot of espresso right before turning off the light. I wasn't failing to sleep despite the coffee. I was, chemically speaking, still drinking it.

This guide is for anyone who has an afternoon coffee, tea or energy drink and sleeps worse than they'd like. By the end you'll know how to calculate exactly how much caffeine is left in your system at bedtime — and what your personal cutoff time should be — using the same exponential decay formula physicists use for radioactive isotopes.

⚠️ Disclaimer

This article is for informational purposes only and does not constitute medical advice. Caffeine metabolism varies widely, and pregnancy, medications and liver conditions all change it. Always consult a qualified professional for your specific situation.


What Is Caffeine's Half-Life?

Caffeine half-life is the time it takes your body to clear half of the caffeine in your bloodstream. For healthy, non-pregnant adults it averages about 5 hours, though published studies report a normal range of roughly 2 to 10 hours depending on genetics, smoking, hormones and liver function.

The key word is half. Your liver doesn't remove a fixed number of milligrams per hour — it removes a fixed fraction. That's why caffeine lingers so much longer than intuition suggests. After one half-life you're at 50%. After two, 25%. After three, 12.5%. It takes around five half-lives — about a full day — for caffeine to fall below 5% of the original dose.

Young man sleeping on a laptop at his desk with a hot beverage nearby — the afternoon slump is exactly when most of us reach for the coffee that's still active at bedtime

This is the same maths that governs radioactive decay. Carbon-14 has a half-life of 5,730 years; caffeine has a half-life of about 5 hours. The numbers are wildly different, but the curve has exactly the same shape — which is why you can use our Half-Life Calculator for your coffee just as well as for carbon dating. Set the time unit to hours and enter your own dose.

Caffeine works by blocking adenosine, the chemical that builds up during the day and makes you feel sleepy. While enough caffeine is still occupying those receptors, the "sleep pressure" signal is muffled — even if you feel tired.

Key Takeaway

Caffeine leaves your body by percentage, not by amount. With a 5-hour half-life, a quarter of your 3 p.m. coffee is still active at 1 a.m.


How Do You Calculate How Much Caffeine Is Left?

The standard exponential decay formula works for caffeine exactly as it does for isotopes:

Remaining = Dose × 0.5^(hours elapsed ÷ half-life)

Worked example 1: the 3 p.m. flat white

My afternoon large flat white (a 16 oz / 470 ml coffee-shop drink) carries roughly 200 mg of caffeine. Bedtime is 11 p.m., so 8 hours have passed.

  • Hours ÷ half-life = 8 ÷ 5 = 1.6
  • 0.5^1.6 = 0.330
  • 200 mg × 0.330 = 66 mg still in my system at 11 p.m.

Now compare the same coffee drunk at 10 a.m. instead. By 11 p.m., 13 hours have passed:

  • 13 ÷ 5 = 2.6 → 0.5^2.6 = 0.165
  • 200 mg × 0.165 = 33 mg

Moving one coffee five hours earlier halves the caffeine I take to bed.

Worked example 2: the "I only had three" day

Most people don't drink one coffee. Here's a realistic weekday: a 150 mg coffee at 8 a.m., another 150 mg at 1 p.m., and an 80 mg energy drink (250 ml can) at 4 p.m. Each dose decays independently, so you calculate them separately and add them up at 11 p.m.:

DrinkTimeHours to 11 p.m.Left at 11 p.m.
Coffee, 150 mg8 a.m.1519 mg
Coffee, 150 mg1 p.m.1038 mg
Energy drink, 80 mg4 p.m.730 mg
Total87 mg

That's more caffeine at bedtime than a single fresh espresso shot (about 63 mg). And notice that the "small" 4 p.m. can contributes almost as much as the bigger 1 p.m. coffee because it's so much closer to bedtime.

Close-up of espresso being poured into a glass from a coffee machine in a cafe setting — a single shot contains roughly 63 mg of caffeine

💡 Pro Tip

Use the "Find Elapsed Time" mode on the Half-Life Calculator to work backwards. Enter your dose as the starting amount and the level you want at bedtime as the remaining amount, and it tells you how many hours you need between your last cup and sleep.


How Much Caffeine Is in Your Drink?

You can't calculate what's left without knowing what went in. These are typical values based on figures published by the US Food and Drug Administration (FDA) and the UK Food Standards Agency — individual brands and coffee-shop sizes vary a lot, so check labels where you can.

DrinkServingCaffeine (approx.)
Brewed / filter coffee8 oz (240 ml)95 mg
Large coffee-shop drink16 oz (470 ml)150–300 mg
Espresso1 shot (30 ml)63 mg
Instant coffee1 mug60–80 mg
Black tea8 oz (240 ml)47 mg
Energy drink250 ml can80 mg
Cola12 oz (355 ml) can34 mg

The FDA and the European Food Safety Authority (EFSA) both cite 400 mg per day as an amount not generally associated with harmful effects in healthy adults, and EFSA adds that single doses up to 200 mg are unlikely to raise safety concerns. The NHS advises keeping caffeine under 200 mg a day during pregnancy. Those limits are about safety, though — not sleep. You can be well under 400 mg a day and still go to bed with a meaningful dose on board.

If you brew at home and want a precise figure, our Coffee Ratio Calculator helps you see how many grams of coffee are going into each cup — stronger ratios mean more caffeine per mug.


Why Your Half-Life Might Not Be 5 Hours

Here's where it gets personal. Five hours is an average, and plenty of people sit well outside it. Caffeine is broken down mostly by a single liver enzyme, CYP1A2, and anything that speeds up or slows down that enzyme shifts your half-life.

SituationTypical half-lifeLeft at 11 p.m. from 200 mg at 3 p.m.
Smoker~3 hours31 mg
Average healthy adult~5 hours66 mg
Taking oral contraceptives~8–10 hours100–115 mg
Late pregnancy~15 hours138 mg

Smoking induces CYP1A2, roughly doubling the speed of caffeine clearance — which is one reason people who quit smoking sometimes find their usual coffee suddenly makes them jittery. Oral contraceptives can roughly double caffeine half-life, and in the third trimester of pregnancy it can stretch beyond 15 hours. Some antidepressants and antibiotics (fluvoxamine and ciprofloxacin are well-documented examples) slow it dramatically too.

There's also genetics. Variants of the CYP1A2 gene split people into broadly "fast" and "slow" metabolisers, which is why your colleague can drink an espresso after dinner and sleep like a baby while you can't.

A restless man lying awake on his bed in a dimly lit bedroom at night — residual caffeine can delay sleep onset even when you feel tired

⚠️ Note

Falling asleep fine doesn't mean caffeine isn't affecting you. Caffeine reduces deep (slow-wave) sleep, so you can drop off quickly and still wake up feeling like you barely slept.


What Time Should You Stop Drinking Coffee?

The most-cited study on this question was published in the Journal of Clinical Sleep Medicine in 2013 by Drake and colleagues. They gave people 400 mg of caffeine at bedtime, 3 hours before bed, or 6 hours before bed. Even the 6-hour dose reduced total sleep time by more than an hour — and participants often didn't notice.

There's no official "safe at bedtime" caffeine level, but aiming for under about 50 mg (less than a cup of tea) is a sensible personal target. Using the formula, you can work out the gap you need:

Hours needed = Half-life × log(Target ÷ Dose) ÷ log(0.5)

For a 200 mg coffee and a 50 mg target with a 5-hour half-life: 5 × log(0.25) ÷ log(0.5) = 5 × 2 = 10 hours. With an 11 p.m. bedtime, that's a 1 p.m. cutoff. For a smaller 95 mg mug of filter coffee, the gap shrinks to about 4.6 hours.

Last drinkTarget ≤ 50 mgBedtime 11 p.m. → cutoff
Espresso, 63 mg1.7 hours9:20 p.m.
Filter coffee, 95 mg4.6 hours6:20 p.m.
Large coffee, 200 mg10 hours1:00 p.m.
Large coffee, 300 mg12.9 hours10:05 a.m.

Two things surprised me here. First, size matters far more than timing advice like "no coffee after 2 p.m." suggests — a single espresso after lunch is very different from a venti. Second, if you're a slow metaboliser with an 8-hour half-life, that 200 mg coffee needs a full 16 hours, meaning your last big coffee belongs at breakfast.

A hand holding an open book beside a window with a coffee cup on an orange cloth — swapping the late-afternoon coffee for a smaller cup earlier in the day keeps bedtime caffeine low

What worked for me: I kept the morning coffee, moved the flat white to 12:30 and downsized it to a regular, and swapped the 3 p.m. slot for a decaf (which still has 2–15 mg, but that's noise). Then I used the Sleep Cycle Calculator to pick a bedtime that lined up with full 90-minute cycles. Within a week I was falling asleep before midnight again.

If you're cutting back on coffee in the afternoon, make sure you're still drinking enough overall — our Water Intake Calculator gives a daily target based on your weight and activity.


Frequently Asked Questions

How long does caffeine stay in your system completely?

It takes about five half-lives for caffeine to fall below roughly 3% of the original dose. With an average 5-hour half-life, that's around 25 hours. For practical purposes, most of the stimulant effect is gone after two to three half-lives (10–15 hours), but a large dose can still be measurable the next morning.

Is caffeine half-life the same as how long I feel the buzz?

No. Caffeine peaks in your blood around 30–60 minutes after drinking, and the noticeable buzz often fades within a few hours as your brain adapts. But the caffeine is still there and still blocking adenosine receptors, which is why it can affect sleep long after you stop feeling it.

Can I use a radioactive half-life calculator for caffeine?

Yes. Caffeine elimination follows first-order (exponential) kinetics at normal doses — the same mathematical model as radioactive decay. In the Half-Life Calculator, set the time unit to hours, enter your caffeine dose in mg as the initial amount and about 5 hours as the half-life.

Does drinking water or exercising flush caffeine out faster?

Not meaningfully. Caffeine is cleared mainly by the liver, not the kidneys, so extra water doesn't speed it up. Exercise may make you feel more alert or tired, but it doesn't noticeably change caffeine half-life. Time is the only reliable fix.

Do regular coffee drinkers clear caffeine faster?

Habitual drinkers build tolerance to the alerting effects, but their half-life stays broadly similar. Tolerance makes you feel caffeine less — it doesn't remove it faster — so the sleep effects can persist even when the buzz no longer does.


Try It Yourself

Caffeine doesn't wear off — it halves. With a typical 5-hour half-life, a big afternoon coffee leaves a third of its dose in your system at bedtime, and stacked drinks add up quickly.

Plug your own dose and timing into the Half-Life Calculator (set the unit to hours) to see exactly what you're taking to bed. Then use the Sleep Cycle Calculator to plan your bedtime, and the Coffee Ratio Calculator if you want to brew a slightly weaker afternoon cup.

You Might Also Like