How late can you drink coffee tonight?
Caffeine in your system
Projected: one filter coffee at 18:22. Add what you've actually had to replace it.
Cycle-aligned wake-up times
Counting forward from your bedtime in 90-minute cycles. Waking at the end of a cycle tends to feel easier than waking mid-cycle. These are windows, not appointments — real cycles run 70 to 120 minutes and vary night to night.
- 04:55–05:35 4 cycles · 6 h of sleep
- 06:20–07:10 5 cycles · 7 h 30 min of sleep
- 07:45–08:45 6 cycles · 9 h of sleep
Your bedtime, and what you've already had. It works out the latest you could have one more.
Coffee doesn't stop working at bedtime. It just stops being the thing you notice.
What a caffeine cutoff actually is
A cutoff is the latest moment you can have a particular drink and still be under your own acceptable caffeine level when you go to bed. It is not a rule and it is not the same for everyone — it falls out of three things: how much caffeine is in the drink, how fast you clear caffeine, and how much you are willing to have left at bedtime.
Most advice collapses all three into one number, usually "no coffee after 2pm". That number is only right for one combination of dose, metabolism and bedtime. Move any of the three and it moves with them: an espresso at 10pm before a 7am bedtime is a completely different proposition from a cold brew at 2pm before a 10pm one.
How this works
Caffeine leaves your body exponentially. After one half-life, half the dose is left; after two, a quarter. The amount remaining after t hours is dose × 0.5^(t ÷ half-life), and the total in your system is that sum across everything you have drunk.
To get a cutoff we run that backwards. Your threshold minus what is already on board at bedtime gives the headroom left. The cutoff is the point at which one more drink would decay to exactly that headroom by bedtime: half-life × log₂(dose ÷ headroom) hours before you sleep.
The default half-life is 5 hours, the default threshold is 50 mg — roughly half a cup of filter coffee — and a filter coffee is taken as 95 mg. All three are adjustable, and all three matter more than the arithmetic does.
When the cutoff has already passed
This happens often, and it is the most useful answer the tool gives. If what you have already had leaves you near or over your threshold, the cutoff lands in the past — sometimes in the middle of the morning.
That is not an error state. It means tonight's decision is not about whether to have another one, it is about what to do instead: a later bedtime, a decaf, or accepting that falling asleep will take longer. The tool shows you when you would actually be back under your threshold, so the later-bedtime option has a number attached to it.
A worked example
Say you want to be asleep at 23:00, you drink filter coffee at about 95 mg a cup, you clear caffeine at an average rate, and you are willing to have 50 mg on board at bedtime.
With nothing else in your system, the cutoff is 18:22. A coffee at 18:22 has 4 hours 38 minutes to decay before 23:00, which is a little under one half-life, taking 95 mg down to almost exactly 50 mg.
Now add a coffee at 08:00 and another at 13:30. Those leave 11.9 mg and 25.5 mg respectively at 23:00 — 37.3 mg between them. Your headroom drops to 12.7 mg, and a 95 mg coffee needs 14 and a half hours to fall that far. The cutoff moves to 08:28 this morning, which has already gone.
Common questions
How late is too late for coffee?
About four and a half hours before bed for a single 95 mg filter coffee on an average metabolism — 18:22 if you want to be asleep at 23:00. Doubling the dose costs you exactly one half-life, so two coffees move the same cutoff five hours earlier rather than a little earlier.
Is coffee at 4pm too late?
For most people, no: one filter coffee at 16:00 leaves 36.0 mg at an 23:00 bedtime, under the 50 mg this tool treats as the threshold. It stops being fine if you clear caffeine slowly — on a 7-hour half-life the same cup leaves 47.5 mg, which is barely under — or if it is not your first of the afternoon.
Is coffee 3 hours before bed bad?
It leaves 62.7 mg on board, about two thirds of the cup and above the 50 mg threshold. Three hours is well under one half-life, so most of what you drank is still circulating. In a controlled trial 400 mg taken six hours before bed cost about an hour of sleep and participants did not reliably notice it had.
What is the 90 minute coffee rule?
It is advice to wait about 90 minutes after waking before the first coffee, on the theory that it blunts the afternoon crash. It is about when to start rather than when to stop, and the evidence for it is thin. This page answers the other end of the day, where the pharmacokinetics are settled.
What about tea, cola or energy drinks?
The same arithmetic applies — only the dose changes. A black tea is around 47 mg, a small energy drink around 80 mg, a cola around 30 mg. Pick the drink in the calculator and the cutoff moves accordingly.
Does decaf count?
Barely. Decaf coffee carries roughly 3 mg a cup against 95 mg for regular, so it sits under almost any threshold at almost any hour. That is why it is the usual answer when your cutoff has already passed.
What this cannot tell you
- Your own half-life. The 3-to-7-hour range for healthy adults is wide, and where you fall in it is genuinely unknown without testing. Every number here inherits that uncertainty.
- Your own sleep cycles. Ninety minutes is a population average; real cycles run 70 to 120 minutes and vary night to night, which is why bedtimes are shown as windows.
- The caffeine in the cup in front of you. Brew strength and cup size move filter coffee from 70 to 140 mg. The presets are central values from a range, not measurements.
- The effect of medication or liver impairment. Some drugs change caffeine clearance far more than anything modelled here. This tool does not attempt them.
- Anything about safety. It estimates sleep impact, and nothing it says bears on driving, operating machinery, or a cardiac question.
An educational estimate, not medical advice. Talk to a clinician about sleep or cardiac concerns.
Put this on your own site
The calculator embeds as a single iframe. It carries no ads, no analytics and no cookies inside the frame — it will not add anything to your page that you have not chosen — and it works on a phone at any width.
<iframe src="https://caffeinecurfew.com/embed" width="100%" height="1650" style="border:1px solid #e1e0d9;border-radius:12px" loading="lazy" title="Caffeine cutoff calculator"></iframe>
<p><a href="https://caffeinecurfew.com/">Caffeine Curfew</a></p> Set a starting point with the same options the page uses — for example a cold brew drinker with an eleven o'clock bedtime: /embed?bed=23:00&usual=cold-brew
The frame is tall enough for the chart at the narrowest width a phone will give it, so a wide column gets some slack at the bottom. The credit line under the frame is the only thing we ask for; please keep it.
References
- 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
- American Academy of Sleep Medicine — late afternoon and early evening caffeine can disrupt sleep at night. 2013
- Institute for Scientific Information on Coffee — caffeine and metabolism. n.d.
Written by Toni Ristola — Built the calculator and wrote the explainers. Not a clinician.
Last updated 2026-08-30