By Nico Jae · ✓ Based on published sleep research · Updated October 2026
Quick answer: Caffeine has a half-life of about 5 hours in most adults, so half of your last coffee is still in your body 5 hours later and a quarter after 10 hours. Smokers clear it faster (about 3.5 hours) and people on the birth control pill slower (about 8 hours). A 2023 meta-analysis found coffee should be finished at least 8.8 hours before bed to protect sleep. Add your drinks and bedtime below to see how much caffeine you will go to bed with, and your personal cutoff time.
Not sure? Most adults are close to average. Pregnancy slows clearance much more than this and is not modeled here.
🔒 Calculations happen in your browser. Nothing you enter is stored or sent anywhere.
Caffeine reaches its peak in your blood within about an hour of drinking it, and then your liver clears it on a steady curve: every half-life, the amount left falls by half. For an average adult that half-life is about 5 hours. So a 95 mg cup of coffee at noon is down to about 48 mg by 5 pm, 24 mg by 10 pm, and 12 mg by 3 am. It takes about five half-lives, roughly a day, for a dose to be almost completely gone.
How long you feel it is a different question. The alert, wired feeling fades well before the caffeine does, which is why an afternoon coffee can still cost you sleep even when you feel calm at bedtime. In sleep studies, caffeine shortens total sleep, makes it take longer to fall asleep, and reduces deep sleep, the most restorative stage. What protects deep sleep is covered in how to get more deep sleep.
| Hours after drinking | 1 coffee (95 mg) | Large dose (200 mg) |
|---|---|---|
| 0 (just drunk) | 95 mg | 200 mg |
| 2 hours | 72 mg | 152 mg |
| 4 hours | 55 mg | 115 mg |
| 5 hours (one half-life) | 48 mg | 100 mg |
| 6 hours | 41 mg | 87 mg |
| 8 hours | 31 mg | 66 mg |
| 10 hours | 24 mg | 50 mg |
| 12 hours | 18 mg | 38 mg |
| 15 hours | 12 mg | 25 mg |
| 24 hours | 3 mg | 7 mg |
Calculated with an average 5-hour half-life. With a 3.5-hour half-life the numbers fall faster; with an 8-hour half-life, a 95 mg coffee still leaves about 40 mg after 10 hours.
The best evidence comes from a 2023 systematic review and meta-analysis of 24 studies. On average, caffeine cut total sleep by 45 minutes, added 9 minutes to the time it took to fall asleep, and reduced deep sleep by about 11 minutes. To avoid losing sleep, the authors calculated that a coffee (107 mg) should be finished at least 8.8 hours before bed, and a standard pre-workout supplement (217.5 mg) at least 13.2 hours before.
An earlier controlled study tested 400 mg of caffeine taken at bedtime, 3 hours before, and 6 hours before, against a placebo. All three disturbed sleep, including the dose taken 6 hours before bed, which led the researchers to recommend avoiding substantial caffeine for at least 6 hours before sleep. For most people with a 10:30 pm bedtime, that puts the last regular coffee at around 1:30 pm.
Why this calculator uses 25 mg as the line: at an average 5-hour half-life, the meta-analysis cutoffs for coffee and pre-workout both leave roughly 30 to 35 mg in your body at bedtime. We use 25 mg as a slightly cautious version of that line, so the cutoff times here run a little earlier than the bare minimum.
| Drink | Typical caffeine | Time to fall below 25 mg* |
|---|---|---|
| Drip coffee (8 oz) | 95 mg | 9.6 hr |
| Espresso (single shot) | 63 mg | 6.7 hr |
| Cold brew (12 oz) | 155 mg | 13.2 hr |
| Black tea (8 oz) | 47 mg | 4.6 hr |
| Green tea (8 oz) | 28 mg | 0.8 hr |
| Cola (12 oz) | 40 mg | 3.4 hr |
| Energy drink (8.4 oz) | 80 mg | 8.4 hr |
| Energy drink (16 oz) | 160 mg | 13.4 hr |
| Pre-workout (1 scoop, 200 mg) | 150 – 300 mg | 15 hr |
Typical values; brands vary widely, so check the label. *At an average 5-hour half-life. The FDA cites 400 mg a day as an amount not generally associated with negative effects in healthy adults, and a large 2017 systematic review reached the same conclusion.
One liver enzyme, CYP1A2, handles about 95 percent of caffeine breakdown, and common genetic differences in it make some people clear caffeine much faster than others. That is why one person can sleep after an evening espresso while another is kept awake by a lunchtime cup. If late caffeine reliably wrecks your sleep, use the slow setting.
Smoking speeds up the same enzyme. In a classic study, the average caffeine half-life was 3.5 hours in smokers and 6.0 hours in non-smokers. One practical consequence: people who quit smoking clear caffeine more slowly afterward, so the same coffee habit can start to cause jitters or poor sleep.
Estrogen-containing birth control pills slow caffeine clearance. In one study, the half-life averaged 7.9 hours in women on the pill against 5.4 hours in matched women who were not. Pregnancy slows it further, especially later in pregnancy, which is part of why advice for pregnant women sets a lower daily limit (200 mg in ACOG guidance; a 2017 review supported up to 300 mg). This calculator does not model pregnancy.
Caffeine clearance also varies with age, liver disease and a number of medicines that compete for the same enzyme. If you take regular medication and notice caffeine affects you more than it used to, ask your pharmacist whether there is an interaction.
Keep the morning coffee and move the last one earlier. For an average metabolizer, finishing a regular coffee about 9 to 10 hours before bed brings bedtime levels under 25 mg. After lunch, switch to green tea or half-caf: at about 28 mg, green tea clears below the line in under an hour. Save pre-workout supplements for morning sessions. If you are getting enough hours but still waking tired, the sleep debt calculator shows whether you are actually short of sleep, and core sleep vs deep sleep explains what your sleep tracker is and is not telling you.
About 5 hours for an average healthy adult, with a wide range between people. In one study it averaged 3.5 hours in smokers and 6.0 hours in non-smokers, and in another 7.9 hours in women taking the birth control pill. Genetics, liver health, some medicines and pregnancy all change it.
Caffeine peaks in your blood within about an hour, and then half of it is cleared every 5 hours or so. A 95 mg coffee is down to about 48 mg after 5 hours, 24 mg after 10 hours and 3 mg after 24 hours. The alert feeling fades sooner than the caffeine itself, which is why an afternoon coffee can still affect sleep.
At least 8.8 hours for a regular coffee and 13.2 hours for a standard pre-workout supplement, according to a 2023 meta-analysis of 24 studies. A controlled study also found 400 mg of caffeine taken 6 hours before bed still disturbed sleep. For a 10:30 pm bedtime, that means finishing coffee by about 1:30 pm.
It takes about five half-lives, roughly 24 hours for an average adult, for a dose to be almost completely cleared. For sleep, what matters is how much is left at bedtime: this calculator flags anything above 25 mg, which a regular coffee drops below after about 9 to 10 hours.
For healthy adults, up to 400 mg a day is not generally associated with harmful effects, according to the FDA and a large 2017 systematic review. That is about four regular cups of coffee. Pregnant women are advised to stay lower, at 200 mg a day in ACOG guidance. Sensitivity varies, so less may be right for you if caffeine causes anxiety, a racing heart or poor sleep.
For your safety
Estimate disclaimer: This calculator provides an educational estimate based on published average half-life values. It is not medical advice, and it does not model pregnancy, liver conditions, or medication interactions. If caffeine affects your heart rhythm, anxiety, or sleep despite an early cutoff, talk to your physician.
This content is not intended to be a substitute for professional medical advice, diagnosis, or treatment. Always seek the advice of your physician or other qualified health provider with any questions you may have regarding a medical condition.