When should you have your last coffee?
Caffeine lingers long after the buzz fades. Log today’s caffeine and your bedtime to see how much will still be in your system when you try to sleep, and the latest time you can have one more.
Adjust for your metabolism
Caffeine’s half-life averages about 5 hours in healthy adults, but it varies widely from person to person.
Estimated half-life: 5.0 hours. Liver disease, especially cirrhosis, can slow clearance far more than this calculator models. Some antibiotics (such as ciprofloxacin) and other medicines also slow it, so use the custom half-life if your clinician has flagged an interaction.
- Highest level today0 mg
- Falls below your targetNow
How this works
The calculator models how your body absorbs caffeine over about an hour and then clears it at a steady rate set by your half-life. It adds up every drink you log and tracks the total through the first few hours of sleep.
The 30 mg default comes from a 2023 meta-analysis, which found that a standard cup of coffee needed to be finished at least 8.8 hours before bed to avoid losing sleep time. With a 5 hour half-life, that cup has fallen to about 30 mg by bedtime. There’s no official bedtime limit, so treat higher targets as a judgment call for people who sleep well with some caffeine on board. For reference, 400 mg taken even 6 hours before bed cut total sleep by more than an hour in a controlled trial.
Times before 4 AM count as the following night. Caffeine amounts are typical label and USDA values. Check your total for the whole day with the daily caffeine calculator, or plan a step-down with the caffeine taper planner.
Want the evidence behind these numbers? Read Is caffeine good for you? A physician’s evidence review.
- Gardiner C, Weakley J, Burke LM, et al. The effect of caffeine on subsequent sleep: a systematic review and meta-analysis. Sleep Med Rev. 2023;69:101764. doi:10.1016/j.smrv.2023.101764
- Drake C, Roehrs T, Shambroom J, Roth T. Caffeine effects on sleep taken 0, 3, or 6 hours before going to bed. J Clin Sleep Med. 2013;9(11):1195-1200. doi:10.5664/jcsm.3170
- Nehlig A. Interindividual differences in caffeine metabolism and factors driving caffeine consumption. Pharmacol Rev. 2018;70(2):384-411. doi:10.1124/pr.117.014407
- Jeppesen U, Loft S, Poulsen HE, Brøsen K. A fluvoxamine-caffeine interaction study. Pharmacogenetics. 1996;6(3):213-222.
- van Dam RM, Hu FB, Willett WC. Coffee, caffeine, and health. N Engl J Med. 2020;383:369-378. doi:10.1056/NEJMra1816604
Built by Mahiar Rabie, MD. Estimates for education only, not medical advice.
Better sleep makes every fat loss and strength goal easier.