Caffeine and Sleep Calculator

Caffeine doesn't wear off when the buzz does. Enter your last drink and your bedtime to estimate how much is still in your system when you try to fall asleep.

Caffeine's half-life is about 4 hours in healthy adults, with a range of roughly 2 to 8. In a controlled study, a 400 mg dose disrupted sleep even when taken 6 hours before bed.

Ready to find your starting point?

Start free on iOS Start free on Android
–caffeine still active at bedtime
–of what you drank, still active at bedtime
–latest time for this drink to be under 100 mg by bedtime

Ready to find your starting point?

Start free on iOS Start free on Android

How the estimate works

Caffeine is cleared from the body at a roughly constant rate: every half-life, about half of what is left is gone. The European Food Safety Authority puts the half-life at about 4 hours on average in healthy adults, with a range of roughly 2 to 8 hours between people. The calculator multiplies your dose by one half for every half-life between your drink and your bedtime. Caffeine amounts per drink are from the U.S. Food and Drug Administration; where the FDA gives a range, we use the middle of it.

It is an estimate, not a measurement. Half-life is longer during pregnancy (EFSA reports 6–16 hours) and in women taking oral contraceptives, and shorter in smokers. The 100 mg reference is EFSA's observation that single doses of 100 mg may affect sleep in some adults when taken close to bedtime — not a safe limit for everyone.

What the research says

  • In a controlled study, 400 mg of caffeine taken 0, 3 or even 6 hours before bedtime each significantly disrupted sleep compared with a placebo. The authors recommend avoiding substantial caffeine for at least 6 hours before bed.
  • EFSA considers up to 400 mg a day and single doses up to 200 mg safe for healthy adults (not pregnant women). For pregnant and breastfeeding women the figure is up to 200 mg a day.
  • The FDA likewise cites 400 mg a day — about two to three 12-ounce cups of brewed coffee — as an amount not generally associated with negative effects in healthy adults.

Sources

Educational estimate, not medical advice. If you are pregnant, take medication or have a heart condition, ask a doctor about caffeine.

Page last reviewed: September 2026.

Find Out What's Holding You Back

Free to download. Analysis, education, and habit tracking in one app. Premium unlocks the full library.

Free to download • No credit card required • iOS & Android • Age 13+

Frequently asked questions

How long does caffeine stay in your system?

Caffeine has a half-life of about 4 hours in healthy adults, with a range of roughly 2 to 8 hours, according to the European Food Safety Authority. That means about half of a dose is still active 4 hours later and about a quarter 8 hours later.

How many hours before bed should you stop drinking coffee?

A controlled sleep study found that 400 mg of caffeine disrupted sleep even when taken 6 hours before bedtime, and its authors recommend avoiding substantial caffeine for at least 6 hours before bed. Smaller doses and slower metabolisms change the timing, which the calculator above estimates.

How much caffeine is in a cup of coffee?

The FDA lists 113 to 247 mg of caffeine for 12 fluid ounces (355 ml) of regular brewed coffee, 71 mg for black tea, 37 mg for green tea, 23 to 83 mg for caffeinated soft drinks and 41 to 246 mg for energy drinks, all per 12 fluid ounces.

How much caffeine a day is safe?

For healthy adults, EFSA considers up to 400 mg a day and single doses up to 200 mg safe; the FDA also cites 400 mg a day. For pregnant and breastfeeding women, EFSA's figure is up to 200 mg a day.

Can a small amount of caffeine affect sleep?

Yes, for some people. EFSA notes that single doses of 100 mg of caffeine may affect sleep duration and patterns in some adults, particularly when consumed close to bedtime.

Download free — iOS & Android