Caffeine cutoff calculator
Enter your bedtime and what you drank today. The calculator suggests when to have your last caffeine, using benchmarks from a 2023 research review, and estimates how much is still in your system at bedtime.
Quick answer: A 2023 meta-analysis suggests having a standard coffee (about 107 mg) at least 8.8 hours before bed, and a larger dose of about 217 mg at least 13.2 hours before. For an 11 PM bedtime, that means a regular coffee by about 2 PM. Caffeine’s half-life is usually 3 to 7 hours, so some is still around at bedtime.
Key facts
- Caffeine cut total sleep by about 45 minutes on average across 24 studies (Gardiner et al., 2023)
- Half-life is usually 3 to 7 hours in healthy adults; levels peak about two hours after a drink
- The FDA cites 400 mg a day as an amount not generally associated with negative effects for most adults
- Sensitivity to caffeine varies widely
Runs in your browser. Nothing you enter is stored or sent anywhere.
How it’s calculated
Caffeine left at bedtime, for each drink = dose × 0.5^(hours from the drink to bedtime ÷ half-life), added up across your drinks. You can pick a half-life of 3, 5 (default) or 7 hours, the usual range in healthy adults[3].
- Cutoff time: bedtime − 8.8 hours, or bedtime − 13.2 hours if any single drink is over 160 mg. Those are the benchmarks for about 107 mg and about 217 mg in the 2023 meta-analysis[1]; 160 mg is our switch point between the two.
- Daily total: a note appears above 400 mg, the amount the FDA cites for most adults[5].
Example: 100 mg at 2:00 PM, bedtime 11:00 PM, 5-hour half-life. That is 9 hours, so 100 × 0.5^(9 ÷ 5) ≈ 29 mg is left at bedtime.
How the caffeine calculator works
It gives you two numbers.
A cutoff time. A 2023 systematic review and meta-analysis pooled 24 studies and found that caffeine cut total sleep time by about 45 minutes on average, reduced sleep efficiency by 7%, and added about 9 minutes to the time it took to fall asleep and 12 minutes of time awake after first falling asleep. From those data, the authors suggested having a standard coffee (about 107 mg per 250 mL) at least 8.8 hours before bed, and a larger dose such as a pre-workout supplement (about 217.5 mg) at least 13.2 hours before[1]. The calculator uses whichever of the two benchmarks is closest to your largest drink.
What’s left at bedtime. Caffeine leaves the body gradually. In healthy adults its half-life, the time for the level to fall by half, is usually 3 to 7 hours, and blood levels peak about two hours after a drink[3]. The calculator uses a simple half-life model (5 hours unless you change it) to estimate how much caffeine from each drink remains when you lie down, and shows the range for a fast or slow half-life.
Why caffeine reaches so far into the evening
In a small lab study, 12 healthy adults took 400 mg of caffeine (the FDA puts 400 mg at about two to three 12-ounce cups of coffee[5]) at bedtime, 3 hours before, or 6 hours before. Even the dose taken 6 hours before bed reduced measured total sleep by more than an hour, and the authors suggested avoiding substantial caffeine for at least 6 hours before bed[2]. The later review suggests the window can be longer still for typical drinks[1].
People also differ a lot. One liver enzyme, CYP1A2, handles about 95% of caffeine breakdown, and genes, smoking, hormones and medicines all change how fast it works[4]. Smoking roughly doubles how fast caffeine is cleared, oral contraceptives can roughly double its half-life, and in pregnancy the half-life gets considerably longer[3]. If you are pregnant, the FDA advises asking your health care provider about caffeine[5].
About the drink amounts
The presets are rough. The FDA lists 12 ounces of brewed coffee at about 113 to 247 mg, black tea at about 71 mg, green tea at about 37 mg, soft drinks at about 23 to 83 mg and energy drinks at about 41 to 246 mg, and an 8 ounce decaf at about 2 to 15 mg. The FDA cites 400 mg a day as an amount not generally associated with negative effects for most adults, though sensitivity varies widely[5]. Check the label of your own drink if it lists caffeine.
Using the result
- If your last drink lands after the cutoff, try moving it earlier by an hour a week, or switch the afternoon cup to decaf or green tea.
- If you nap, plan the coffee around it with the nap alarm calculator.
- Pick a realistic bedtime first. The sleep cycle calculator can suggest one from your alarm time.
- Still wired at bedtime? A few minutes of slow, paced breathing or a low, steady sound like brown noise may make the wait more comfortable.
Questions
How many hours before bed should I stop drinking coffee?
A 2023 meta-analysis suggested at least 8.8 hours for a standard coffee of about 107 mg, and at least 13.2 hours for a larger dose of about 217 mg. For an 11 PM bedtime that means a regular coffee by about 2 PM.
What is the half-life of caffeine?
In healthy adults it is usually 3 to 7 hours. It varies with genes, smoking, oral contraceptives, pregnancy and some medicines, so the calculator lets you choose a fast, typical or slow half-life.
Can I still sleep after an evening coffee?
Many people fall asleep, but studies measuring sleep found caffeine still shortened it and made it lighter, even when taken 6 hours before bed. Feeling sleepy is not the same as sleeping well.
Does decaf have caffeine?
A little. The FDA says an 8 ounce cup of decaf coffee usually has about 2 to 15 mg.
Is my data sent anywhere?
No. The calculator runs in your browser and does not store or send what you enter.
Sources
- Gardiner C et al. The effect of caffeine on subsequent sleep: A systematic review and meta-analysis. Sleep Medicine Reviews, 2023.
- Drake C et al. Caffeine effects on sleep taken 0, 3, or 6 hours before going to bed. Journal of Clinical Sleep Medicine, 2013.
- Temple JL et al. The Safety of Ingested Caffeine: A Comprehensive Review. Frontiers in Psychiatry, 2017.
- Nehlig A. Interindividual Differences in Caffeine Metabolism and Factors Driving Caffeine Consumption. Pharmacological Reviews, 2018.
- U.S. Food and Drug Administration. Spilling the Beans: How Much Caffeine is Too Much? Current as of August 28, 2024.
This tool gives general estimates for healthy adults and is not medical advice. If you are often tired despite enough time in bed, snore loudly, or struggle to sleep on most nights, talk to a doctor or a sleep specialist.