Habits
Caffeine at Bedtime Calculator
Caffeine blocks adenosine, a chemical that builds sleep pressure during the day. The body clears it gradually: in healthy adults about half is eliminated every few hours, with a commonly cited average around 5 hours and wide differences between people. Enter the dose, when you had it and your bedtime to estimate how much is left when you turn in, and a suggested latest time for caffeine based on a published study.
How it works
Caffeine elimination is modeled as exponential decay: remaining = dose x 0.5^(hours elapsed / half-life). The 6 hour cutoff is bedtime minus 6 hours, based on a study in which 400 mg taken 6 hours before bed still reduced measured sleep time by more than an hour.
Example
150 mg at 2:00 PM with bedtime at 10:30 PM is 8.5 hours. With a 5 hour half-life, 150 x 0.5^(8.5/5) = 150 x 0.31 = about 46 mg remains, roughly 31 percent of the dose.
Assumptions and limits
- A 5 hour half-life is a typical adult figure; reported values range from roughly 2 to 10 hours.
- Half-life is longer in pregnancy and with some medicines and liver disease, and shorter in people who smoke. Absorption over the first 30 to 60 minutes is ignored.
- Caffeine content varies widely: the FDA lists 113 to 247 mg for 12 fl oz of brewed coffee, 71 mg for black tea and 37 mg for green tea (12 fl oz), and 41 to 246 mg for 12 fl oz of energy drink.
- Sensitivity varies; some people sleep poorly even with small amounts.
Frequently asked questions
How late can I have coffee?
In a 2013 study in the Journal of Clinical Sleep Medicine, 400 mg of caffeine taken 6 hours before bedtime cut objectively measured sleep by more than an hour, and participants did not notice. The authors suggested avoiding substantial caffeine for at least 6 hours before bed.
How much caffeine is too much?
The FDA says 400 mg a day is an amount not generally associated with negative effects for most healthy adults, roughly two to three 12 ounce cups of coffee. Pregnant or breastfeeding people and people taking some medicines should ask a clinician.
Why does caffeine keep me awake?
During waking hours the brain builds up adenosine, which promotes sleepiness. Caffeine blocks adenosine receptors, so you feel less sleep pressure while it is active.
Does decaf have caffeine?
Usually a small amount. The FDA notes decaf coffee and tea contain less caffeine than regular versions but still contain some.
Sources
Tools and screening scores are general information. They cannot diagnose or rule out a sleep disorder. Read our medical disclaimer.