Sleep Handbook

Does Caffeine Still Affect You at Bedtime?

Last checked 4 November 2026 · 10 min read

Yes — and the timing rule most people are given is the wrong shape. In a controlled study, 400 mg of caffeine (about four cups) taken six hours before bed still cut measured sleep by more than an hour, while the sleepers' own diaries barely registered the loss. Caffeine does not add wakefulness; it occupies the receptor that sleep pressure uses, so the pressure keeps building where you cannot feel it. How long it stays is personal: published cutoffs range from four to eleven hours before bed, which is another way of saying that no single cutoff fits everyone. The useful question is not how late you drank it, but how much is still in you at midnight — and that is something you can estimate, then test.

Six hours before bed was not the safe side of the line

The cleanest test of the timing question gave twelve healthy normal sleepers the same 400 mg dose on four separate weeks: at bedtime, three hours before, six hours before, and a placebo. They slept at home, on their usual schedules, with a portable recorder on the wrist and a diary in the morning. The dose was fixed. The only thing that changed was when it arrived.

The recorder found the same thing at every time point. Total sleep time fell by 1.1 to 1.2 hours, and sleep efficiency fell with it. Six hours before bed was not a milder version of the effect. It was the same size.

The detail at six hours is worth knowing, because it explains why the effect is easy to miss. It took about 24 minutes longer to fall asleep, which did not reach significance on its own. Time awake after falling asleep rose by 8 minutes, which did. Light sleep — stages 1 and 2 combined — fell by 44 minutes, and deep sleep fell too. REM sleep did not change. None of those numbers is dramatic in isolation. Together they describe a night that is shorter, lighter and more broken, carrying the same amount of caffeine as the night you took it at bedtime.

And the diary? At six hours, people reported 41 minutes less sleep, a difference that fell just short of significance, and said it took them more than twice as long to fall asleep, also just short. So they noticed something. They did not notice an hour.

Taken before bed What the diary said What the recorder found
At bedtime Falling asleep took longer; less sleep reported. 1.1–1.2 hours less sleep.
Three hours Falling asleep took longer; less sleep reported. 1.1–1.2 hours less sleep; 28 more minutes awake.
Six hours A 41-minute loss that fell just short of significance. 1.1–1.2 hours less sleep; 8 more minutes awake.

The disagreement is the point. The diary is a report from a person who was asleep for the part that changed. The recorder is a report from the wrist. When they disagree, the wrist is measuring the thing the person cannot. That does not make the diary useless — it makes it a measure of what you will remember, which is exactly the measure that keeps you repeating the experiment.

It does not make energy. It hides the bill.

Adenosine accumulates in the brain while you are awake, and the pressure to sleep rises with it. Caffeine sits on the receptors that adenosine would use. It does not remove the adenosine and it does not create alertness; it prevents the signal from being received. The pressure keeps accumulating behind the block.

This is why the alertness feels borrowed rather than owned. A review of the laboratory literature put it bluntly: under ordinary, non-sleep-deprived conditions, caffeine is mostly restoring performance that sleepiness had already degraded, not lifting performance above where it would have been. In someone who is short of sleep it looks like a stimulant because there is a deficit to fill. In someone who is rested it is closer to a mask.

The first consequence is uncomfortable. You can be impaired and feel fine. The twelve sleepers in the timing study were not woken by their own sleep loss; they reported a fraction of what the recorder measured. If your test of “it does not affect me” is “I fell asleep”, you are testing the one part of the night caffeine's reputation is built on and ignoring the part that decides how you feel at ten in the morning.

The second consequence arrives when the caffeine leaves. The pressure that built up behind the block is still there, and it arrives all at once. That is one route to the classic pattern: asleep quickly, awake at three, unable to get back down. If that is your night, waking at 3am is the closer match.

Half-life is a personal number

The standard version of the advice uses a single number: caffeine's half-life is about five hours, so stop six hours before bed. Both halves of that sentence are doing more work than they can support.

The five-hour figure is an average. Elimination varies with liver enzyme activity, and the variation is large enough that published recommendations for a cutoff range from four hours to eleven hours before bed. That range is not a disagreement about the science. It is what happens when one rule is applied to people whose bodies clear the drug at different speeds.

Two of the factors are well documented. Smoking increases clearance and shortens the half-life. Oral contraceptives do the opposite: they slow clearance and lengthen the half-life, across a wide range of doses. A systematic analysis of 141 publications found both effects consistently across more than fifty years of pharmacokinetic research. Age, pregnancy, liver disease and some medicines also matter, but the two above are the ones that most often explain why two people of the same age react differently to the same afternoon cup.

The arithmetic is more useful than the average. Take a 200 mg cup — two 8-ounce cups of ordinary brewed coffee — drunk at 2pm. With a three-hour half-life, about 20 mg is left at midnight. With five hours, about 50 mg. With seven hours, about 74 mg. Ten hours after the cup, the slowest of those three is still carrying three-quarters of a cup.

Dose is the other half of the equation. The same study notes that an 8-ounce cup of brewed coffee is about 100 mg, while a 16-ounce serving can contain up to 500 mg. One large cup at 2pm can therefore be two and a half times the example below, and the residue at midnight scales with it.

What remains at midnight from 200 milligrams of caffeine taken at 2pm, at three different clearance speeds: 20, 50 and 74 milligrams. 200 mg at 2 pm, still in the body at midnight one 8-oz cup = 100 mg 20 mg 50 mg 74 mg 3-hour half-life 5-hour half-life 7-hour half-life Ten hours after the cup, the slowest of the three is still carrying three-quarters of a cup.
The same 200 mg cup at three clearance speeds. The values are arithmetic from the half-life, not measurements of any one person; what matters is the size of the residue at midnight, not the exact number.

This is also why the six-hour rule is not a safety margin. Apply it to a 400 mg dose and, at a five-hour half-life, roughly 170 mg is still circulating at bedtime — close to two cups. The rule tells you when to stop drinking. It does not tell you when the dose has left.

None of the three half-lives above is a measurement of you. They are arithmetic, chosen to show the shape. The only way to get your own number is to change the timing and watch what happens, which is the test further down the page.

Why quitting can make sleep worse first

If caffeine were the whole story, stopping should fix the night within a few days. Sometimes it does. Often it gets worse first, and the reason is withdrawal.

One person describes drinking up to 600 mg a day, tapering over a week, and then spending two weeks unable to fall asleep before 1am despite a 9pm bedtime, no screens, no alcohol and no caffeine. The night he drank a high-caffeine energy drink before bed, he was asleep by 8:30pm. Another describes lying awake all night a week after stopping, with a brain that would not switch off; the replies include people still waking every three or four hours at five weeks and at five months.

The official version is shorter. Withdrawal is usually described as starting within 12 to 24 hours and resolving within about 48 hours. The first-hand version runs for weeks. Both can be partly right: the acute headache-and-fatigue phase and the slower re-regulation of sleep are not the same thing, and the second is not well measured. What is clear is that the first three nights off caffeine are a bad test of whether caffeine was the problem.

The practical rule: judge a quit at three weeks, not three days, and do not change five other things in the same week. If sleep is still bad at three weeks, caffeine was not the main lever. If it is better, you have your answer and you can decide what to do with it.

The two-week test that gives you your own cutoff

Same dose, same bedtime, one variable.

  1. Pick two weeks with a similar schedule. In week one, keep your normal caffeine timing. In week two, keep the total amount the same but move the last dose to eight hours before bed. If the last dose is large, halve it instead of moving it — or do both, but write down which one you changed.
  2. Keep bedtime and wake time fixed. If you move the caffeine and also go to bed an hour earlier, you are testing two things and will not be able to tell them apart.
  3. Record three numbers each morning, before you get up. How long you think it took to fall asleep, how many times you woke, and the clock time of your longest awake stretch. Do not use a rating. “Better” cannot be compared across weeks; a 40-minute stretch at 4am can.
  4. Compare the back half, not the first. The time it takes to fall asleep is the number caffeine is famous for changing. The wake count and the longest stretch are the numbers that track how the night ends.
  5. Repeat once. One week is a mood; two weeks with the same dose and the same bedtime is a measurement. If the second week is better on the back half, keep the earlier cutoff. If nothing moves, caffeine is not your lever, and the main guide has the other candidates.

One note on what counts as a result: if you sleep the same but feel more tired in the first week, that is withdrawal, not evidence against the test. Give it the full two weeks before deciding.

Where this fits

Caffeine is one of the substances that buys the front of the night and sends the bill to the back. Alcohol does the same thing by a different route — does alcohol help you sleep — and the two together are a common reason a night starts well and ends at three. If the problem is not falling asleep but staying asleep, the 3am page is the closer match. If you have been using a tablet rather than a cup, why melatonin does not work covers the difference between a sedative and a clock signal.

About this page

Last checked
4 November 2026
Sources
A placebo-controlled, double-blind study in twelve healthy normal sleepers (mean age 29) who took 400 mg of caffeine or a placebo at bedtime, three hours before, and six hours before bed, in the home, with a portable sleep monitor and a morning diary. Total sleep time fell by 1.1 to 1.2 hours in all three caffeine conditions; at six hours, latency to persistent sleep rose by 24.1 minutes (not significant), wake after sleep onset by 8 minutes (significant), stage 1 and 2 sleep fell by 44.1 minutes, and slow-wave sleep fell significantly at the bedtime and six-hour conditions; REM sleep did not change; the diary at six hours reported 41 minutes less sleep (p = 0.08) and more than double the time to fall asleep (p = 0.06). The same paper notes that published recommendations for a caffeine cutoff range from four to eleven hours before bed because of variability in elimination half-life, and uses 100 mg per 8-ounce cup. A review of caffeine, sleep and daytime sleepiness concluding that under habitual sleep conditions caffeine largely restores performance degraded by sleepiness rather than enhancing it, and that dependence develops at relatively low daily doses after short periods of regular use. A systematic analysis of 141 pharmacokinetic publications finding that smoking increases caffeine clearance and shortens half-life, while oral contraceptive use reduces clearance and lengthens it. Consumer health guidance describing caffeine withdrawal as beginning within 12 to 24 hours and resolving within about 48 hours. First-hand accounts: a person who tapered from up to 600 mg a day over a week and then could not fall asleep before 1am for two weeks, sleeping at 8:30pm on the night he drank a high-caffeine energy drink before bed; a person lying awake all night seven days after stopping, with a racing mind; replies describing awakenings every three or four hours at five weeks and at five months.
Update cadence
No fixed interval yet — the site is new. Re-checked when the guidance behind it changes, and the date above is updated then.
Not yet confirmed
The three-, five- and seven-hour half-lives in the figure are arithmetic examples, not measurements of any person, and an individual's half-life cannot be known without a test. The timing study used a single 400 mg dose in healthy normal sleepers, so it cannot say what a 100 mg dose does, or what happens in someone with clinical insomnia. The withdrawal timeline is not well characterised: the 48-hour figure and the accounts running for weeks may be describing different processes, and no study here measured sleep across a quit. No trial has compared a six-hour cutoff with an eight- or ten-hour cutoff on sleep outcomes, so the advice to test your own cutoff is inference from the pharmacology, not a tested intervention.