Free Sleep Tool

Caffeine Calculator

See how much caffeine is still in your system at bedtime, and the latest time to have your last coffee so it does not steal your sleep.

Also try our Sleep Calculator and Sleep Quiz, or read up on natural sleep aids if caffeine is not your only issue.

How the caffeine calculator works

Your body clears caffeine slowly. On average it has a half-life of about 5 to 6 hours, which means half of what you drank is still in your system 5 to 6 hours later, and a quarter is still there after 11 hours. That afternoon coffee can quietly follow you to bed.

This calculator estimates how much caffeine is left at your bedtime based on your drink size and when you had it, then works out the latest time to have that drink so the amount left stays low. It is a helpful guide, not a medical measurement, because how fast you clear caffeine depends on your genetics, tolerance, age, and any medications.

If caffeine is only part of the picture, a dark, cool, quiet room and a steady schedule matter just as much. See our bedroom setup guide and sleep habits guide for the rest.

This tool is general information, not medical advice. If you have a heart condition, are pregnant, or take medication, talk to your doctor about caffeine.

Frequently Asked Questions

How long does caffeine stay in your system?

Caffeine has a half-life of roughly 5 to 6 hours in most adults, so about half is still in your body 5 to 6 hours after you drink it. A coffee at 3pm can leave a meaningful amount in your system near a 10pm bedtime.

When should I stop drinking coffee before bed?

A common guideline is to stop caffeine about 8 to 10 hours before bed. This calculator gives you a personalized cutoff based on your drink size and bedtime, aiming to keep the amount left at bedtime low.

How much caffeine is too much before bed?

There is no exact number, since sensitivity varies. As a rough guide, keeping the amount left at bedtime under about 50 mg is a reasonable target for many people. Sensitive sleepers should aim lower and allow more time.

Does caffeine affect everyone the same way?

No. Genetics, tolerance, age, medications, and pregnancy all change how fast you clear caffeine. Half-life can range from about 4 to 6 hours or longer, so treat these results as an average, not a precise medical value.