Caffeine and sleep: timing, dose and bedtime

By Clarity · Updated · Editorial policy

Caffeine can interfere with sleep hours after a drink. How much you consume, when you consume it and how you respond all matter. Being able to fall asleep does not, by itself, show that caffeine has had no effect on the night.

What does the research show?

A placebo-controlled study by Drake and colleagues tested a 400 mg dose at bedtime, three hours before bed and six hours before bed. Sleep was disrupted in all three conditions. That is evidence about a substantial single dose; it does not establish a universal cut-off for every cup of coffee. Read the 2013 trial.

A newer crossover trial tested 100 mg and 400 mg in 23 men with moderate habitual caffeine intake. The investigators found different results by dose: 400 mg could impair subsequent sleep even when taken 12 hours before bed, while 100 mg produced no significant sleep effects at the tested times. The small, male-only sample means the lower-dose finding should not be treated as a promise for everyone. Read the dose-and-timing trial.

Can caffeine affect sleep if you still fall asleep?

Sleep includes more than the moment you drift off. A 2023 systematic review and meta-analysis found that caffeine affected total sleep time, sleep efficiency and aspects of sleep architecture across the included studies. These are group results across different protocols, not a forecast of your next night. Read the review.

For tracking, record how long it seemed to take to fall asleep, awakenings and how rested you felt. A wearable can add context, but its sleep-stage estimate is not a clinical diagnosis. A difficult night also has many possible explanations, including stress, illness and a changed sleep schedule.

Why afternoon coffee can reach bedtime

In a simplified model with a five-hour half-life, 100 mg at 2 pm leaves about 50 mg at 7 pm and 25 mg at midnight. Another drink adds another contribution. These are calculated examples, not measurements of caffeine in your blood.

Compare different drink times in the caffeine half-life and bedtime calculator. The half-life guide explains why the estimate changes when you change the model assumption.

When should you stop drinking caffeine?

There is no single clock time that fits an early sleeper, a night-shift worker and someone with a different sensitivity. Work backwards from your intended bedtime, consider the whole day's intake and pay attention to both serving size and timing.

Our guide to caffeine before bed shows how to compare scenarios without treating a calculated number as a safe-sleep threshold. Moving a drink earlier and reducing its caffeine content are different changes; either can change the modelled amount remaining.

Track a pattern, not a verdict

Keep a simple record of drinks, amounts and times alongside your sleep notes. Compare several similar days instead of drawing a conclusion from one night. If you change a habit, note what changed so you can interpret the record later. See how to track caffeine intake for a practical logging method.

Clarity brings logged caffeine and bedtime estimates together on iPhone. Its estimates can support awareness; they do not tell you whether you will sleep well. Persistent sleep problems deserve professional assessment rather than increasingly precise guesses about caffeine.