Caffeine's half-life in a typical healthy adult is roughly 5 to 6 hours, meaning about half of the caffeine from a cup you drink at 3pm is still active in your system around 8 or 9pm, and a smaller but real amount is still present well past that. This is the single most useful fact for figuring out your own personal cutoff time, and it is longer than most people intuitively assume.
Sleep researchers, including work summarized by the Sleep Foundation and Cleveland Clinic, generally recommend stopping caffeine intake at least 6 hours before your intended bedtime as a reasonable baseline, though individual sensitivity varies enough that this is genuinely a starting point to adjust from rather than a fixed rule everyone should follow identically.
Caffeine's effect on sleep is not just about whether it keeps you awake at the exact moment of trying to fall asleep, research has shown it can also reduce total sleep time and, notably, reduce the amount of deep, slow-wave sleep even when a person reports falling asleep without noticeable difficulty. This matters because deep sleep is disproportionately responsible for the physically restorative benefits of a night's sleep, so caffeine can genuinely be degrading your sleep quality even on nights you do not consciously feel it kept you up.
Individual metabolism varies meaningfully here due to genetics, specifically variation in the CYP1A2 gene, which controls how quickly your liver processes caffeine. Some people are genuinely "fast metabolizers" who clear caffeine from their system considerably quicker than average and can tolerate a later cup with less sleep disruption, while "slow metabolizers" hold onto caffeine's effects for longer than the average half-life would suggest, and there is no easy way to know which category you fall into without paying close attention to your own sleep quality after cups taken at different times.
Age is a second, well-documented factor, caffeine's half-life tends to lengthen somewhat as people get older, meaning a cutoff time that worked fine in your twenties may need to move earlier as you age, even if your daily intake amount has not changed at all.
A practical way to find your own real cutoff, rather than relying purely on the general 6-hour guideline, is to track your sleep quality, not just whether you fall asleep, but how rested you feel the next morning, against your last coffee time for a couple of weeks, gradually moving your last cup earlier if you notice a pattern of worse mornings following later cups. This kind of simple, personal experiment is genuinely more useful than any universal number, since caffeine sensitivity varies so much between individuals. The Sleep Foundation has a detailed breakdown of the underlying research if you want the evidence behind the general guideline.
If you love the ritual of an afternoon or evening coffee but want to protect your sleep, decaf, covered in our decaf explainer, is a genuinely reasonable way to keep the habit while removing most of the caffeine that would otherwise be working against you later that night. Perfect Daily Grind covers how much caffeine actually remains in a decaf cup, which is the number that matters for this decision. Students working late will find the same advice turned into an order in our guide to the best coffee for studying at night.