Rules for the last cup of the day vary: noon, 2 pm, “nothing after lunch.” The studies help explain why no one rule fits. The answer depends on how much caffeine is in the cup, how long before bed you drink it, and how fast your body clears it.
This page is about timing. Why some people clear caffeine faster than others is in our caffeine metabolism guide, and how much caffeine is in each kind of cup is in our caffeine in coffee guide.
What the sleep studies found
- Drake et al., 2013. Twelve healthy sleepers at home took 400 mg at bedtime, or 3 or 6 hours before. Every timing cut total sleep on a sleep monitor by 1.1 to 1.2 hours. At 6 hours, the sleepers’ own diaries showed no significant change.
- Gardiner et al., 2023, a review of 24 studies. On average, caffeine cut total sleep by 45 minutes and deep sleep by 11.4 minutes. To avoid losing sleep time, the authors put a coffee (107 mg per 250 ml) at least 8.8 hours before bed.
- Gardiner et al., 2025. Twenty-three young men who drank under 300 mg a day took 100 or 400 mg, 12, 8 or 4 hours before bed. The 100 mg dose had no significant effect, even at 4 hours. 400 mg delayed sleep and changed its stages when taken within 12 hours, and broke sleep up more within 8.
They disagree less than they seem to. Drake and the 2025 trial tested big single doses of 400 mg, about what the FDA cites for a whole day, and found them disruptive many hours later. The 2025 trial’s 100 mg dose, about one cup, made no measurable difference in healthy young men. The review’s 8.8 hours is an average across very different studies, not a rule for one person.
The European Food Safety Authority (EFSA) puts the population view this way: “Single doses of 100mg … of caffeine may affect sleep duration and patterns in some adults, particularly when consumed close to bedtime.” Some adults is the point. The 2025 trial’s authors note that adults over 40 have been shown to be more susceptible than the young men they tested.
How much is still in you at bedtime
How much caffeine is left when you go to bed is arithmetic, once you pick a half-life. The table uses our Caffeine Calculator’s model: each drink peaks about 45 minutes after you drink it, then halves every half-life. The 3-, 5- and 8-hour half-lives are the calculator’s Faster, Typical and Slower settings; why people differ is in the metabolism guide.
Caffeine left at an 11 pm bedtime from 100 mg (calculated with the calculator’s model):
| Last 100 mg at | 3-hour half-life | 5-hour half-life | 8-hour half-life |
|---|---|---|---|
| 8 am | about 3 mg | about 13 mg | about 28 mg |
| Noon | about 8 mg | about 22 mg | about 39 mg |
| 2 pm | about 13 mg | about 30 mg | about 47 mg |
| 4 pm | about 21 mg | about 39 mg | about 56 mg |
| 6 pm | about 33 mg | about 51 mg | about 66 mg |
Two things to keep in mind. First, the model is linear: 200 mg leaves twice as much, and drinks add up. The calculator estimates an 8 fl oz drip coffee at 105–195 mg, so one mug can be one to two of these 100 mg units. Second, the studies above measured sleep, not leftover caffeine. There’s no tested bedtime amount to aim for, so read the table as a comparison between times, not a pass mark.
Why you might not notice
People are poor judges of what caffeine does to their sleep. In Drake’s study, caffeine six hours before bed cut sleep by more than an hour on the monitor, yet the sleepers’ diaries didn’t register a significant loss. In the 2025 trial, 400 mg reduced how well the men felt they’d slept only when it was taken 4 hours before bed, although objective changes showed up at 8 and 12 hours too. The authors conclude that people “may have difficulty accurately perceiving the influence of caffeine on sleep quality.”
What changes is the shape of the night. Across the 2023 review’s studies, caffeine lengthened the time to fall asleep by 9 minutes and the time awake after first falling asleep by 12, lowered sleep efficiency by 7%, added light sleep and took away deep sleep. Drake found less deep (slow-wave) sleep when caffeine was taken at bedtime and 6 hours before.
What moves your cutoff
- Dose. A big cold brew or a triple shot is not the same as a small cup. The table in our caffeine in coffee guide shows how far drinks differ.
- How fast you clear caffeine. Smoking speeds clearance; oral contraceptives can double the half-life; pregnancy, some medicines and liver disease slow it. The details and sources are in the metabolism guide.
- Age. As noted above, older adults have been shown to be more susceptible to caffeine’s effect on sleep.
- Decaf isn’t zero. The FDA says decaf coffee “typically has 2 to 15 milligrams in an 8-fluid-ounce cup,” far less than regular coffee, but several cups add up.
Finding your own last-cup time
Treat it as an experiment. Keep your amounts and times steady for a week or two and note how you sleep and how you feel in the morning. If you sleep poorly, move your last caffeinated cup earlier, or switch the afternoon one to decaf, and watch for a change. Because people underrate caffeine’s effect on their own sleep, a steady routine tells you more than one night’s impression.
If you have insomnia, snoring or pauses in breathing, restless legs, or sleep trouble that lasts, ask your clinician. Caffeine timing is one thing to look at, not a treatment. The same goes for pregnancy and for medicines that change how you clear caffeine.
For timing coffee around work, see coffee and productivity; for coffee in a fasting window, see coffee and intermittent fasting.
Sources
- C. Drake, T. Roehrs, J. Shambroom and T. Roth, “Caffeine effects on sleep taken 0, 3, or 6 hours before going to bed,” Journal of Clinical Sleep Medicine 9, no. 11 (2013): 1195–1200, methods, results (Tables 2 and 3) and discussion: doi.org/10.5664/jcsm.3170
- C. Gardiner et al., “The effect of caffeine on subsequent sleep: A systematic review and meta-analysis,” Sleep Medicine Reviews 69 (2023): 101764, abstract: doi.org/10.1016/j.smrv.2023.101764
- C. L. Gardiner et al., “Dose and timing effects of caffeine on subsequent sleep: a randomized clinical crossover trial,” Sleep 48, no. 4 (2025): zsae230, abstract and discussion: doi.org/10.1093/sleep/zsae230
- Institute of Medicine, Caffeine for the Sustainment of Mental Task Performance (National Academies Press, 2001), ch. 2, “Pharmacology of Caffeine,” p. 28 (smoking and oral contraceptives): nationalacademies.org
- European Food Safety Authority, “Caffeine” topic page, summarizing the NDA Panel’s “Scientific Opinion on the safety of caffeine,” EFSA Journal 13, no. 5 (2015): 4102: efsa.europa.eu
- US Food and Drug Administration, “Spilling the Beans: How Much Caffeine is Too Much?”, content current as of August 28, 2024 (the 400 mg figure and decaf): fda.gov
- JayArr Coffee, Caffeine Calculator: the model behind the bedtime table (absorption peaking about 45 minutes after a drink; half-lives of 3, 5 and 8 hours) and the drip coffee estimate