What it does
Caffeine stays in your body longer than most people expect. About half of what you drank at 2 pm is still there at 7 pm. This calculator takes the drinks you list (coffee, tea, energy drink, cola or your own amounts), the time you had each, and a half-life, then draws how much caffeine is in your body through the day and tells you the level at bedtime.
It also adds up your daily total and compares it with the 400 mg a day that the FDA and EFSA give for healthy adults, or 200 mg in pregnancy. It gives estimates, not medical advice, and nothing you type leaves your browser. For when to go to bed use sleep calculator, and for the rest of your fluids water intake.
How to use it
- Check the first drinks in the list, or press “Add a drink”. Pick the type, change the mg if your cup differs, and set the time.
- Set your bedtime and the half-life (5 hours is the usual figure; use 3 to 7).
- Read the daily total, the level at bedtime and the curve. Tick “Pregnant or advised to limit” to compare with 200 mg.
- “Copy result” copies the summary; “Download CSV” saves the drinks and the hourly levels.
What each setting does
- Drink type fills in a typical mg. You can type your own amount.
- Time is when you finished the drink. All of it is counted as taken at once.
- Half-life is how many hours it takes your body to clear half of the caffeine. Smokers clear it faster, pregnancy, some medicines and some liver conditions slow it.
- Bedtime is when you want to be asleep; drinks after it are ignored.
Worked example
Two mugs of coffee at 08:00 and 13:00, 95 mg each, half-life 5 hours, bedtime 23:00. The 08:00 coffee has had 15 hours: 95 x 0.5^(15/5) = 11.9 mg. The 13:00 coffee has had 10 hours: 95 x 0.5^(10/5) = 23.8 mg. About 36 mg is left at bedtime, and the daily total is 190 mg, 48% of 400 mg.
FAQs
Is there a safe bedtime level? There is no official one. Research shows caffeine can shorten sleep even 6 hours before bed, so many people aim for as little as possible.
Is decaf caffeine-free? No, about 2 to 15 mg a cup. Add it as a custom drink.
Why 200 mg in pregnancy? EFSA and other bodies advise this limit; ask your doctor about your case.
Do energy shots count? Yes, type the mg from the label.
Where the numbers come from
- Daily guide of 400 mg for healthy adults: US FDA, Spilling the Beans: How Much Caffeine Is Too Much? (fda.gov, checked 2026-12-05); EFSA Scientific Opinion on the safety of caffeine, EFSA Journal 2015;13(5):4102 (efsa.europa.eu, checked 2026-12-05): 400 mg a day, single doses up to 200 mg, and 200 mg a day for pregnant women, and 3 mg per kg of body weight a day for children and teenagers.
- Typical caffeine per serving (brewed coffee about 95 mg per 240 mL, espresso shot about 63 mg, black tea about 47 mg, green tea about 28 mg, cola about 34 mg per 330 mL): USDA FoodData Central and the FDA page above. Energy drink about 80 mg per 250 mL follows the EU label limit of 32 mg per 100 mL. Real drinks vary a lot, so every number is editable.
- Half-life: caffeine leaves the blood roughly in half every 5 hours in healthy adults (range about 3 to 7 hours; longer in pregnancy and with some medicines), after Institute of Medicine, Caffeine for the Sustainment of Mental Task Performance (2001) and the EFSA opinion. The tool uses simple first-order decay, with each drink taken in at once. Estimates, not medical advice. Check the official source.
Standard scientific values, such as constants, atomic weights and melting points, are facts found in every textbook; we name where ours were checked. If you are an author or publisher and want a value, a credit or a table changed or removed, tell us and we will act quickly.
Last updated 2026-12-05.