Caffeine & Melatonin Cut-Off Calculator
Save on GoogleFind the last time you can drink caffeine without hurting tonight's sleep. Enter your bedtime, your drink or dose in milligrams, and how fast you clear caffeine to get your cut-off deadline, the caffeine left at bedtime and your natural melatonin window. Everything is calculated privately in your browser.
← Want your full bedtime plan? Use our Complete Sleep Calculator & Bedtime MatrixTarget bedtime
Beverage or supplement
Caffeine dose (mg)
How fast do you clear caffeine?
Safe caffeine cut-off
Caffeine left at bedtime
Natural melatonin onset
Screens-down curfew
The cut-off is the time when the remaining caffeine falls to about 50 mg, using a simple half-life model. Caffeine peaks 30 to 60 minutes after drinking. Keep total daily caffeine under 400 mg for healthy adults.
How Caffeine Works in Your Body
Caffeine is absorbed within 30 to 60 minutes and reaches peak levels in your blood about an hour after you drink it. It blocks adenosine receptors in the brain, so the sleep pressure that builds up all day stops registering. The caffeine does not make you less tired, it only hides the tiredness, which is why the effect ends in a crash and why late doses make it harder to fall asleep.
Half-Life and the Cut-Off Formula
The liver clears caffeine at a steady proportion, so the amount left follows a half-life curve. The average half-life is 5 to 7 hours, which means half the dose is still active after that time. This calculator uses 5 hours for fast metabolizers, 6 hours for average and 7 hours for slow metabolizers. The cut-off is the time at which the remaining caffeine drops to about 50 mg, a level that is unlikely to disturb sleep for most people. The formula is: hours before bed = half-life × log2(dose ÷ 50).
Your personal half-life can be different. Oral contraceptives can roughly double it, pregnancy lengthens it further, and smoking shortens it. If you often lie awake after afternoon coffee, choose slow metabolizer.
Caffeine and the Melatonin Window
Melatonin is the hormone that signals night. Under dim light it starts rising about 2 hours before your usual bedtime. Bright screens suppress it, and caffeine can delay it: one study found that caffeine taken 3 hours before bed delayed the body clock by about 40 minutes. Protecting the window means dimming lights and finishing caffeine before it opens. If you use melatonin supplements, they are usually taken 30 to 60 minutes before bed, and you should talk to a doctor first.
Step-by-Step Examples
200 mg Cold Brew, Bedtime 11:00 PM
Enter 200 mg and 11:00 PM with an average metabolizer. Your cut-off is 11:00 AM, 12 hours before bed, and 200 mg has fallen to 50 mg by then. A fast metabolizer can push this to 1:00 PM, and a slow one needs 9:00 AM.
Double Espresso Before a 10:30 PM Bedtime
Choose the double espresso at 126 mg with an average metabolizer. The cut-off is 2:25 PM, about 8 hours before bed, because 126 mg needs about 1.3 half-lives to fall to 50 mg. Use the tool to see the exact time for your own bedtime.
Energy Drink and a Midnight Bedtime
Choose a 160 mg energy drink, a midnight bedtime and slow metabolizer. The calculator gives a cut-off of 12:15 PM, almost 12 hours before bed. A second can at 6:00 PM would still leave about 90 mg in your system at midnight.
Beverage and Supplement Caffeine vs Required Clearance Hours
Forty common drinks and supplements with typical caffeine content and the hours needed to fall to 50 mg. The last column assumes an 11:00 PM bedtime and an average metabolizer. Caffeine content varies by brand and preparation, so check the label when you can.
| Beverage / Supplement | Serving Size | Caffeine | Clearance: Fast (5h) | Clearance: Average (6h) | Clearance: Slow (7h) | Latest Drink for 11 PM Bed (Average) |
|---|---|---|---|---|---|---|
| Espresso, single shot | 1 oz (30 ml) | 63 mg | 1.7 h | 2.0 h | 2.3 h | 8:55 PM |
| Espresso, double shot | 2 oz (60 ml) | 126 mg | 6.7 h | 8.0 h | 9.3 h | 2:55 PM |
| Latte or cappuccino (1 shot) | 12 oz | 63 mg | 1.7 h | 2.0 h | 2.3 h | 8:55 PM |
| Instant coffee | 8 oz | 62 mg | 1.6 h | 1.9 h | 2.2 h | 9:05 PM |
| Drip coffee | 8 oz | 95 mg | 4.6 h | 5.6 h | 6.5 h | 5:25 PM |
| Drip coffee | 12 oz | 140 mg | 7.4 h | 8.9 h | 10.4 h | 2:05 PM |
| Drip coffee | 16 oz | 190 mg | 9.6 h | 11.6 h | 13.5 h | 11:25 AM |
| Cold brew | 12 oz | 155 mg | 8.2 h | 9.8 h | 11.4 h | 1:10 PM |
| Cold brew | 16 oz | 205 mg | 10.2 h | 12.2 h | 14.2 h | 10:45 AM |
| Cold brew | 20 oz | 310 mg | 13.2 h | 15.8 h | 18.4 h | 7:10 AM |
| Decaf coffee | 8 oz | 3 mg | 0.0 h | 0.0 h | 0.0 h | Any time before bed |
| Black tea | 8 oz | 47 mg | 0.0 h | 0.0 h | 0.0 h | Any time before bed |
| Oolong tea | 8 oz | 38 mg | 0.0 h | 0.0 h | 0.0 h | Any time before bed |
| Green tea | 8 oz | 28 mg | 0.0 h | 0.0 h | 0.0 h | Any time before bed |
| White tea | 8 oz | 20 mg | 0.0 h | 0.0 h | 0.0 h | Any time before bed |
| Matcha | 8 oz (about 2 g powder) | 70 mg | 2.4 h | 2.9 h | 3.4 h | 8:05 PM |
| Yerba mate | 8 oz | 85 mg | 3.8 h | 4.6 h | 5.4 h | 6:20 PM |
| Chai latte | 12 oz | 60 mg | 1.3 h | 1.6 h | 1.8 h | 9:25 PM |
| Bottled iced tea | 16 oz | 40 mg | 0.0 h | 0.0 h | 0.0 h | Any time before bed |
| Kombucha | 8 oz | 15 mg | 0.0 h | 0.0 h | 0.0 h | Any time before bed |
| Cola | 12 oz can | 34 mg | 0.0 h | 0.0 h | 0.0 h | Any time before bed |
| Diet cola | 12 oz can | 46 mg | 0.0 h | 0.0 h | 0.0 h | Any time before bed |
| Dr Pepper | 12 oz can | 41 mg | 0.0 h | 0.0 h | 0.0 h | Any time before bed |
| Mountain Dew | 12 oz can | 54 mg | 0.6 h | 0.7 h | 0.8 h | 10:20 PM |
| Red Bull | 8.4 oz can | 80 mg | 3.4 h | 4.1 h | 4.7 h | 6:55 PM |
| Red Bull | 12 oz can | 114 mg | 5.9 h | 7.1 h | 8.3 h | 3:50 PM |
| Monster | 16 oz can | 160 mg | 8.4 h | 10.1 h | 11.7 h | 12:55 PM |
| Rockstar | 16 oz can | 160 mg | 8.4 h | 10.1 h | 11.7 h | 12:55 PM |
| Celsius | 12 oz can | 200 mg | 10.0 h | 12.0 h | 14.0 h | 11:00 AM |
| High-caffeine energy drink | 16 oz can | 300 mg | 12.9 h | 15.5 h | 18.1 h | 7:25 AM |
| Energy shot | 2 oz bottle | 200 mg | 10.0 h | 12.0 h | 14.0 h | 11:00 AM |
| Caffeine pill | 100 mg tablet | 100 mg | 5.0 h | 6.0 h | 7.0 h | 5:00 PM |
| Caffeine pill | 200 mg tablet | 200 mg | 10.0 h | 12.0 h | 14.0 h | 11:00 AM |
| Pre-workout (moderate) | 1 scoop | 200 mg | 10.0 h | 12.0 h | 14.0 h | 11:00 AM |
| Pre-workout (high-stimulant) | 1 scoop | 300 mg | 12.9 h | 15.5 h | 18.1 h | 7:25 AM |
| Headache tablets with caffeine | 2 tablets | 130 mg | 6.9 h | 8.3 h | 9.6 h | 2:40 PM |
| Caffeine gum | 1 piece | 50 mg | 0.0 h | 0.0 h | 0.0 h | Any time before bed |
| Dark chocolate (70-85%) | 1 oz bar | 23 mg | 0.0 h | 0.0 h | 0.0 h | Any time before bed |
| Milk chocolate bar | 1.5 oz | 10 mg | 0.0 h | 0.0 h | 0.0 h | Any time before bed |
| Hot cocoa | 8 oz | 5 mg | 0.0 h | 0.0 h | 0.0 h | Any time before bed |
Hourly Adenosine Receptor Clearance Timeline
The percentage of caffeine remaining at each hour after you drink it for each metabolizer type, plus the milligrams left from a 200 mg dose.
| Time After Drinking | Remaining: Fast (5h) | Remaining: Average (6h) | Remaining: Slow (7h) | From a 200 mg Dose (Average) | Adenosine Receptor Effect | Sleep Impact |
|---|---|---|---|---|---|---|
| 1 h | 87% | 89% | 91% | 178 mg | Peak blood levels; receptors strongly blocked | Alertness at its highest |
| 2 h | 76% | 79% | 82% | 159 mg | Strong block continues | Still far too soon for any bedtime |
| 4 h | 57% | 63% | 67% | 126 mg | Moderate to strong block | Falling asleep is still likely to be delayed |
| 6 h | 44% | 50% | 55% | 100 mg | Moderate block; roughly half remains | Drake et al. (2013): 400 mg taken 6 h before bed cut sleep by over an hour |
| 8 h | 33% | 40% | 45% | 79 mg | Mild to moderate block | Lighter, less deep sleep is still possible |
| 10 h | 25% | 31% | 37% | 63 mg | Mild block | Small effect for most people with a normal serving |
| 12 h | 19% | 25% | 30% | 50 mg | Low residual block | Usually fine after a single standard serving |
| 16 h | 11% | 16% | 21% | 31 mg | Trace amounts | No meaningful effect on tonight's sleep |
| 24 h | 4% | 6% | 9% | 13 mg | Mostly cleared | Cleared before the next day's first dose |
Melatonin Suppression Risk by Screen Light and Evening Stimulants
Risk levels are approximate and depend on brightness, distance and how long you are exposed. Use them as a guide for your evening routine.
| Evening Exposure | Typical Intensity | Melatonin Suppression Risk | Approximate Effect | Curfew Before Bed | Mitigation |
|---|---|---|---|---|---|
| Bright overhead room light | Over 200 lux | High | Clear suppression and later melatonin onset | 2 hours before bed | Switch to warm lamps under 30 lux |
| Phone or tablet at full brightness | Blue-rich, held close to the eyes | High | Suppresses melatonin and delays sleep onset | 2 hours before bed | Lower brightness, hold it farther away, use night mode |
| Backlit e-reader or tablet reading | Blue-rich, sustained use | High | Chang et al. (2015): melatonin onset delayed by roughly 1.5 h | 1–2 hours before bed | Read a paper book or use an e-ink reader |
| Laptop or TV | Moderate brightness, farther away | Moderate | Smaller delay that grows with brightness and time | 1 hour before bed | Turn on night mode and dim the room |
| Night mode and low brightness | Warm, dimmed screen | Low to moderate | Reduces but does not remove the effect | 30–60 minutes before bed | Pair with room lights turned down |
| Dim warm lamps | Under 30 lux | Low | Little effect on melatonin | Fine up to bedtime | Use amber bulbs in bedroom and bathroom |
| Blue-blocking glasses | Amber lenses | Low | Can limit the blue-light effect of screens | Wear 2 hours before bed | Combine with dimmer screens |
| Caffeine within 6 hours | Over 50 mg remaining | Moderate | Burke et al. (2015): caffeine 3 h before bed delayed the body clock by about 40 min | Use your cut-off time | Stop caffeine at the calculated deadline |
| Caffeine plus bright screens | Both stimulants together | High | Effects stack: later onset and lighter sleep | Cut-off time and 2 hours of dim light | Drop both in the evening |
| Nicotine | Stimulant, shorter half-life | Moderate | Raises arousal and fragments sleep | At least 2 hours before bed | Avoid late-evening use |
Frequently Asked Questions
| Question | Answer |
|---|---|
| How many hours before bed should I stop drinking caffeine? | For a typical cup of coffee, stop about 6 hours before bed. Larger doses need more time: a 200 mg drink needs about 12 hours with an average 6-hour half-life. A lab study found that even 400 mg taken 6 hours before bed cut sleep by over an hour. |
| How long does caffeine stay in your system? | Caffeine has an average half-life of 5 to 7 hours, so half the dose is still in your body after that time. After about 10 to 12 hours a single cup is mostly cleared, but genetics, pregnancy, oral contraceptives and smoking can speed it up or slow it down. |
| Does caffeine affect melatonin? | Yes. Caffeine blocks adenosine and can delay your body clock: one study found caffeine taken 3 hours before bed delayed melatonin onset by about 40 minutes. Natural melatonin starts rising about 2 hours before sleep, so stopping caffeine and dimming lights before then protects it. |
| Does decaf coffee have caffeine? | Yes, a small amount. An 8 oz cup of decaf usually has about 2 to 7 mg, which is far below the 50 mg threshold used here, so it is fine for most people in the evening. |
| Can I take melatonin and caffeine on the same day? | Generally yes, as long as the caffeine ends by your cut-off time. Melatonin supplements are usually taken around 30 to 60 minutes before bed, so caffeine in the afternoon will not overlap. Speak to a doctor or pharmacist before taking melatonin regularly. |
Medical disclaimer: This calculator is an educational tool and not medical advice. Caffeine is not suitable for everyone, including people who are pregnant, have heart rhythm problems, anxiety or high blood pressure, so ask a doctor first. If you cannot sleep despite stopping caffeine early, speak to a doctor about insomnia or another sleep disorder.