← All articles

Caffeine and sleep: why your afternoon cup can follow you to bed

By Caffein.in ·

Caffeine helps many people feel alert. It can also be the reason a night feels short, light, or uneven, even when you fall asleep eventually. Understanding the timing is more useful than simply labelling coffee “bad for sleep.”

How caffeine changes sleep pressure

Caffeine blocks adenosine, a chemical that builds up during the day and contributes to sleep pressure. When you drink coffee, you do not remove the need for sleep; you temporarily mute one of the signals. After the caffeine wears off, that pressure can return, which is one reason some people feel a mid-afternoon crash.

Understanding half-life

In healthy adults, the half-life of caffeine is often around five hours. Half-life means that after about five hours, roughly half of the dose may still be in your body. If you drink 200 mg at 4 p.m., you might still have about 100 mg circulating at 9 p.m., and a smaller amount later still. That is enough, for many people, to make sleep shallower, delay the moment you fall asleep, or increase night-time waking. You may not feel “wired” and can still lose sleep quality.

Why people differ

The half-life is not fixed. Pregnancy can slow caffeine clearance. Smoking can speed it up. Some medicines and oral contraceptives change it. Liver conditions matter. This is why two colleagues can drink the same 3 p.m. coffee and report two different nights.

Choose an earlier cut-off

A practical rule used in many sleep clinics is to avoid caffeine for at least six hours before bed, and longer if you already have insomnia or you know you are sensitive. If you go to bed at 11 p.m., that points to a last cup at or before 5 p.m. People who are very sensitive sometimes do better with a late-morning cut-off. Shift workers have a harder puzzle: the “last cup” should sit several hours before the intended sleep period, even if that sleep is in the daytime.

Count all sources

What about tea, cola, dark chocolate, and pre-workout drinks? They all count. A late energy drink is a common reason a night goes badly, because the dose can be high and the timing close to bedtime. Decaf coffee and most herbal teas are usually compatible with an evening wind-down, though decaf is not absolutely zero.

Cut down gradually

If you are cutting down for sleep, do it over a few days if you drink a lot now. A sudden stop can cause a withdrawal headache, which also disturbs rest. Our withdrawal and tolerance article explains what to expect. Keep the rest of your sleep habits boring and consistent: a regular schedule, a dark room, and less late heavy food if that bothers you.

Try a timing experiment

Track a short experiment rather than guessing. For one week, note your last caffeine dose, bedtime, and how you feel in the morning. Then move the last dose two hours earlier for a week and compare. Use the calculator if you are unsure how large a dose you are actually taking.

When to seek help

This is general information, not treatment for insomnia or any other condition. See a clinician if poor sleep is frequent, severe, or paired with other symptoms.

General education, not medical advice. Caffeine figures are estimates and vary by brand, brew, and serving size. Health guidance includes FDA and EFSA information and ACOG-style pregnancy guidance: about 400 mg/day for most healthy adults and about 200 mg/day or less in pregnancy; follow your clinician.