Caffeine is the most widely used sleep-affecting drug in the world, and most of its effect on sleep is a matter of timing rather than amount. Move the last cup a few hours earlier and, for many people, sleep changes without anything else being adjusted.

Caffeine does not leave quickly

Caffeine works by blocking adenosine, the molecule that builds up through the day and creates the pressure to sleep. Its half-life in adults is roughly five to six hours. Half of a 100mg dose is still in your system five hours later; a quarter is still there after ten.

That is why a 3pm coffee can still be doing something at 9pm. You may not feel alert, but the adenosine signal is being damped while you try to fall asleep.

Sensitivity varies more than the guidance suggests

The five-to-six-hour figure is an average. Genetics, liver enzymes, pregnancy, some medications, and age all shift it. Some people clear caffeine in three hours; others take far longer. The useful test is therefore your own sleep, not a rule from a list.

A practical experiment: move your last caffeinated drink three hours earlier for a week, keep everything else the same, and note how long it takes to fall asleep and how often you wake.

What counts

Coffee is the obvious source, but tea, cola, energy drinks, chocolate, and some painkillers carry caffeine too. A large iced tea at lunch can hold as much as a small coffee. Pre-workout powders are easy to overlook and often high.

Tolerance is only partial

Regular drinkers develop tolerance to the alerting effect and can feel as though caffeine no longer affects them. Tolerance to the effects on sleep is weaker. People who drink coffee daily often fall asleep fine and still spend less time in deep sleep than they otherwise would. How much deep sleep you need puts that in context.

Timing the cutoff

There is no single correct cutoff. A common working rule is to stop caffeine eight hours before bed, then adjust in either direction based on how you sleep. If you are sensitive, aim earlier. If you are not, an afternoon cup may be harmless.

For anyone who wants to see the effect cleanly, afternoon coffee and bedtime walks through a short self-test.

Where caffeine does not help

Caffeine treats sleepiness, not sleep debt. It does not restore what a short night took away, and using it to push through repeatedly tends to move the problem later rather than solve it. Sleep deprivation covers what accumulates when short nights stack up.

If you need caffeine to get through an ordinary day, that is worth treating as a signal about your sleep rather than a habit to optimize.

A short version

Move the last cup earlier and watch what happens for a week. Keep the rest of your routine steady so the result means something. If sleep is still difficult after that, caffeine is probably not the main cause.

Go a little deeper

Sources & references

  1. Insomnia

    NHS · Accessed 2026-12-02

  2. Sleep and tiredness

    NHS · Accessed 2026-12-02

  3. How to Sleep Better

    Harvard Health Publishing · Accessed 2026-12-02