Half the caffeine in your afternoon coffee is still in you about five hours later. That is the number most pages give, and it is roughly right for a roughly average adult. The trouble is the spread around it. The Sleep Foundation puts caffeine's half-life, meaning the time your body takes to clear half of a dose, at anywhere from 2 to 12 hours depending on the person. That is a sixfold difference. It means the same 3pm cup is functionally gone by dinner for one person and still circulating at midnight for another.
So the useful answer to "when should I stop" is not a clock time. It is a number of hours before your own bedtime, worked out from how much caffeine you took and how fast your liver clears it. For most adults at ordinary doses that lands somewhere between 5 and 10 hours before lights out, and this page is for the reader who wants to know which end of that range they are on rather than guessing.
The thing most people get wrong is not the timing. It is the test they use to check it. In a randomised crossover trial published in SLEEP online in October 2024, participants were given either caffeine or a placebo capsule and asked afterwards which they thought they had received. They got it right 22% of the time, which is worse than chance. Their sleep was measurably shorter and shallower on the caffeine nights, and they could not tell. "I sleep fine after coffee" is not evidence about your sleep. It is evidence about your ability to notice, which is poor in nearly everyone.
Caffeine doesn't wear off. It halves.
Through the day your brain accumulates adenosine, a molecule that builds up the longer you are awake and makes you feel progressively more like lying down. Sleep clears it. Caffeine does not remove adenosine or add energy; it sits in the receptors adenosine would otherwise occupy, so the pressure is still building but you stop feeling it. The Sleep Foundation describes this as the core mechanism, with effects starting around 30 minutes after you drink and lasting 5 hours or more from a single dose.
That is why the metaphor of caffeine "wearing off" misleads. It does not fade like a wave receding. It halves, then halves again, on a fixed schedule set by an enzyme in your liver called CYP1A2. If your half-life is 5 hours, a 200 mg dose is 100 mg after five hours, 50 mg after ten, 25 mg after fifteen. The tail is long and flat, and the tail is what lands on your night.
How long that tail runs is largely genetic. A 2025 letter in Neuropsychopharmacology Reports identifies a single variant in the CYP1A2 gene, written as -163C>A or rs762551, as the key determinant of clearance speed, sorting people into fast, intermediate and slow metabolizer phenotypes with what the authors call "marked differences in caffeine half-life and exposure following a standard dose." Allele frequencies differ substantially between populations: the letter reports roughly 60% frequency of the fast-metabolism CYP1A2*1F allele in the Iranian population it discusses.
A genetics blog, Fuel Your DNA, lays out the practical split in more detail. It is not peer-reviewed and should be read as a summary rather than a source in itself, but its figures are consistent with the clinical range everyone else reports.
| Fast | Intermediate | Slow | |
|---|---|---|---|
| Genotype at CYP1A2 rs762551 (Fuel Your DNA, genetics blog) | AA | AC | CC |
| Share of people of European descent (same source) | 40 to 45% | 45 to 50% | 10 to 15% |
| Typical caffeine half-life (same source) | 2 to 3 hours | 4 to 6 hours | 9 to 12 hours |
| Hours for a 100 mg cup to fall below 30 mg (calculated from those half-lives) | Roughly 4 to 5 | Roughly 7 to 10 | Roughly 16 to 21 |
| A 3pm coffee at an 11pm bedtime | Cleared with room to spare | Borderline; some left at lights out | Substantially present at bedtime |
| Cutoff that follows from it | 5 to 6 hours may be enough at ordinary doses | 8 hours, the Sleep Foundation minimum | 8 to 10 hours, often noon or earlier |
Two cautions about that table. First, the 2025 Neuropsychopharmacology letter notes that responses to a standard dose vary enough that genotype-to-phenotype prediction is difficult without individual testing. Knowing you carry the CC variant narrows the guess; it does not hand you a number. Second, genes are not the only lever. Smoking induces CYP1A2 and speeds clearance, and the Sleep Foundation reports nicotine cutting caffeine's half-life by around 50%, while pregnancy roughly doubles it. The Fuel Your DNA summary adds oral contraceptives, which it says reduce CYP1A2 activity by about 50%, effectively doubling half-life for users. A woman on the pill and her smoking colleague can be four half-lives apart on the same cup.
The two experiments that matter most here point in the same direction, with an important gap between them. The 2013 Journal of Clinical Sleep Medicine trial gave 12 healthy adults aged 19 to 48 a 400 mg dose, about four cups of coffee, at 0, 3 or 6 hours before bed. All three timings produced significant sleep disturbance against placebo. Even at six hours out, total sleep time fell by more than an hour. The 3-hour condition added 17.2 minutes to sleep latency, the time taken to fall asleep, and light stage 1 to 2 sleep dropped by 40 to 44 minutes across all conditions. REM sleep was not significantly affected. That study is where the widely repeated "6-hour rule" comes from.
The October 2024 SLEEP trial ran the same idea with a second dose and longer windows: 23 healthy men, mean age 25.3, given 100 mg or 400 mg or placebo at 12, 8 or 4 hours before their own individual bedtimes, with 48-hour washouts between conditions. The 400 mg dose four hours before bed cut deep N3 sleep by about 30 minutes and total sleep time by about 50 minutes, and it lengthened sleep latency significantly at all three timings, including twelve hours out. The 100 mg dose, a typical single coffee, showed negligible effects at every window tested.
Read together, those two trials explain why the published advice looks contradictory when it is not. Six hours, eight hours and ten hours are answers to different questions. Six hours is what a moderate-to-large dose demands before the damage becomes merely significant rather than severe; the 2013 authors concluded their results supported keeping moderate-to-large doses to before 5pm. Eight hours is the Sleep Foundation's floor. Ten or more is for slow clearers. And four hours, per the 2024 data, may be fine if the dose is one ordinary cup. Dose and speed both move the number, so any advice that names only hours is answering half the question.
Working out your own cutoff from a real cup
What follows is arithmetic, not a lab test. The target it aims at comes from a Stanford Knight-Hennessy Scholars piece on caffeine and sleep quality, which suggests keeping residual caffeine at bedtime to roughly 30 mg or less, and recommends a cutoff 8 to 10 hours before bed as the general strategy. Thirty milligrams is about a quarter of a standard cup: enough to be present, not enough to meaningfully occupy your adenosine receptors.
It costs nothing but attention, and about two weeks.
-
A bedtime that is roughly the same each night for the next fortnight
Shift workers: use your actual sleep start, not a clock convention. The 2024 SLEEP trial dosed relative to each participant's individualised bedtime for exactly this reason.
-
A written list of everything caffeinated you drink on a normal day, with times
Including the ones you don't think of as caffeine. The Sleep Foundation survey found 51% of caffeine consumers name coffee as their main source, but 28% name soda, 10% tea and 7% energy drinks.
-
Milligram figures, not cup counts
Sleep Foundation ranges: 8 oz coffee 100 to 200 mg, 8 oz tea 40 to 120 mg, 12 oz soda 0 to 70 mg, an 8 to 16 oz energy drink 50 to 300 mg.
-
An honest note on anything that moves your enzyme speed
Smoking or nicotine, pregnancy, oral contraceptives, other medications. The 2025 Neuropsychopharmacology letter notes certain drugs and dietary factors inhibit CYP1A2 as well.
-
Some way to record when you got into bed, roughly when you fell asleep, and how many times you woke
A notebook is fine. The point is a record you cannot revise in the morning.
1. Add up the dose that lands closest to bed. Not your daily total, the single largest hit in the back half of the day. If your 4pm habit is a 16 oz takeaway coffee, treat it as one dose in the 200 mg region rather than "a coffee". You know this step worked when you have a number in milligrams and a time on a clock. Cost: ten minutes with a search engine and a label.
2. Choose a starting half-life. Use 5 hours as the default. That is the midpoint of the 4 to 6 hour typical range the Sleep Foundation gives for how long caffeine takes to wear off, and close to the 4 to 6 hour average sleep physician Dr Abhinav Singh gives in the Sleep Foundation's caffeine survey report. Then adjust once: halve it to about 2.5 hours if you smoke, double it to about 10 hours if you are pregnant or taking oral contraceptives. If you know you are a CC slow metabolizer from genetic testing, start at 9 hours instead. Do not adjust for how caffeine "feels", which is the one input the 22% figure tells you to distrust.
3. Halve the dose until it is under 30 mg, counting hours as you go. A 200 mg coffee at a 5-hour half-life: 100 mg at five hours, 50 mg at ten, 25 mg at fifteen. Under 30 at about fourteen hours. A 100 mg cup on the same clearance: 50 mg at five hours, 25 mg at ten, so under 30 at about nine hours. This is not a private method. The reporting around the 2024 SLEEP work quotes minimum gaps of about 4 hours for 100 mg, about 8.8 hours for a 107 mg standard cup and about 13.2 hours for a 217.5 mg large coffee or pre-workout, which is what this arithmetic produces at a half-life just under 5 hours. You know the step worked when your number lands in the same territory for the same size drink.
4. Subtract from your bedtime and write the clock time down. For an 11pm sleeper with a 150 mg afternoon cup and average clearance, the sum gives roughly 11 to 12 hours, so around noon. That will look absurd if your habit is a 4pm cup. Note the gap, because the gap is the finding.
5. If the honest number is impossible, shrink the dose instead of the day. This is the most useful thing in the 2024 trial and the part no cutoff rule captures. One hundred milligrams produced negligible sleep effects even four hours before bed, while 400 mg lengthened sleep latency twelve hours before bed. Cutting a 300 mg afternoon habit to a single 100 mg cup buys more room than moving 300 mg two hours earlier. A smaller later cup beats a larger earlier one.
6. Hold the new cutoff for 10 to 14 days without changing anything else. Not three nights. Caffeine tolerance, withdrawal and ordinary night-to-night variation all need a fortnight to average out, and the Stanford piece explicitly recommends tapering gradually rather than stopping abruptly to avoid withdrawal. If you are cutting a large habit, step down over several days rather than in one go. Cost: two weeks, and a few days of headache if you cut hard.
7. Judge it on the right signals. Not "did I drop off quickly", which is the judgment people get wrong three times in four. Look instead at the number of awakenings you recorded, how long the gap was between lights out and sleep by the clock, and how you feel in the first hour after waking. The 2013 trial found caffeine reduced slow-wave sleep, the deep stage that makes a night feel restorative, and the 2024 trial found the same 30-minute N3 loss with light sleep rising about 6.1 minutes to replace it. That is an architecture change you feel in the morning rather than at lights out.
8. If two weeks changes nothing, move the cutoff earlier in two-hour steps. One step per fortnight. If four hours earlier and a halved dose both fail to shift anything, caffeine is not your main problem, and you have spent a month ruling out the most common one cheaply. That is a real result.
The mistakes that keep the fragmented nights coming
Counting cups instead of milligrams. A cup is not a unit. The Sleep Foundation's own range for an 8 oz coffee is 100 to 200 mg, and Stanford's figure for a single cup is 80 to 120 mg, so "two cups" covers anything from 160 to 400 mg before you get to the fact that most takeaway cups are not 8 oz. Recognise it when your cutoff feels like it should work and doesn't. Fix it by finding the milligram figure for the specific drink once, and reusing it.
Trusting how it felt. Covered above and worth repeating because it is the mistake that sinks everything else: 22% correct identification in the 2024 trial. If you are using your subjective experience as the control on your experiment, you have no control. Use the clock and the count of awakenings.
Assuming six hours is a rule for your dose. The 6-hour figure is real, but it comes from a 12-person study that used 400 mg, and what it showed is that six hours was not enough: more than an hour of sleep was still lost. It was never a licence for four cups at 5pm. Recognise it when you have followed the rule for months and gained nothing. Fix it by treating six hours as the point where a large dose starts to become survivable, not safe.
Stopping at a time that was never tested. The Sleep Foundation survey found 49% of people stop caffeine 1 to 4 hours before bed and 14% consume it right before sleep. In the 2013 trial, the 0-hour condition cost roughly 1.1 to 1.2 hours of sleep and the 3-hour condition added 17.2 minutes to sleep onset. Most people's actual cutoff sits inside the window the experiments used to demonstrate harm.
Forgetting the morning cup if you clear slowly. If your half-life really is in the 9 to 12 hour band, an 8am coffee is at half strength at 6pm. The Fuel Your DNA summary makes this point directly for CC genotypes: morning coffee can still be acting more than twelve hours later. Recognise it when your cutoff is early and strict and your sleep is still shallow. Fix it by cutting the total daily dose rather than shifting it.
Blaming caffeine for a problem it may not own. This one cuts the other way, and it deserves airtime. A Mendelian randomization study on PMC, which uses inherited genetic variants as a natural experiment to test cause rather than correlation, drew on genetic data from hundreds of thousands of people of European ancestry and found no causal effect of habitual caffeine consumption or CYP1A2-driven metabolism speed on sleep duration or insomnia risk. What it did find was an effect on daytime function: more caffeine, less daytime sleepiness; faster metabolism, less napping. It also found evidence running backwards, with a genetically predicted evening chronotype, meaning a natural body clock that prefers late nights, predicting lower caffeine consumption. Some of the observed link between coffee and bad sleep may be night owls and their habits rather than the drug.
That study measures lifetime average consumption, not the timing of one cup, which is exactly the variable the crossover trials manipulate. So it does not overturn them. But it is a fair warning that if your last caffeine is at 10am and your sleep is still broken, the answer is somewhere else.
Who this arithmetic doesn't fit
If you are pregnant. The Sleep Foundation reports pregnancy roughly doubling caffeine's half-life. Run the sum with 10 hours instead of 5, which pushes the cutoff on an ordinary cup deep into the morning. This is a clearance question, separate from any advice about total intake during pregnancy, which is a conversation for your clinician.
If you smoke or use nicotine. Clearance speeds up by about 50%, so a later cutoff is defensible on caffeine grounds alone. The catch is that if you quit, your caffeine half-life lengthens again within days while your habit stays the same, and the dose that never touched your sleep suddenly does.
If you take oral contraceptives. Per the Fuel Your DNA summary, CYP1A2 activity drops around 50%, which roughly doubles effective half-life. Most cutoff advice online is written as though this group does not exist, and it is a large one.
If your dose is one cup, not four. The 2024 trial found 100 mg negligible at four hours before bed. If you drink one modest coffee and nothing else, a four-hour gap has actual trial evidence behind it, and moving to eight buys you little. Reserve the strict cutoffs for the days you drink like it is a deadline.
If you are a shift worker. Every clock-time rule, including the 5pm figure the 2013 authors suggested, assumes a night-time bedtime. Convert it: the rule is hours before your sleep, whenever that sleep starts. If you go to bed at 9am, your equivalent of the 5pm limit is around 3am, which is usually mid-shift and exactly when you least want to hear it.
If you are on medication. The 2025 Neuropsychopharmacology letter notes that some drugs and dietary factors inhibit CYP1A2 and slow clearance. If you started a new prescription and your old caffeine habit stopped working, that is a plausible mechanism and worth raising with a pharmacist, who can check the interaction in minutes.
If you drink tea rather than coffee. The Sleep Foundation survey found 75% of tea drinkers get the recommended 7 or more hours of sleep against 58% of coffee drinkers. That is a survey, not a trial, and the most likely explanation is dose: 40 to 120 mg for an 8 oz tea against 100 to 200 mg for coffee. Tea is not gentler per milligram; there are just fewer milligrams.
If you have swapped to genetic testing for an answer. A test for rs762551 will tell you your genotype. What it will not do, according to the 2025 letter, is reliably predict your response to a standard dose, because so much else modifies enzyme activity. Treat the result as the starting half-life for step 2 above, then let the fortnight of observation correct it.
What the lost hour costs, and what fixing it costs
The fix costs nothing in money. It costs one afternoon habit, about ten minutes of arithmetic, and a fortnight of paying attention. That is the whole bill, which is unusual for anything in sleep.
Against that, the associational numbers are worth knowing even though they cannot prove cause. The Sleep Foundation reports that across roughly 160,000 of its user profiles, 88% of people who drink caffeine in the afternoon report a sleep problem. Its survey of US adults found insomnia reported by 31% of caffeine drinkers against 22% of non-drinkers, and daytime sleepiness by 35% against 27%. These are correlations, and the Mendelian randomization evidence above is a genuine argument that some of that correlation runs the other way: tired people drink more coffee. But the crossover trials are not correlational, and they found real sleep loss at real doses.
Two ceilings worth carrying around, both from FDA guidance as cited by the Sleep Foundation: 400 mg a day, roughly four cups of coffee, is the safe daily limit for most healthy adults, and caffeine poisoning risk rises above 1,200 mg. Note that 400 mg is simultaneously the daily safe maximum and the single dose that wrecked sleep twelve hours out in the 2024 trial. Safe for your heart and safe for your night are different thresholds.
And the honest limits of all this: the 2013 trial had 12 participants, the 2024 trial had 23, all of them men with a mean age of 25.3. Neither sample looks like a 44-year-old woman on shift work with two children. The direction of the findings is consistent and mechanistically sensible, but the specific minute counts transfer to you by assumption rather than by evidence. What would settle it is a larger trial across both sexes and a wider age band with participants genotyped for CYP1A2, so the fast and slow groups could be reported separately instead of averaged into a single number that describes nobody.
Even though caffeine makes you feel energized, it's important for people to understand that it doesn't replace a good night's rest.
Comments
No comments yet. Be the first to comment!
Leave a Comment