White cup of coffee on a wooden table with soft cafe lights behind it

How Late Is Too Late for Caffeine? The Evidence

8 min read

You had one coffee after lunch and felt fine. Now it is past midnight, the room is dark, and your mind will not switch off. You blame a busy day, a late email, the noise outside. The more likely culprit is still working its way through your blood.

Caffeine is part of daily life for a lot of us, and we drink it without much thought about the clock. The dose matters, and so does the hour you take it. That second part is the one people miss. A pooled analysis of controlled sleep studies now gives a clear number for when to stop, and it is earlier than most people expect. Here is what the research shows, why an afternoon cup reaches into your night, and a simple cut-off you can follow.

8.8h
Stop coffee before bed
Gardiner 2023 meta-analysis, 24 controlled studies
45 min
Less total sleep
Pooled effect of caffeine, Gardiner 2023
7%
Lower sleep efficiency
Time asleep vs time in bed, Gardiner 2023
13.2h
Stop pre-workout before bed
217.5 mg serving, Gardiner 2023

What caffeine does to a night of sleep

In 2023 Gardiner and colleagues published a systematic review and meta-analysis in Sleep Medicine Reviews. They pooled 24 controlled crossover studies, the kind where the same person is tested with caffeine and again with a placebo, so each person acts as their own comparison. That design strips out a lot of noise and makes the average effect trustworthy.

Across those studies, caffeine cut total sleep time by 45 minutes and lowered sleep efficiency by 7 percent. Sleep efficiency is the share of time in bed actually spent asleep, so a drop there means more of the night lost to lying awake. People also took 9 minutes longer to fall asleep and spent 12 more minutes awake during the night after falling asleep.

The shape of sleep changed too, not only the amount. In the pooled data, light sleep rose while deep sleep fell by about 11 minutes a night. Deep sleep is the stage that does the heavy repair work on the body and helps memory settle, so losing some of it to lighter stages is a real cost even when the total hours look normal. You may still count a full night in bed and wake up feeling like you did not rest, because the sleep itself was shallower than it should have been.

The review set out to find the time after which caffeine should not be taken before bed. For coffee, that line sits nearly nine hours out.
Based on Gardiner and colleagues, Sleep Medicine Reviews, 2023

Why a 3pm coffee still counts at midnight

The reason timing matters is how slowly the body clears caffeine. A 2026 review in Hereditas by Liu and Xu describes a half-life of roughly 4 to 5 hours in healthy adults. Half-life is the time it takes to remove half of what you drank. So if your afternoon cup carries the 107 mg used in the coffee studies, roughly half of that is still circulating five hours later, and a smaller amount lingers into the night, gently blocking the signals that make you feel sleepy.

The same review reports that a single enzyme, CYP1A2, handles more than 90 percent of that clearing work, and that its activity varies by up to 15-fold between people. That is why a friend can drink an espresso after dinner and sleep soundly while the same cup leaves you staring at the ceiling. Age, pregnancy, some medications, and your genes all shift how fast you process it. If evening coffee has not bothered your sleep, you are likely a fast clearer. Many people are not, and they underrate the effect because they do not feel wired at night and only notice it the next day, waking up less rested.

How caffeine changes a night of sleep Pooled effect vs placebo, minutes Total sleep lost 45 min More night waking 12 min Longer to fall asleep 9 min Source: Gardiner and colleagues, Sleep Medicine Reviews, 2023 (24 studies)

The cut-off that protects your sleep

To avoid losing sleep time, the Gardiner review found that a standard coffee, defined as 107 mg per 250 mL cup, should be taken at least 8.8 hours before bed. For a typical 11pm bedtime, that puts the last coffee at around 2pm. Stronger sources sit further out. A standard serving of pre-workout supplement at 217.5 mg should stop at least 13.2 hours before bed, which for the same bedtime means before 10am.

An older randomised trial by Drake and colleagues, published in the Journal of Clinical Sleep Medicine in 2013, points the same way from a different angle. They gave people 400 mg of caffeine at bedtime, 3 hours before, and 6 hours before, and tracked how they slept at home. Even the dose taken a full 6 hours before bed clearly disrupted their rest. The authors still supported the standard advice to avoid substantial caffeine for at least 6 hours before bed, and the newer coffee figure of nearly 9 hours sits further out again. Two independent lines of evidence land on the same practical message. Afternoon caffeine is not free.

If you train after work, this is the real squeeze. An evening gym session often pairs with a pre-workout or a strong coffee, and both land close to bedtime. The answer is not to drop the workout but to change the fuel. A caffeine-free pre-workout, a smaller dose, or a proper warm-up keeps the training without borrowing from your sleep. On the days you do reach for a lift, take it as early as you can and keep the amount modest, so the clock has time to work before your head hits the pillow.

A simple caffeine plan

You do not need to give up coffee. You need to move it earlier and watch the hidden sources. Work back from your bedtime and set one cut-off time, then keep the strong stuff for the morning.

1. Set your last-coffee time
Take your bedtime and subtract about 9 hours. That is your daily coffee cut-off. For an 11pm bedtime, aim to finish coffee by 2pm.
2. Push pre-workout to the morning
A pre-workout serving of about 220 mg needs roughly 13 hours to clear its effect on sleep. If you train in the evening, use a caffeine-free version or lower the dose.
3. Count the quiet sources
Green and black tea, cola, energy drinks, dark chocolate, and many painkillers carry caffeine. Read the label after your cut-off time.
4. Swap the evening cup
If you like a warm drink at night, move to decaf or a herbal tea. The ritual stays and the stimulant goes.

Common mistakes

The first mistake is trusting how you feel. In the Drake trial, people did not report worse sleep even when monitors showed it was worse, so the damage runs quietly under your own awareness. The second is treating tolerance as clearance. Being able to fall asleep after coffee does not mean the caffeine has left your system, and the pooled data show lighter, more broken sleep even in habitual drinkers. The third is forgetting that a big afternoon dose behaves differently from a small one. The stronger the source, the further from bedtime it needs to sit.

Frequently asked questions

How many hours before bed should I stop caffeine?
The Gardiner 2023 meta-analysis suggests at least 8.8 hours for a standard coffee, and at least 13.2 hours for a strong pre-workout serving. A safe rule for most people is to make midday your last coffee.
I fall asleep fine after coffee. Am I safe?
Falling asleep is not the same as sleeping well. In the pooled studies, caffeine still shifted sleep toward lighter stages and cut deep sleep, even in regular drinkers who felt no problem dropping off.
Why does caffeine affect my friend less than me?
The CYP1A2 enzyme that clears caffeine varies by up to 15-fold between people, according to Liu and Xu 2026. Genes, age, pregnancy, and some medications all change how fast you process a dose.
Does decaf count?
Decaf holds a small amount of caffeine, usually a few milligrams per cup, far below a normal serving. For most people it is a reasonable evening swap when a normal coffee would be too late.
Is tea a safer evening choice than coffee?
Tea usually carries less caffeine than coffee per cup, so a late cup gives your body less to process, but it is not caffeine-free. After your cut-off time, a herbal or decaf option is the cleaner choice.

The bottom line

Caffeine helps you in the morning and works against you at night. The evidence is consistent. A pooled analysis of 24 controlled studies found that caffeine trims total sleep, lowers efficiency, and thins out deep sleep, and it points to a coffee cut-off of nearly 9 hours before bed. A separate trial found effects even 6 hours out. You do not have to quit. Set one cut-off time, keep strong doses for the morning, and let the evening belong to sleep. Your next good night may start with the cup you skip this afternoon.

Want your training, nutrition, and sleep to work together?
At DT Fitness London we build simple, evidence-led routines around your real day. Book a consultation at www.dtfitnesslondon.com and start with habits that actually stick.

Sources

Gardiner C, Weakley J, Burke LM, Roach GD, Sargent C, Maniar N, Townshend A, Halson SL. The effect of caffeine on subsequent sleep: A systematic review and meta-analysis. Sleep Medicine Reviews, 2023. pubmed.ncbi.nlm.nih.gov/36870101
Drake C, Roehrs T, Shambroom J, Roth T. Caffeine effects on sleep taken 0, 3, or 6 hours before going to bed. Journal of Clinical Sleep Medicine, 2013. pubmed.ncbi.nlm.nih.gov/24235903
Liu, Xu. Unraveling the complexities of caffeine: metabolism, genetics, evolution, and health. Hereditas, 2026. pmc.ncbi.nlm.nih.gov/articles/PMC12954933
Back to blog