KissMyAbsClub
Free caffeine & sleep calculator

When should you have your last coffee?

Caffeine fades slowly: on average, about half of it is still active five hours later. Add what you drink today and we'll show how much is left at bedtime.

Caffeine half-life (varies by person)5 h

How caffeine affects sleep

Through the day your brain builds up adenosine, a chemical that makes you feel sleepy. Caffeine works by blocking it, so you feel alert even though the sleep pressure is still there. The catch is that caffeine leaves your body slowly.

Its half-life, the time it takes for half of it to clear, averages around five hours in healthy adults. It varies a lot between people, roughly two to ten hours. So a mid-afternoon coffee can still be working at bedtime.

What the research suggests

A 2023 review that pooled 24 studies (Gardiner et al., Sleep Medicine Reviews) found caffeine shortened total sleep by about 45 minutes and reduced deep sleep. To avoid losing sleep time, it suggested having a regular coffee (about 107 mg) at least 8.8 hours before bed, and a typical pre-workout drink (about 217 mg) at least 13.2 hours before.

You can fall asleep easily and still sleep more lightly after caffeine. Feeling fine at bedtime doesn't mean it has worn off.

Easy ways to keep the benefit and lose the cost

Common questions

How long does caffeine last?
On average about half is gone after five hours and three-quarters after ten, but some people clear it much faster or slower.
Some people drink espresso after dinner and sleep fine. Why?
People process caffeine at different speeds, and tolerance changes how alert you feel. Even then, studies often show lighter sleep than without it.
How accurate is this calculator?
It uses typical caffeine amounts and an average half-life, so treat the result as an estimate. Check labels for exact amounts; energy drinks and pre-workouts vary a lot.

Find out what's wrecking your sleep →

Educational use only. This tool gives general wellness information based on averages. It is not a medical device, does not provide a diagnosis, and does not assess or treat any sleep disorder. People vary. If poor sleep is persistent or affecting your health, please consult a qualified healthcare professional.
Home · Our mission · Sleep quiz · Sleep calculator · Caffeine calculator · Sleep debt calculator
A project of Health Is Power Foundation — a registered public-benefit nonprofit.