Personalized Caffeine Half-Life & Sleep Tracker

Your profile (adjusts caffeine half-life)
Half-life auto-adjusts: pregnancy 9h, breastfeeding 6h, smoker 3h, oral contraceptives 7h, liver condition 8h, elderly 6h, anxiety uses stricter limits.

When can I have my last cup of coffee before bed?

Enter your planned bedtime and the dose you want to drink. We compute the latest safe time to drink it and what your caffeine level will be at bedtime.

Sleep Setup
Results
Pick a time and a drink, then click Compute Cutoff.

What have I had today?

Log every caffeinated drink or food you had today. We sum total mg, plot your live clearance curve, and tell you how much is still in your system right now.

Add a drink / food
Your day so far
Live clearance

Visualize your personal caffeine decay

Pick a drink, enter how much you had, and see exactly how much caffeine is in your bloodstream over the next 24 hour based on your profile.

What & when
Decay Curve (24h)
Vertical dashed lines mark half-life multiples. Half-life: 5h based on your profile.

Compare caffeine in 16 drinks and foods

See exactly how much caffeine is in each drink, how long it stays in your system, and how many of each it takes to reach your daily limit.

SourceServingCaffeine (mg)Clear at 95% (h)To hit 200mg
mg values are typical averages for an 8 oz (240 ml) serving unless noted. Clear-at-95% assumes your current profile half-life.

What is your personal safe caffeine limit?

Your profile determines your recommended daily mg. Use the Today's Tracker mode to log what you drink and we will sum against this budget.

Personal Daily Limit
400
mg per day maximum

NHS Pregnancy Check (≤200 mg/day)

The NHS and ACOG both recommend that pregnant or breastfeeding women stay under 200 mg of caffeine per day from all sources combined. Use the Today's Tracker to log your drinks and check here.

Today's Total
0
mg consumed today

Related Tools

Sleep Calculator → Calorie Calculator → Age Calculator → Due Date Calculator → Water Intake (coming) → Percentage Calculator →

Why this beats asking an AI chatbot

Ask ChatGPT or Claude "how long does caffeine last?" and you will get the textbook population average of 5 hours. That number is right for a healthy adult non-smoker. It is wrong for you if you are pregnant (9h), on oral contraceptives (7h), a smoker (3h), over 65 (6h), have a liver condition (8h), or breastfeed (6h). It does not account for the fact that you had two espressos at 2 PM and a green tea at 5 PM. It cannot plot your decay curve. It cannot compare 16 drinks side by side. It cannot tell you, in real time, whether you are over the NHS 200 mg pregnancy limit.

This calculator takes your profile, your drinks, and your target bedtime and answers with deterministic math, a personalized decay curve drawn on Canvas, and a single number you can act on. The math runs entirely in your browser, your data stays in your localStorage, and the answer is the same every time you ask.

About the Caffeine Calculator

This is a free, browser-based caffeine tracker and half-life calculator built for anyone who drinks coffee, tea, energy drinks, or pre-workout and wants to know how caffeine affects their sleep, focus, and health. It runs entirely in your browser — nothing is uploaded to any server.

How caffeine half-life works

Caffeine follows first-order pharmacokinetics. If you drink a 200 mg cup of coffee at 8 AM, half of it (100 mg) is still in your bloodstream at 1 PM (5 hours later). Another half is cleared by 6 PM (50 mg left), and only 25 mg remains at 11 PM. Sleep researchers have shown that even 50 mg of caffeine at bedtime reduces total sleep time by about 30 to 60 minutes and reduces deep sleep. The Sleep Cutoff mode computes the latest time you can drink caffeine so that the residual amount at bedtime is below the level known to disrupt sleep.

Why your half-life is different

Your genetic CYP1A2 enzyme activity is the single biggest factor in caffeine clearance. But common life modifiers also matter: pregnancy roughly doubles clearance time (9 hour half-life vs 5), oral contraceptives extend it to 7 hours, smoking speeds it up to about 3 hours, liver disease slows it to about 8 hours, and being over 65 slows it to about 6 hours. The calculator adjusts the half-life based on the modifiers you check above.

Caffeine and pregnancy

The NHS in the United Kingdom and the American College of Obstetricians and Gynecologists both recommend that pregnant women stay under 200 mg of caffeine per day from all sources combined. That is roughly two 8 oz cups of brewed coffee or four cups of black tea. Observational studies link higher intake to increased miscarriage risk and lower birth weight. The Pregnancy Safe mode sums all drinks you log in the Today's Tracker and shows whether you are under the limit. It also reminds you to count chocolate, cola, and pre-workout supplements.

Sources for caffeine values

The milligrams per serving in this calculator come from USDA FoodData Central, the EFSA Scientific Opinion on Caffeine (2015), the Mayo Clinic caffeine content table, and NHS patient guidance. Values are typical averages for an 8 oz (240 ml) serving. Actual caffeine can vary widely by brand, brew strength, bean origin, and preparation method. A large chain espresso can have 150 mg per shot while a home machine might have 40 mg. Use these values as a starting point, then adjust if your barista tells you a different number.

How accurate is the caffeine half-life math?

The 5-hour average half-life used here is the value reported in most peer-reviewed pharmacokinetic studies for healthy adult non-smokers. Individual variation is large: a CYP1A2 fast metabolizer might clear caffeine in 2.5 hours, a slow metabolizer might take 9 hours. Genetic testing can give you your exact CYP1A2 activity. The modifiers in this calculator (pregnancy, smoking, oral contraceptives, age, liver, breastfeeding) apply published correction factors and are appropriate for the vast majority of users.

Can I use this for ADHD or stimulant medication stacking?

This calculator is designed for caffeine from food and drinks. It does not account for prescription stimulant medications like Adderall, Ritalin, or modafinil. Those have different half-lives, different interactions, and different side effect profiles. Do not use this calculator to make decisions about combining caffeine with prescription medication. Talk to your prescriber.

Does decaf coffee have caffeine?

Yes, but very little. A typical 8 oz cup of decaf brewed coffee contains about 2 mg of caffeine compared to 95 mg in regular coffee. Some "decaf" drinks at specialty coffee shops can have up to 15 mg per serving if the decaffeination process was not thorough. If you are extremely sensitive or are tracking carefully during pregnancy, the Source Comparison mode shows decaf at 2 mg.

What about caffeine withdrawal headaches?

Caffeine withdrawal can start within 12 to 24 hours of your last dose and peak around 20 to 51 hours. Symptoms include headache, fatigue, irritability, and difficulty concentrating. Tapering down by 25% every few days is more comfortable than going cold turkey. This calculator does not currently model a tapering schedule, but the Daily Budget mode shows your target so you can reduce by 50 mg per week.

Is energy drink caffeine different from coffee?

Pharmaceutically, the caffeine molecule is identical whether it comes from coffee, tea, energy drinks, or pills. However, energy drinks often contain additional stimulants (taurine, guarana, L-carnitine, B vitamins) and very high sugar content that can compound the effects. The calculator treats caffeine as caffeine regardless of source, but be aware that an energy drink might feel stronger for reasons beyond just the caffeine mg.

Can I use this for my dog or cat?

No. Caffeine is toxic to dogs and cats, and even small amounts (a few coffee beans or a licked-up spill) can cause dangerous arrhythmias, tremors, and seizures. The "caffeine calculator for dogs" search term you may have seen online refers to veterinary toxicology calculators that estimate the dangerous dose threshold, not how much caffeine your pet can safely drink. If your pet has consumed caffeine, contact your veterinarian or the ASPCA Animal Poison Control Center immediately.

Does the calculator remember my drinks between sessions?

Yes. The Today's Tracker logs every drink you add with a timestamp, source, and number of servings. All of this is saved to your browser's localStorage so it survives a page refresh. You can clear it anytime with the Clear All button, or wipe everything with Reset Everything. Nothing leaves your device.

References & Authoritative Sources