How caffeine leaves your body
Caffeine is cleared from your bloodstream at a roughly exponential rate, described by its half-life — the time it takes for the amount in your body to fall by half. On average that's around 5 hours, so a 200 mg dose drops to about 100 mg after 5 hours, 50 mg after 10 hours, and so on.
This calculator models the remaining caffeine from a single drink as:
and simply adds up every drink you logged. It's a simplified average — real life is messier.
Individual half-life varies a lot, commonly between 4 and 6 hours. It tends to be longer during pregnancy, with certain medications (for example some oral contraceptives), and with reduced liver function; it can be shorter in heavy smokers. Because of this variation, treat the numbers here as a rough guide, not a precise reading.
Timing coffee for better sleep
Even when you fall asleep fine, leftover caffeine can lighten and fragment your sleep. A common approach is to stop caffeine several hours before bed so the amount remaining at bedtime is low. Use the target at bedtime setting to pick how strict you want to be, then check the last coffee by time the tool calculates.
That last-coffee time solves for when a typical 95 mg coffee would decay to your chosen threshold by bedtime: t = bedtime − half-life × log₂(95 ÷ threshold). If you're caffeine-sensitive, aim for the stricter targets and an earlier cutoff.
Frequently asked questions
- How long does caffeine stay in your system?
- With an average half-life of about 5 hours, roughly half clears every 5 hours. After about 5 half-lives (around a day) very little is left — but your personal rate can be anywhere from 4 to 6 hours, and longer in pregnancy or with some medications.
- What is caffeine's half-life?
- Half-life is the time it takes for the amount of caffeine in your body to drop by half. On average it's about 5 hours, so 200 mg falls to roughly 100 mg after 5 hours and about 50 mg after 10 hours.
- When should I stop drinking coffee before bed?
- A common rule of thumb is to stop 8–10 hours before bed, though some people are fine with 6 hours and others need longer. It depends on your dose, your half-life and how sensitive you are; the "last coffee by" time above estimates a cutoff so a typical cup stays under your chosen bedtime threshold.
- How much caffeine is in coffee, espresso, tea and energy drinks?
- Rough typical amounts: an 8 oz brewed coffee has about 95 mg, a single espresso shot about 63 mg, black tea about 47 mg, green tea about 28 mg, and an 8 oz energy drink about 80 mg. See the table below for more, and note that values vary widely by brand and preparation.
- Does caffeine affect everyone the same?
- No. Genetics, pregnancy, some medications and your built-up tolerance all change how quickly you clear caffeine and how strongly you feel it. Two people drinking the same coffee can have very different responses.
- How much caffeine is safe per day?
- For most healthy adults, the U.S. FDA cites up to about 400 mg per day as an amount not generally associated with negative effects. This is general information, not a personal recommendation — needs and tolerances differ.
- Is this medical advice?
- No. This is an informational tool using a simplified average model. It is not medical advice, and individual responses vary — consult a qualified healthcare professional for guidance specific to you.
Caffeine in common drinks
| Drink | Typical caffeine |
|---|---|
| Brewed coffee (8 oz) | ~95 mg |
| Espresso (1 shot) | ~63 mg |
| Cold brew (16 oz) | ~200 mg |
| Black tea | ~47 mg |
| Green tea | ~28 mg |
| Cola (12 oz) | ~34 mg |
| Energy drink (8 oz) | ~80 mg |
These are typical values that vary by brand and preparation.