When to Stop Drinking Coffee Before Bed: Finding Your Personal Caffeine Cutoff

“No coffee after 2 pm.” “Stop six hours before bed.” “Nothing after lunch.” Everyone has a rule, and everyone’s rule is different — because each of those rules was calibrated to somebody else’s body, bedtime, and coffee habit. The good news: you can replace borrowed rules with a cutoff time that is actually yours. It takes a little arithmetic, or a tool that does the arithmetic for you.

What the research actually shows

The most-cited experiment on caffeine timing, discussed by the Sleep Foundation, gave participants a large caffeine dose at 0, 3, or 6 hours before bed. Even the dose taken a full 6 hours before bedtime measurably disturbed sleep — cutting more than an hour of sleep by objective measures, and notably, participants underestimated the damage themselves. That last part matters: caffeine can be degrading your sleep without you noticing, because you still “fall asleep fine” while your sleep gets lighter and more fragmented.

So “six hours before bed” is a reasonable floor for a large dose. But it is a floor, not a personalized answer. Three variables move your real cutoff around:

The math behind a real cutoff

A useful way to think about it: pick a residual level at bedtime that you are willing to accept — many people aim to be under roughly 50 mg, about half an espresso shot — then work backwards using half-life halving.

Hours needed to fall below ~50 mg, by dose and half-life (approximate)
Drink dose3-hour half-life5-hour half-life8-hour half-life
100 mg (small coffee)~3 h~5 h~8 h
200 mg (large coffee)~6 h~10 h~16 h
300 mg (cold brew / energy drink)~8 h~13 h~21 h

Read that middle column again. With a perfectly average 5-hour half-life, a 300 mg cold brew needs about 13 hours to fall under 50 mg. For an 11 pm bedtime, that puts the cutoff at roughly 10 am — not 2 pm. Big doses are the silent sleep killers, and this is why “I only had one coffee” can still mean a rough night if that one coffee was a venti.

A step-by-step method to find your cutoff

  1. Fix your bedtime. Pick the time you genuinely intend to be asleep, not the aspirational one.
  2. Know your doses. Look up the actual caffeine content of your usual drinks instead of guessing. The spread is huge: espresso shots run ~60–75 mg, brewed coffee 95–200 mg per cup depending on size, energy drinks 80–300 mg per can.
  3. Start from the 5-hour average. Compute (or let an app compute) when your last drink of the day decays below your bedtime target.
  4. Run a one-week experiment. Keep your cutoff for a week and note how quickly you fall asleep and how rested you feel. Sleep still rough? Assume a longer half-life, move the cutoff earlier, repeat.
  5. Respect your outliers. Some days you will break the rule. Rather than guilt, use those days as data — a late espresso that costs you nothing is evidence your half-life is shorter than you assumed.

Watch for the afternoon trap: the stimulant “feel” of caffeine fades in 4–6 hours, long before the caffeine itself is gone. Feeling calm at 9 pm does not mean your bloodstream is clear — it means your receptors have adapted while the molecule keeps working against your deep sleep.

What about “I can drink espresso at midnight and sleep fine”?

Some people genuinely can — fast metabolizers with a 2–3 hour half-life clear a shot before it can do much harm. But two cautions. First, self-reports are unreliable: in the timing study above, people consistently underestimated how much caffeine disturbed their measured sleep. Second, sleep quality can suffer even when sleep onset does not. If you sleep eight hours after late caffeine but wake up unrefreshed, the caffeine is a prime suspect.

How HalfCup helps

All of the above is exactly the computation HalfCup was built to do. You set your bedtime, wake time, and personal half-life (adjustable from 2 to 10 hours); the app models each logged drink with half-life decay and a 30-minute absorption window. After every drink it shows your “sleep-ready by” time, and it also shows the last safe caffeine time for today — your personal cutoff, recomputed from what you have actually consumed. A scrubbable decay curve lets you check your projected level at bedtime before you order that 3 pm coffee. It is a $4.99 one-time purchase, fully offline, with no account and no data collection.

The bottom line

There is no universal last-coffee time. There is a floor from the research — large doses within six hours of bed reliably damage sleep — and there is your personal number, which depends on dose, metabolism, and bedtime. Work it out once, verify it against a week of real nights, and you get to keep both your coffee and your sleep.

This article is for information and education only and is not medical advice. Consult a qualified healthcare provider about your caffeine consumption, especially if you are pregnant, nursing, have a medical condition, or take medications.