← Caffeine guides

For a regular cup of coffee, a 2023 meta-analysis put the cutoff at about 8.8 hours before bed to avoid a measurable drop in total sleep time, and about 13.2 hours for a standard pre-workout (Gardiner et al. 2023). So for a 10 pm bedtime that is roughly 1 pm for coffee and before 9 am for pre-workout, and the bigger the drink, the earlier the cutoff.

Those are study estimates, not a personal cutoff. Your response may be different. A big drink in the afternoon can leave more caffeine at bedtime than a small one later on. The tables below show estimates for common drinks.

Estimated caffeine left at bedtime, by drink

These numbers come from the same model the Onset caffeine calculator uses: caffeine drops by half every 5 hours, and anything under 5 mg counts as cleared. The math for one drink is:

mg left = mg in the drink x 0.5 ^ (hours since you finished it / 5)

Each row is a single drink finished at that time, with nothing else that day. Values are rounded to the nearest mg.

Bedtime 10 pm

Drink Caffeine Finished 2 pm 3 pm 4 pm 5 pm 6 pm
Red Bull, 8.4 fl oz 80 mg (manufacturer) 26 30 35 40 46
Coffee, 8 fl oz 95 mg (Onset estimate) 31 36 41 48 55
Energy drink, 16 fl oz 160 mg (Onset estimate) 53 61 70 80 92
Cold brew, 16 fl oz 200 mg (Onset estimate) 66 76 87 100 115
Pre-workout, 1 scoop 200 mg (Onset estimate) 66 76 87 100 115
Starbucks Pike Place, grande 315 mg (manufacturer) 104 119 137 158 181

Bedtime 11 pm

Drink Caffeine Finished 2 pm 3 pm 4 pm 5 pm 6 pm
Red Bull, 8.4 fl oz 80 mg 23 26 30 35 40
Coffee, 8 fl oz 95 mg 27 31 36 41 48
Energy drink, 16 fl oz 160 mg 46 53 61 70 80
Cold brew, 16 fl oz 200 mg 57 66 76 87 100
Pre-workout, 1 scoop 200 mg 57 66 76 87 100
Starbucks Pike Place, grande 315 mg 90 104 119 137 158

From the tables:

How long until each drink is cleared

Onset counts caffeine as cleared once it is under 5 mg. With a 5-hour half-life, the time to get there is 5 x log2(mg / 5) hours.

Drink Caffeine Hours to drop under 5 mg If finished at 2 pm
Red Bull, 8.4 fl oz 80 mg 20.0 about 10:00 am next day
Coffee, 8 fl oz 95 mg 21.2 about 11:15 am next day
Energy drink, 16 fl oz 160 mg 25.0 about 3:00 pm next day
Cold brew or pre-workout 200 mg 26.6 about 4:35 pm next day
Starbucks Pike Place, grande 315 mg 29.9 about 7:55 pm next day

So in this model, a daily afternoon coffee never fully clears before the next morning's cup.

What the studies found

Drake et al. 2013. Twelve healthy adults took 400 mg of caffeine as a pill at bedtime, 3 hours before, or 6 hours before, plus a placebo night. Even at 6 hours, objectively measured total sleep time dropped by more than an hour compared with placebo (J Clin Sleep Med, PMC3805807). The participants' own sleep diaries did not show a significant difference at 6 hours, so the authors noted people may not notice the effect. The authors suggested keeping larger afternoon doses before 5 pm.

Gardiner et al. 2023. This meta-analysis pooled 24 studies. Caffeine reduced total sleep time by 45 minutes on average. Their model put the cutoff at 8.8 hours before bed for a 107 mg coffee and 13.2 hours for a 217.5 mg pre-workout, and found no cutoff for a cup of black tea (Sleep Med Rev 2023).

A 2025 randomized crossover trial in SLEEP. Participants took 100 mg or 400 mg at 12, 8, or 4 hours before bed. 100 mg showed no significant effect on sleep even 4 hours before bed in that study. 400 mg had effects at all three times, larger the closer it was to bedtime, and the authors recommended avoiding 400 mg in one dose within 12 hours of bed (SLEEP, zsae230).

These studies gave fixed doses at fixed times and didn't measure how much was left at bedtime, so the tables above aren't a safe-or-unsafe line. They do agree on one thing. More caffeine closer to bed had bigger measured effects on sleep.

Why your number may differ

The 5-hour half-life is an average. The FDA-approved label for caffeine citrate lists an adult half-life of about 5 hours, and an Institute of Medicine review reports a mean near 5 hours with a range of 1.5 to 9.5 hours. The same review lists pregnancy, oral contraceptives, smoking, and other factors as reasons it shifts. The FDA also notes wide variation in how sensitive people are and how fast they clear caffeine, and cites 400 mg a day as an amount not generally associated with negative effects for most adults.

If you are pregnant, breastfeeding, or take medication, ask your doctor what applies to you.

Find your own cutoff

Pick your bedtime and your usual afternoon drink, then find the row above. If you want your actual day, with more than one drink and your own times, put it into the caffeine calculator. It shows the estimate hour by hour and when it drops under 5 mg.

To track it every day on your phone, Onset is free on the App Store and uses the same model.

This post is for general information and is not medical advice. Estimates use a 5-hour half-life and your own response varies.

Sources

Keep reading

Learn how caffeine half-life works, see how much caffeine is in Celsius, or follow the Onset iPhone walkthrough.