Why · caffeine

Why your last coffee has a time, not a suggestion

Caffeine blocks adenosine, the molecule that builds sleep pressure through the day.

Updated · Written by Valentyn Yakovliev · How we write these

Evidence Strong that late caffeine shortens sleep (a meta-analysis of 24 studies). How fast you clear it varies several-fold, so any cutoff is an estimate.

Caffeine's half-life, the time it takes for half of it to leave your blood, averages about 5 hours in healthy adults, with a reported range of about 1.5 to 9.5 hours. So half of a 4 p.m. coffee can still be circulating around 9 p.m. A 2023 meta-analysis of 24 studies found caffeine cut total sleep by 45 minutes on average, and estimated that a 107 mg coffee had to be at least 8.8 hours before bed to avoid that loss.

While you are awake, your brain accumulates adenosine. It is the molecule behind what sleep science calls sleep pressure — the longer you stay up, the more of it gathers, and by evening the pressure is high enough to make you sleepy. Sleep pressure is one half of the two-process model of sleep regulation, the same model your Owlark energy curve is built on. The other half is your circadian clock, which schedules the actual hours.

Caffeine does not remove that pressure — it sits on the adenosine receptors and hides it. The pressure keeps building underneath, you just do not feel it. That is why a coffee can make you alert at 9 p.m. and leave you with a strangely shallow night: the adenosine was there all along, masked rather than cleared.

The arithmetic that matters

The catch is timing. According to an Institute of Medicine review, caffeine’s mean half-life in healthy adults is about 5 hours, but it can range from about 1.5 to 9.5 hours. A coffee at 4 p.m. is about half gone by 9 p.m., and about a quarter of it is still there around 2 a.m.

Why the range is so wide: one liver enzyme, CYP1A2, handles about 95% of the caffeine you drink, and its activity varies about 5- to 6-fold between people. That review of 141 pharmacokinetic studies also found smoking shortens caffeine’s half-life and oral contraceptives lengthen it, and it cites a twin study in which 89% of the variation in caffeine levels (in non-smokers not taking the pill) was down to genes.

Drake and colleagues gave 12 healthy sleepers 400 mg of caffeine — about four cups of brewed coffee — or a placebo at bedtime, 3 hours before bed or 6 hours before bed, and measured sleep at home with a headband EEG monitor. Even at six hours, measured sleep fell by more than an hour. The sleepers’ diaries showed about 41 minutes less sleep at six hours, which was not statistically significant; the monitor showed more than an hour. The study was small, used one high dose, and was funded by the company that made the monitor.

Late caffeine may also nudge the body clock itself. In a 2015 study of five adults, a double-espresso-sized dose 3 hours before bed delayed the melatonin rhythm by about 40 minutes, nearly half the shift caused by three hours of bright evening light.

What the research says, and what it does not

This is why “when should I stop drinking coffee” has no single universal answer. Your body keeps its own clearance rate, and only your own nights reveal it.

Why a cutoff, not a ban

That is why Owlark gives a cutoff rather than a ban. It computes the time when a normal cup’s remaining dose stops mattering for your sleep window, and shows it as the one sharp moment of the day: “last coffee by 1:40p”. Earlier is fine. Later is your call — now an informed one. The caffeine cutoff calculator shows the same arithmetic for any bedtime.

The same arithmetic quietly covers more than coffee. Tea, matcha, energy drinks, pre-workout, cola and dark chocolate all feed the same clock. If your cutoff keeps surprising you, the afternoon cup is usually the first thing worth moving. One hour earlier for a week is a simple experiment; your own nights are the test.

Half of a 4 p.m. coffee is still with you at 9 p.m. The cutoff is arithmetic, not discipline.

Gardiner C, et al. The effect of caffeine on subsequent sleep: a systematic review and meta-analysis. Sleep Med Rev. 2023. Drake C, Roehrs T, Shambroom J, Roth T. Caffeine effects on sleep taken 0, 3, or 6 hours before going to bed. J Clin Sleep Med. 2013. Burke TM, et al. Effects of caffeine on the human circadian clock in vivo and in vitro. Sci Transl Med. 2015. Grzegorzewski J, et al. Pharmacokinetics of caffeine: a systematic analysis of reported data. Front Pharmacol. 2021. Nehlig A. Interindividual differences in caffeine metabolism and factors driving caffeine consumption. Pharmacol Rev. 2018. Institute of Medicine. Pharmacology of caffeine. In: Caffeine for the Sustainment of Mental Task Performance. 2001.

Questions people ask

When should I stop drinking coffee?

There is no single time. A 2023 meta-analysis estimated that, on average, a 107 mg coffee had to be at least 8.8 hours before bed, and a 217.5 mg pre-workout serve at least 13.2 hours, to avoid losing sleep. Those are averages; your own clearance can be faster or slower. Owlark computes a cutoff from your sleep window and shows it as one time, like 'last coffee by 1:40p'.

How long does caffeine stay in your system?

In healthy adults about half of it is gone after roughly 5 hours, with a reported range of about 1.5 to 9.5 hours. After two half-lives a quarter is left, so a 4 p.m. coffee can still be partly active at bedtime.

Can I sleep after drinking caffeine?

Many people can, but the sleep is measurably shorter and lighter. In a 2013 home study, 400 mg taken 6 hours before bed cut measured sleep by more than an hour, yet the sleepers' own diaries showed no significant change at that time. Falling asleep is not proof the coffee did not matter.

Does caffeine affect everyone the same way?

No. One liver enzyme, CYP1A2, handles about 95% of caffeine metabolism, and its activity varies about 5- to 6-fold between people. Smoking speeds clearance; oral contraceptives can double the half-life; pregnancy and liver disease slow it too.

Is tea or energy drink caffeine different?

The molecule is the same. What changes is the dose per serving and how fast you drink it. A double espresso, a strong tea and an energy drink all count toward the same cutoff time.

What if I already drink coffee late?

Nothing dramatic happens on one evening. If late caffeine is a pattern, the research points to shorter, lighter sleep. One simple experiment is to move the last cup an hour earlier for a week and notice whether your nights change.

Owlark is a wellness app, not a medical device. It does not diagnose or treat any sleep disorder.

← More why cards · How Owlark handles evidence