Free tool · no sign-up
Caffeine half‑life calculator
Add your drinks and your bedtime. See how much caffeine is still in you when you lie down, and the last time for a coffee.
Your bedtime
Your drinks today
- 8:00 AM Brewed coffee, 12 oz 180 mg
- 2:30 PM Black tea, 8 oz 47 mg
No drinks yet. Add the first one.
How fast your body clears it
Half-life, the time to clear half. Smoking speeds it up. The pill and pregnancy slow it down.
Still in you at 11:00 PM
Left of the 227 mg you had before bed. The FDA cites 400 mg a day for most adults.
Last coffee for an 11:00 PM bedtime
- About 5 hours to clear half
- Caffeine's average half-life in healthy adults, anywhere from 1.5 to 9.5 hours between people. NCBI
- You may not feel it
- In a 2025 trial, a late 400 mg dose cut people's sleep without them noticing. Sleep, 2025
- An estimate, not a test
- Drinks vary a lot: a 12 oz coffee can hold 113 to 247 mg. FDA
Caffeine cut-off
Sleep on time, then get up at the first alarm.
Bed Quitter is an alarm that keeps ringing until you get out of bed and move. You pick one of seven moves, your phone's camera counts a few reps, and no photo or video from the camera leaves your phone.
You're on the list. We'll email you once, at launch.
Or try it now: let your camera count 5 squats
How the calculator works
Your body clears caffeine at a steady rate: every half-life, half of what's left is gone. The calculator takes each drink, counts the hours from it to your bedtime, and halves its caffeine once for every half-life in between.
With the average 5-hour half-life, the 180 mg coffee at 8:00 AM is 15 hours before bed, three half-lives, so 22.5 mg is left. The 47 mg tea at 2:30 PM is 8.5 hours before bed, leaving 14.5 mg. Together that's about 37 mg when you lie down.
It counts each drink as all in you the moment you have it. Caffeine really takes up to an hour to peak, so the numbers lean slightly high, which is the safer side for sleep.
What the studies found
In a 2013 study, 400 mg of caffeine taken at bedtime, 3 hours before or 6 hours before each disturbed sleep at home. Even at 6 hours, people lost enough sleep that the authors backed the advice to stop at least 6 hours before bed (Drake 2013).
A 2023 review of 24 studies found caffeine cut sleep by 45 minutes on average and left less deep sleep. To keep the full night, it put a cup of coffee at least 8.8 hours before bed, and a pre-workout drink at least 13.2 hours (Gardiner 2023).
The same team's 2025 trial found 100 mg, less than a 12 oz coffee, made no clear difference up to 4 hours before bed. 400 mg within 12 hours of bed did, and people often didn't feel it (Gardiner 2025).
Caffeine in common drinks
| Drink | Size | Caffeine |
|---|---|---|
| Brewed coffee | 12 fl oz | 113 to 247 mg |
| Black tea | 12 fl oz | 71 mg |
| Green tea | 12 fl oz | 37 mg |
| Cola or soda | 12 fl oz | 23 to 83 mg |
| Energy drink | 12 fl oz | 41 to 246 mg |
| Decaf coffee | 8 fl oz | 2 to 15 mg |
From the FDA. Where it gives a range, the calculator takes the middle, so a 12 oz brewed coffee counts as 180 mg.
Questions people ask
How long does caffeine stay in your system?
Half of it is gone in about 5 hours on average, but that ranges from 1.5 to 9.5 hours between people. After two half-lives a quarter is left, after three an eighth. So a coffee at 8 AM still leaves about an eighth of its caffeine at 11 PM.
When should I stop drinking coffee?
The NHS says no tea or coffee for at least 6 hours before bed. A 2023 review of 24 studies put it later for a cup of coffee: at least 8.8 hours before bed, and 13.2 hours for a pre-workout drink. For an 11 PM bedtime, that's 5 PM or about 2 PM.
Caffeine doesn't keep me up. Does it still matter?
It can. In a 2025 trial, 400 mg within 12 hours of bed disturbed people's sleep on the monitors, yet they often didn't rate their sleep any worse. Falling asleep fine doesn't mean the sleep was as deep or as long.
How much caffeine is too much in a day?
The FDA cites 400 mg a day as an amount not generally linked to harmful effects in most adults. Europe's food safety agency says the same, and adds 200 mg at a time. Both say it's different in pregnancy, so ask your doctor or midwife.
Does decaf have caffeine?
A little. The FDA puts an 8 oz cup of decaf at 2 to 15 mg, against 113 to 247 mg for a 12 oz brewed coffee.
Why are the drink amounts only estimates?
Coffee varies with the beans, the brew and the cup, and energy drinks and sodas with the brand. The calculator takes the middle of the FDA's range. If the can or the coffee shop gives a number, pick Something else and type it.
Sources
- Institute of Medicine, pharmacology of caffeine (NCBI Bookshelf, 2001) · Half-life about 5 hours on average, from 1.5 to 9.5 hours between people. Smoking speeds it up; the contraceptive pill and pregnancy slow it down.
- NHS, insomnia (reviewed 19 March 2024) · No alcohol, tea or coffee for at least 6 hours before bed.
- Drake and others, caffeine 0, 3 or 6 hours before bed (Journal of Clinical Sleep Medicine, 2013) · 400 mg at bedtime, 3 hours or 6 hours before it each disturbed sleep at home, compared with a placebo.
- Gardiner and others, the effect of caffeine on sleep (Sleep Medicine Reviews, 2023) · Across 24 studies, caffeine cut sleep by 45 minutes. A coffee of 107 mg should be at least 8.8 hours before bed, a pre-workout drink of 217.5 mg at least 13.2.
- Gardiner and others, dose and timing of caffeine (Sleep, 2025) · 100 mg up to 4 hours before bed made no clear difference; 400 mg within 12 hours did, and people often did not notice it.
- FDA, Spilling the beans (updated 28 August 2024) · Caffeine per drink, and 400 mg a day as an amount not generally linked to harmful effects in most adults.
- EFSA, scientific opinion on the safety of caffeine (2015) · Up to 400 mg a day, and 200 mg at a time, is no safety concern for healthy adults who are not pregnant.
Facts checked on . An estimate from averages, not medical advice.
More free tools
Free tool
Will my alarm go off?
Do Not Disturb, silent, a call or low power: see if your alarm will ring tonight.
Free tool
Wake-up time calculator
Any wake-up time, or when to wake if you go to bed now.
Free tool
Snooze cost calculator
How much time a year your snooze button takes, on a receipt to share.