Guide
Caffeine half-life and bedtime: how much is left in your body at night and when to stop the last cup
Caffeine keeps you awake by blocking the receptors that tell the brain it is tired. It leaves the body slowly, and a coffee at four in the afternoon can still be active at bedtime. The calculator below adds up the caffeine from the drinks you list, estimates how much remains when you go to bed, and works out the latest time for one more cup if you want the amount at bedtime to stay under a limit of your choice.
How caffeine is cleared
The body removes caffeine in a roughly constant proportion each hour, which gives a half-life. After one half-life half of the dose is left, after two a quarter, and so on. The formula is dose times 0.5 raised to the hours divided by the half-life. The average half-life is around five hours in healthy adults, but it is closer to three in smokers and longer in pregnancy, with some medicines including certain oral contraceptives, and in liver disease. You can change it from 1.5 to 12 hours.
Listing what you drink
Enter one intake per line as time, drink or milligrams, and count. The drinks the tool knows are espresso (63 mg per shot), brewed coffee (95 mg for 240 mL), black tea (47 mg), green tea (28 mg), cola (34 mg per 355 mL) and energy drink (80 mg per 250 mL). These are typical values from food composition data, and real drinks vary widely, so a large coffee-shop cup may have two or three times more. For anything else, write the milligrams, such as 15:00, 100.
A worked example
Press the first sample: two coffees at 08:00, one at 13:30 and an energy drink at 16:00, with bedtime at 23:00 and a half-life of five hours. The total is 365 mg. By bedtime the morning coffees have fallen to 23.8 mg, the afternoon coffee to 25.5 mg and the energy drink to 30.3 mg, so 79.5 mg remains, which is 29.5 mg over a 50 mg limit. For one coffee of 95 mg the latest time is 18:22, for an espresso 21:20 and for an energy drink 19:37. The second sample is a single morning coffee, which leaves 11.9 mg at 22:30.
Changing the half-life
The third sample uses a slow metabolizer with a seven hour half-life and a 25 mg limit: 91 mg remains at bedtime, and one coffee would have to be drunk by 09:31. If you often feel wired in the evening, try a longer half-life in the box and see how much earlier your cut-off moves. You can also lower the limit if you wake in the night.
Daily totals and edge cases
The tool warns when the total goes above 400 mg a day, the amount the US Food and Drug Administration says is not generally linked with harm in healthy adults. Pregnant people are often advised to keep to about 200 mg. Lines must have a time between 00:00 and 23:59, and intakes after midnight are counted as the next morning relative to bedtime. A time after bedtime is treated as the previous day.
Limits
These are estimates built on typical figures and a single clearance curve. They do not describe how caffeine affects your sleep quality, which depends on sensitivity, habit and what else you do before bed. If you sleep badly, a doctor can look for other causes, and cutting caffeine earlier is only one of several useful steps.
Related tools
- Sleep Calculator finds a bedtime that fits whole sleep cycles before your alarm.
- Water Intake Calculator reminds you that drinks count towards daily fluid.
- Calorie Calculator covers the energy side of what you eat and drink.
- Calories Burned Calculator estimates the other side of the day, activity.
Checked against the current version of the Caffeine Calculator on .

