The body clears caffeine exponentially: in each half life period, the amount in your blood falls by half. The average half life in healthy adults is about five hours, so a coffee with 200 milligrams leaves 100 after five hours, 50 after ten, 25 after fifteen. It never quite reaches zero, it just fades below the level you can feel. This is why the afternoon coffee matters more than intuition suggests. A strong coffee at 3 in the afternoon can still have a quarter of its caffeine circulating at 1 in the morning, quietly lightening sleep even in people who swear they can sleep after espresso.
The five hour figure is a population average with wide spread, roughly three to seven hours. Genetics of the liver enzyme CYP1A2 set the baseline. Pregnancy stretches half life dramatically, reaching fifteen hours by the third trimester, and oral contraceptives roughly double it. Smoking does the opposite, speeding clearance by about half. Some antibiotics and other medicines slow it; liver disease slows it. Age matters modestly. This is why caffeine advice can never be one size: the same evening coffee that a fast metabolising smoker shrugs off can cost a slow metaboliser half a night of deep sleep.
Work backwards from bedtime. If you want less than about 50 milligrams active when you sleep, and your half life is five hours, a 200 milligram coffee needs ten hours to fade that far, so a noon cut off protects a 10 in the evening bedtime. Our calculator draws the curve for your intake and timing, including the hours ahead, so you can test your own habits against your own bedtime. If sleep is the problem, move the cut off earlier before you shrink the morning coffee you enjoy; timing fixes more sleep than abstinence lectures ever will. The caffeine calculator above draws the decay for your actual intake, including what will still be circulating two, four, six and eight hours from now, which is the part of the curve most people have never seen.