Yes, afternoon caffeine can disturb sleep, especially in larger amounts. But a universal “no coffee after 2 pm” rule misses two important details: how much caffeine you have and when you go to bed. Sensitivity varies, too.123
A 2025 randomized crossover trial tested 100 mg and 400 mg of caffeine at 12, 8, and 4 hours before bedtime in 23 young men. The 400 mg dose affected aspects of sleep even at the earliest timing; disruption generally increased nearer bedtime. The 100 mg dose showed no statistically significant difference from placebo at the tested times.1
That does not establish that 100 mg is harmless for every sleeper. A small trial in young men cannot tell us how every age group, health condition, or individual will respond.1
Six hours is not a guarantee
An earlier controlled study compared 400 mg of caffeine taken at bedtime, three hours beforehand, or six hours beforehand with placebo. Sleep was disrupted at all three timings. It provides a reason to consider caffeine well before the evening, rather than only avoiding it immediately before bed.2
Both studies tested specific caffeine doses. They do not tell us that every afternoon cup has the same effect. “A coffee” is not a standard measurement: serving size and caffeine content differ considerably.123
Put your own routine in context
Check the amount as well as the time. Include tea, energy drinks, supplements, and other caffeine sources in the picture.3
If you cut back, doing so gradually can make withdrawal less unpleasant. Decaffeinated coffee can still contain a little caffeine.3
Pregnancy, breastfeeding, medicines, and some health conditions can change the advice that fits you. Ask a clinician about your circumstances.3
A closer look at the evidence
The 2025 trial compared caffeine with placebo using a double-blind crossover design and objective sleep measurements.1