Caffeine Calculator
You can fall asleep fine after an afternoon coffee and still sleep worse. Enter your bedtime to get your caffeine cutoff β and see exactly how much caffeine is still in your system when you turn out the light.
Your caffeine cutoff
2:00 PM
After this, caffeine is still in your system at bedtime β quietly stealing deep sleep, even if you fall asleep fine.
Your wind-down sequence
Stop eating
7:30 PMLast meal ~3 hours before bed. Late food raises core temperature and fragments deep sleep.
Magnesium (optional)
9:00 PMIf you take it, this supports the wind-down your body is already starting.
Screens off, dim lights
9:30 PMBright/blue light now delays melatonin and pushes your clock later.
Asleep
10:30 PMYour target bedtime β melatonin is flowing and your body is primed for repair.
Already had caffeine today?
See how much is still in your system at bedtime.
At your bedtime, still in your system:
~69 mg (36% left)
That's like drinking ~0.7 cups of coffee right before bed. Move it earlier.
Frequently asked questions
When should I stop drinking coffee?
About 8β9 hours before bed. Caffeine has a half-life of roughly 6 hours, so an afternoon coffee can still be at quarter-strength at bedtime β fragmenting deep sleep even if you fall asleep fine. Enter your bedtime above for your exact cutoff.
How long does caffeine stay in your system?
Caffeine has a half-life of about 5β6 hours, meaning half is gone in that time and a quarter still remains after ~11 hours. So a 2pm coffee can still have meaningful caffeine in you near midnight. The calculator estimates exactly how much, based on when and what you drank.
Does caffeine affect sleep even if I fall asleep fine?
Yes. Caffeine reduces deep, slow-wave sleep β the most physically restorative stage β so you can sleep a full night after a late coffee and still wake unrefreshed.
How much caffeine is in a cup of coffee?
Roughly: small drip coffee ~95mg, large ~195mg, single espresso ~63mg, energy drink ~80mg, black tea ~47mg, cola ~34mg. The calculator uses these to estimate what is left at your bedtime.