Caffeine Cutoff Calculator
Caffeine has a half-life of roughly five hours, so an afternoon coffee is still working at midnight. Enter your bedtime and your usual drink, and this tells you the latest time to finish your last caffeinated cup, plus what is still in your system at lights out.
Last call for caffeine
The science behind the 40 mg threshold and the half-life ranges is covered in the caffeine safety guide. Tracking your whole day instead? Use the caffeine tab of the coffee calculator.