How to use it
- Enter the time you plan to go to bed.
- Add each caffeinated drink with the time you had it. Picking a drink fills in a typical amount, which you can edit.
- Read the total left at bedtime, then check the table for the latest time you could have one more.
Drinks are counted as taken during the 24 hours before the bedtime you entered. Changing the drink, the amount or the time changes the result straight away.
The formula
Caffeine left = dose × 0.5 (hours before bed ÷ half-life)
The calculator works this out for each drink and adds the results. For example, 180 mg taken 15 hours before bed, with a 5-hour half-life, has halved three times and leaves about 23 mg. Tea with 71 mg taken 8 hours before bed leaves about 23 mg as well, so the pair comes to roughly 46 mg.
To find the latest time for another drink, it takes the room left under your limit and solves the same formula for the number of hours:
Hours needed = half-life × log2 (dose ÷ room left)
What this estimate leaves out
The model is deliberately simple. It treats caffeine as fully absorbed at the moment you drink it and then falling steadily. In real life absorption takes a while, and clearance differs a great deal between people. Age, body weight, pregnancy, medicines, smoking and liver health all affect it. The half-life choices here sit at the middle and upper end of the range, so the cut-off times lean toward caution compared with a 4-hour average.
The amount in a drink also varies with brand, brew and size. These are the defaults used here:
| Drink | Default caffeine |
|---|---|
| Brewed coffee, 12 fl oz (355 ml) | 180 mg |
| Brewed coffee, 8 fl oz (240 ml) | 120 mg |
| Espresso, single shot | 63 mg |
| Black tea, 12 fl oz (355 ml) | 71 mg |
| Green tea, 12 fl oz (355 ml) | 37 mg |
| Caffeinated soft drink, 12 fl oz (355 ml) | 53 mg |
| Energy drink, 12 fl oz (355 ml) | 140 mg |
| Decaf coffee, 8 fl oz (240 ml) | 8 mg |
Tea figures follow the FDA’s typical amounts for 12 fluid ounces. Coffee, soft drink, energy drink and decaf defaults are rounded values near the middle of the FDA’s ranges. The espresso figure comes from U.S. Department of Agriculture food data.
About the 50 mg starting limit
No official body sets a safe amount of caffeine to have in your system at lights-out. The starting value gives you something to plan against. If you sleep badly, try a lower limit for a week or two and see whether it helps.
Cutting back comfortably
- Move your last coffee earlier by half an hour every few days.
- Switch the afternoon drink to a smaller size, then to decaf or a caffeine-free option.
- Check labels on energy drinks, pre-workout powders and some pain relievers.
- Reducing suddenly can cause headaches and tiredness for a few days, so taper if you drink a lot.
Once your cut-off is set, use the bedtime calculator to pick the time to switch off, or the nap calculator if you need a short rest instead of another cup.
Frequently asked questions
When should I stop drinking caffeine before bed?
It depends on the dose and on you. In a 2013 study, 400 mg of caffeine taken 6 hours before bed still reduced sleep by more than an hour. Smaller drinks need less time. The calculator estimates a cut-off for your own drinks.
What is caffeine half-life?
It is the time your body takes to clear half of the caffeine. The European Food Safety Authority gives an average of about 4 hours in healthy adults, with a range of roughly 2 to 8 hours.
Which half-life should I choose?
Start with 5 hours. Choose 6 or 8 if caffeine seems to affect you for a long time, or if a health professional has told you that you clear it slowly, for example during pregnancy or with certain medicines.
Is 50 mg at bedtime safe for sleep?
The limit is a planning target chosen for this tool, not a medical threshold. Some people are disturbed by less. Lower the number if you are sensitive.
How much caffeine is in a cup of coffee?
It varies widely. The U.S. Food and Drug Administration gives 113 to 247 mg for 12 fluid ounces of regular brewed coffee. Check the label or the seller’s figures and edit the amount if you know it.
Does decaf contain caffeine?
Yes, a little. The FDA puts decaf coffee at about 2 to 15 mg in an 8 fluid ounce cup.
How much caffeine is too much in a day?
For most adults the FDA has cited 400 mg a day as an amount not generally associated with negative effects. Advice differs for pregnancy, children, some medicines and health conditions.
Guides that go with this calculator
Sources
- Spilling the Beans: How Much Caffeine Is Too Much?. U.S. Food and Drug Administration.
- EFSA explains risk assessment: Caffeine. European Food Safety Authority.
- Caffeine Effects on Sleep Taken 0, 3, or 6 Hours before Going to Bed (Drake et al., 2013). Journal of Clinical Sleep Medicine.
- FoodData Central. U.S. Department of Agriculture.