When to Stop Drinking Coffee Before Bed

The two o'clock rule gets repeated so confidently that most people assume a study produced it. None did. What exists underneath the folklore is a small set of measurements about how long caffeine stays in a body, one controlled trial that tested the question head on, and an awkward fact about coffee that nobody selling it likes to say out loud: you do not know how much caffeine is in your cup, and neither do we.

There is no single cut-off hour, and any hour offered without a dose attached is guesswork wearing a lab coat. The one trial that tested the timing directly found that a large dose of caffeine taken six hours before bed still shortened measured sleep, in people whose own sleep diaries did not register the loss. That is the finding worth carrying: the gap most people already consider generous was not generous, and the disruption was invisible from the inside.

Below is where that number comes from, what it does not cover, and why the honest version of this answer is a range rather than a time.

What caffeine is doing while you sleep, or fail to

Adenosine accumulates in the brain across a waking day and rising adenosine is one of the signals that produces sleep pressure. Caffeine is an adenosine receptor antagonist. It occupies the receptor without triggering it, so the signal arrives and does not register. The 2026 Food Standards Australia New Zealand safety assessment of caffeine, quoted at more length below, states that caffeine's effects are mediated through adenosine receptor antagonism at the plasma concentrations reached by ordinary dietary intake. Other mechanisms exist and become relevant at toxic doses, which is not what anyone gets from a cup of coffee.

The consequence matters more than the mechanism. Caffeine does not add anything. It withholds a message about accumulated tiredness, and the tiredness is not paused while the message is blocked. This is why the question "how late is too late" is really a question about clearance. You are not waiting for an effect to wear off. You are waiting for a molecule to leave.

The arithmetic, and how wide its error bars are

Food Standards Australia New Zealand published a safety assessment of caffeine in March 2026, as supporting document 1 to its Proposal P1056 caffeine review. It puts the half-life of caffeine in adults in the range of three to seven hours, and names the liver enzyme CYP1A2 as responsible for more than 90 per cent of the first step in caffeine metabolism. The same assessment states that clearance of caffeine can vary 40-fold between individuals, with genetic variation in that enzyme a major cause. Cigarette smoking almost doubles the rate of caffeine metabolism. Oral contraceptives move it the other way, and the assessment cites one study in which half-life rose from 6.2 hours to 10.7 hours. In pregnancy the half-life is comparable to normal in the first trimester, reaches about 10 hours by 17 weeks of gestation, and reaches up to 18 hours by the end.

Run the arithmetic across that range rather than at a midpoint, because the width is the whole finding. A 100 mg dose at four in the afternoon leaves about 10 mg still circulating at two in the morning if you sit at the fast end of the range, and about 37 mg if you sit at the slow end. The same assessment notes that caffeine elimination follows first-order kinetics at ordinary dietary intakes, which is what makes that calculation legitimate rather than decorative. Nothing in it respects a two o'clock rule, and a spread nearly four times wide at two in the morning is precisely why a single cut-off hour cannot be written down.

Two things follow. The curve is long and shallow rather than a cliff, so "how late" has no natural edge to it. And the same cup produces genuinely different overnight exposures in two people at one table, which is why one of them can drink an espresso after dinner and sleep, and is not lying about it.

What the named sources actually say

EFSA. The European Food Safety Authority's Scientific Opinion on the safety of caffeine, adopted 27 May 2015 and still the standing EU position as of mid-2026, concluded that single doses up to 200 mg and habitual intakes up to 400 mg per day do not raise safety concerns for healthy adults in the general population. On the bedtime question specifically, the panel concluded that doses of around 100 mg taken close to bedtime may lengthen the time it takes to fall asleep and shorten sleep duration in some adults. Note the two hedges the panel put in that sentence and did not remove. Around 100 mg. Some adults.

The FDA has cited 400 mg per day, roughly four or five cups of coffee, as an amount not generally associated with dangerous negative effects in healthy adults, while stating plainly that how much is too much varies with body weight, medication and individual sensitivity. It has not set a binding upper limit for caffeine in food.

The one timing trial. Christopher Drake and colleagues published "Caffeine Effects on Sleep Taken 0, 3, or 6 Hours before Going to Bed" in the Journal of Clinical Sleep Medicine in 2013 (volume 9, issue 11, pages 1195 to 1200). The design was a randomised, double-blind, placebo-controlled crossover, with each participant serving as their own control and the conditions counterbalanced across four days. Twelve healthy adults who reported normal sleep took 400 mg of caffeine, in pill form, or a placebo, at zero, three and six hours before their habitual bedtime. Sleep was recorded at home with a validated portable sleep monitor alongside a standard sleep diary. All three timings disrupted sleep relative to placebo, and the six-hour dose reduced objectively measured total sleep time by more than an hour. The participants' own reports did not register the disruption the monitor recorded.

That last detail is the reason this trial matters more than its size suggests. It is not evidence that caffeine ruins sleep. It is evidence that self-report is a poor instrument for finding out whether it ruined yours.

Now the limitations, stated because a study this small does not get to be quoted without them. Twelve participants is a very small sample. The dose was a 400 mg pill, which is double EFSA's single-dose figure and delivers caffeine differently from a hot drink taken slowly with food. Everyone enrolled was a healthy normal sleeper, so the trial says nothing about people with insomnia or a diagnosed sleep disorder. The overnight measurement came from a home monitor rather than full laboratory polysomnography. This is one good study, not a body of evidence, and the honest description of the field is that the timing question has been tested far less than its confidence in popular writing implies.

The part almost every article skips: your cup is not a dose

Timing advice assumes you know the number you are timing. You do not.

T. W. Crozier and colleagues measured caffeine by HPLC in twenty espressos bought from twenty commercial outlets and published the results in Food and Function in 2012. The servings ranged from 51 mg to 322 mg of caffeine. Same drink name, same city, six-fold spread. Four of the twenty exceeded 200 mg in a single serving, and the largest exceeds EFSA's 200 mg single-dose figure by more than half again. The drivers the authors pointed to were batch-to-batch differences in the beans, the possible blending of arabica with robusta, and roasting and grinding practice, but they judged the predominant factor to be the sheer mass of coffee the barista used.

So "two cups" is not a dose. It is a guess with a factor of six inside it. Robusta carries roughly twice the caffeine of arabica by dry weight, which is a real lever on the number and is one of several genuine differences between the two species. The word on the front of the bag will not help you either, since strength scales and roast descriptors are describing flavour intensity rather than caffeine, and strong means at least four different things in coffee. A dark roast is not a stronger dose. If anything the opposite, by mass.

We cannot tell you the caffeine content of anything you brew at home, and we will not publish a caffeine-per-cup table with single numbers in it, because every such table is quoting the midpoint of a range wide enough to make the midpoint meaningless.

What this will not do

Moving your last coffee earlier will not fix insomnia. Sleep-onset difficulty has many causes and caffeine is one input among a great many, so a person who cuts coffee at noon and still lies awake has learned something useful and has not found their problem. This piece is not clinical advice and cannot be. If sleep is a persistent problem, or you take regular medication, that is a conversation for a clinician or a pharmacist, and specifically so for anyone on drugs that share the CYP1A2 pathway.

Switching to decaf does not take the number to zero either. Decaffeination removes roughly 97 to 99.9 per cent of caffeine depending on the method, and USDA FoodData Central lists brewed decaffeinated coffee at about 2.4 mg per 8 fl oz, with 2 to 5 mg per cup commonly cited. That is small, and it is not nothing, and anyone under a strict clinical restriction should know the difference. Nor does a gentler-sounding brew method reliably lower the dose. A moka pot makes a concentrated brew and is not the espresso machine people assume it is, but concentration is a different variable from total caffeine in the cup, and the mass of ground coffee you started with matters more than the device you put it in.

Two groups need separate treatment and get it from named bodies, not from us. The American College of Obstetricians and Gynecologists, in Committee Opinion No. 462 from August 2010 and reaffirmed in 2020, states that moderate caffeine consumption during pregnancy, defined as under 200 mg per day, does not appear to be a major contributing factor in miscarriage or preterm birth, while noting that the relationship with fetal growth restriction remains undetermined. EFSA lands on the same 200 mg per day figure for pregnancy and lactation. Anyone pregnant should be having this conversation with their own clinician, in part because of everything above about not knowing what is in the cup. And caffeine guidance for adults does not transfer to children at all, which is a separate argument we have made at length: coffee is a bitter drink you have to be taught to like, which is why it was never a children's drink.

Where this leaves the question

The evidence supports a shape, not an hour. Caffeine clears slowly and unevenly, six hours before bed was still enough to measurably shorten sleep in the one trial that tested it, the effect was not reliably noticed by the people it happened to, and the dose in any given cup is unknown to within a factor of six. Anyone who wants an answer out of that has to run the experiment on themselves, moving the last cup back in steps and holding each step for a week, because a week of one condition is the smallest test that survives a bad Tuesday.

If you make one change, make it the one you can observe: hold the dose and the timing steady long enough to see a pattern, rather than varying both and concluding that coffee has no effect on you. That conclusion may well be right. The Drake trial suggests it is also the conclusion a person would reach whether it was true or not.

Health sources on this page last checked 13 August 2026. Figures from EFSA, the FDA, FSANZ and ACOG, and from named peer-reviewed trials with their designs stated. Nothing here is medical advice.

All writing