Caffeine is the world's most widely used stimulant — and most of us dramatically underestimate how much we take in. A single cold brew can pack over 200 mg, and that 4 p.m. energy drink is still working its way through your system when you get into bed. This calculator adds up your daily caffeine from coffee, tea, and energy drinks, compares it against the widely cited 400 mg daily ceiling for healthy adults, and — most usefully — estimates how much caffeine will still be circulating at your bedtime.
The sleep-impact estimate uses caffeine's average half-life of about 5 hours in healthy adults. After 5 hours roughly half of the caffeine remains, after 10 hours a quarter, and after 15 hours an eighth. That means a 200 mg energy drink at 4 p.m. still leaves around 100 mg in your body at 9 p.m. and 50 mg at 2 a.m. — plenty to fragment your sleep, even if you fall asleep easily. The calculator also shows when your dose will have mostly cleared (dropped below 25 mg), so you can see why morning-only caffeine is the sleep-friendly habit.
Keep in mind that caffeine content varies by brand, brew method, and serving size — the figures here are typical averages. Individual sensitivity also varies a lot: genetics, smoking, oral contraceptives, and pregnancy all change caffeine's half-life, which can range from 3 to 7 hours. Treat the numbers as a practical guide, not a medical assessment.
How to use the Caffeine Calculator
- Pick your drink — choose the closest match; each option shows its typical caffeine in mg.
- Enter how many you drink per day of that type.
- Set the time you usually drink it and your usual bedtime.
- Click Calculate Caffeine to see your total intake, how it compares to the 400 mg limit, what remains at bedtime, and when it clears your system.
Tips for smarter caffeine habits
- Keep caffeine to the first half of the day — the 8–10 hour rule: stop 8–10 hours before bed.
- Afternoon slumps often respond to a 20-minute walk or a glass of water as well as a coffee does.
- If you are pregnant, breastfeeding, or take medication, check with your doctor — your safe limit is lower.
- Headaches, jitters, or a racing heart are signals to cut back, even if you are under 400 mg.
How the numbers are estimated
Your total is the drink's typical caffeine content multiplied by the number of drinks. The daily-limit comparison divides that total by 400 mg, the amount the FDA cites as not generally associated with dangerous effects for healthy adults. Bedtime caffeine uses exponential decay with a 5-hour half-life: remaining = total × 0.5^(hours ÷ 5), where hours is the time from consumption to bedtime (rolling past midnight if needed). The clear time is when the dose decays below 25 mg, a level at which most people notice no stimulating effect.
Frequently asked questions
How much caffeine is safe per day?
The FDA cites 400 mg per day as the amount not generally associated with dangerous effects for healthy adults — roughly four 8-oz cups of brewed coffee. Individual sensitivity varies, and the limit is lower during pregnancy.
How long does caffeine stay in your system?
Caffeine has an average half-life of about 5 hours in healthy adults: half remains after 5 hours, a quarter after 10 hours. It can take 12–15 hours to clear most of a strong dose.
What time should I stop drinking coffee?
As a rule of thumb, avoid caffeine 8–10 hours before bed. This calculator shows exactly how much caffeine remains at your bedtime so you can pick your own cutoff.
Why can I not sleep after an afternoon coffee?
A 200 mg energy drink at 4 p.m. still leaves about 100 mg in your body at 9 p.m. and 50 mg at 2 a.m. — enough to fragment sleep even if you fall asleep easily. Morning-only caffeine avoids most of this effect.