Caffeine & Sleep Calculator
See how much caffeine is still in your system at bedtime, and how early to stop so caffeine is mostly cleared by bedtime.
Caffeine and sleep calculator
Search for a drink above to see what's left at bedtime.
How much are you drinking in total?
Add up the caffeine across your whole day: coffee, tea, soda, and energy drinks.
Caffeine Calculator →How late is too late for caffeine?
Caffeine has a half-life of about five hours. Every five hours, your body clears roughly half of what's left. So a coffee at 2pm is still half there around 7pm.
That means about a quarter of an afternoon coffee is still in your system near midnight. It doesn't feel like much, but it adds up, especially with a second cup or an energy drink.
Caffeine at bedtime can reduce deep sleep even when you fall asleep without trouble. You may wake up tired and not connect it to the 3pm coffee.
Caffeine and sleep questions, answered
When should I stop drinking caffeine before bed?
For most people, a good rule is to stop about 8 to 10 hours before bedtime. With a 5-hour half-life, a regular cup of coffee needs roughly that long to drop under 25 mg. If you go to bed at 11pm, that usually means your last coffee around 1pm to 2pm.
Does afternoon coffee affect sleep?
Often, yes. A 3pm coffee can leave around 30 to 40 mg in your system at 11pm. That is enough for many people to sleep more lightly, even if they don't notice it at the time.
How long before bed should I cut off caffeine?
It depends on how much you have and how sensitive you are. Bigger doses, like an energy drink or cold brew, need a longer runway than a cup of tea. Use the cutoff calculator above to see the latest time for your drink and bedtime.
Why do I sleep badly even when I fall asleep fine?
Caffeine can reduce deep sleep without stopping you from falling asleep. You may wake up feeling unrested and reach for more coffee, which keeps the cycle going. Lowering what's left at bedtime is often the fix.
How do I cut back on caffeine so I sleep better?
Move your last caffeine earlier, then reduce the total slowly. A gradual taper, swapping one cup at a time for decaf, avoids withdrawal headaches while your sleep improves. Keeping your morning ritual makes it much easier to stick with. See the day-by-day withdrawal timeline. Start by seeing your daily total with the Caffeine Calculator.
Join the waitlist and get the free quit guide
The guide now, one note when the app opens in Q4 2026.
Related tools: Caffeine Calculator