The short answer

Try finishing caffeine 8 to 10 hours before your usual bedtime. For someone going to bed at 10pm, noon to 2pm is a useful starting experiment, not a universal cutoff. Larger doses may need an earlier finish.

You do not necessarily need to quit coffee. The aim is to find a dose and timing that suit your sleep, rather than assume every 2pm flat white causes harm. Research supports considering both factors. 1 2

Why caffeine can affect sleep

Caffeine blocks adenosine receptors, temporarily reducing the signal that makes you feel sleepy. It does not replace sleep, and some caffeine can remain after the noticeable lift has faded. 2

A review of 24 studies found average reductions of 45 minutes in total sleep and 11.4 minutes in deep sleep after caffeine. These are different outcomes, not 45 minutes of lost deep sleep. 1

Those pooled results combine different doses, timings and participants. They cannot tell you the cost of your particular coffee, and should not be multiplied into a predicted yearly sleep deficit.

A crossover trial in 23 men compared 100 mg and 400 mg. The 400 mg dose affected sleep even 12 hours before bedtime; 100 mg had no statistically significant effect at the tested timings. 2

That small, male-only study does not establish a safe late-coffee dose for everyone. It does show why a single clock-time rule misses an important variable: how much caffeine you consume.

Feeling that you slept well is useful information, but it may not match measured sleep. Feeling accustomed to caffeine does not prove harm either: one habitual-use study found no change in major sleep measures. 3

Why the same coffee affects people differently

Sensitivity and caffeine clearance vary. Medication use, pregnancy and individual biology can matter. A timing experiment cannot identify your genotype or diagnose a metabolism problem. 4

For illustration, use a six-hour half-life: a 200 mg dose at 2pm becomes approximately 100 mg at 8pm and 50 mg at 2am. This simplified calculation is not a measurement of your clearance.

Nor is 200 mg a standard flat white or long black. Serving size, preparation and product vary. Check labels or supplier information instead of counting every drink as an identical dose. 4

Safety limits are not sleep targets

EFSA considers up to 400 mg daily generally without safety concerns for healthy, non-pregnant adults. This is not a recommended intake or a guarantee of unaffected sleep. Lower amounts may still disturb sleep. 5

EFSA's pregnancy and breastfeeding guidance is up to 200 mg daily from all sources. Ask your maternity team or clinician about your situation; ask a pharmacist about medication interactions. 5

A two-week caffeine timing experiment

This is a practical self-observation exercise, not a validated diagnostic test. Keep the changes simple enough to understand what happened.

  1. Record your baseline. For three days, note each caffeine source, approximate dose and time, plus bedtime, awakenings and morning alertness.
  2. Choose a cutoff. Start 8 to 10 hours before bed. If you use large doses or are very sensitive, consider an earlier cutoff and less caffeine overall.
  3. Reduce gradually if needed. Abruptly cutting regular caffeine can cause withdrawal symptoms, including headaches. A gradual reduction may be easier. 4
  4. Keep the rest reasonably steady. Maintain similar sleep opportunities and note alcohol, illness, stress or unusual training that might affect the comparison.
  5. Review patterns after two weeks. Compare several nights and morning energy, not your best night against your worst. Withdrawal can complicate the first few days.

Count tea, energy drinks, pre-workout, cola and caffeine-containing medicines as well as coffee. Decaf can still contain a little caffeine. Do not change prescribed medicines for this experiment. 4

For the afternoon ritual, try decaf, a caffeine-free drink or a short outdoor walk. None guarantees an energy lift. An earlier bedtime may matter more if you are simply not allowing enough time for sleep.

How to judge the result

Ask whether falling asleep, staying asleep and morning function improved consistently. A simple diary is enough to start. If earlier timing helps, keep it; if unclear, review dose and other changes before drawing conclusions.

A watch or ring can provide optional trends, but its sleep-stage estimates do not prove you gained a particular amount of deep sleep. Consumer sleep data do not replace clinical assessment. 6

No clear improvement after 14 days does not rule caffeine out. Sleep opportunity, withdrawal and other causes can obscure the result. Persistent insomnia or daytime sleepiness deserves a conversation with your GP.

If you want support fitting caffeine, meals and recovery around your routine, explore nutrition coaching. Coaching can help with habits; it does not diagnose or treat a sleep disorder.