Last cup before bed: when to stop drinking caffeine
Caffeine has a long tail. Because it halves roughly every 5.7 hours, an afternoon coffee can still be working at midnight. This tool finds the latest clock time you can have a standard cup and still be under about 100 mg when you go to bed.
Estimates for general information, not medical advice.
How to use it
- 1Set your bedtime.
- 2Add any caffeine you have already had today.
- 3Read the “latest cup before bed” time the calculator returns.
Why the cutoff is personal, not a fixed hour
The popular advice to stop caffeine by 2 pm is a blunt rule. The real cutoff depends on three things: how much caffeine you have already had today, your bedtime, and how fast you metabolize it. A single 95 mg cup on an otherwise caffeine-free afternoon clears the 100 mg sleep threshold in under an hour, so a 9 pm coffee could be fine for an 11 pm bedtime. But stack that cup on top of a 200 mg cold brew from the morning and the picture changes — the residual from earlier drinks counts too.
What 100 mg at bedtime means
Research on caffeine and sleep often centers on the dose still circulating when you lie down. Around 100 mg in the system at bedtime is enough to lengthen the time it takes to fall asleep and to trim deep, slow-wave sleep for many people, even those who insist coffee does not affect them. Because caffeine halves every 5.7 hours, working backwards from your bedtime and target threshold gives a concrete clock time — which is exactly what this tool computes.
Make it automatic
Recalculating the cutoff every time you have a drink is tedious. The CoffeeLog app keeps your decay curve live and shows the latest-cup time on your home screen, nudging you before an evening coffee would cross the line.
Frequently asked questions
How many hours before bed should I stop caffeine?
A common guideline is 8–10 hours, but it depends on the dose and your metabolism. From a 95 mg cup it takes under an hour to clear the 100 mg sleep line if you have had nothing else; from a large energy drink it can be many hours.
Why does afternoon coffee affect sleep?
With a 5.7-hour half-life, about a quarter of a 2 pm coffee is still circulating near midnight. Even when you do not feel wired, that residual caffeine can reduce deep sleep.
Does caffeine before bed really reduce sleep quality?
Yes. Studies show caffeine taken even 6 hours before bed can cut total sleep time and reduce deep sleep, often without the person noticing. The effect is on sleep architecture, not just falling asleep.
Track this automatically with CoffeeLog
Log any drink in one tap, watch caffeine fade in real time on your home screen, and get a nudge before it touches your sleep — the same engine that powers this page.
Related
TrackCaffeine provides general reference information about caffeine. It is not medical advice. Caffeine values are public-source estimates, not exact measurements.