You finish your last coffee at 3pm. By 10pm, you feel "fine" โ€” no jitters, no buzz, ready for bed. So you assume the caffeine is gone.

It isn't. Caffeine has a half-life of roughly 5 to 6 hours in most adults, which means that 3pm coffee still has about half its caffeine active in your system at 8-9pm โ€” and a quarter of it is still on board at 1-2am. You don't feel it anymore because the subjective "buzz" fades faster than the actual chemical does its work on your adenosine receptors, the same receptors that help regulate how quickly you fall asleep and how deep that sleep is.

This is the gap between how caffeine feels and what it's actually doing โ€” and it's the reason so many people who "sleep fine" still wake up with poor HRV, lighter sleep, and a flat morning recovery score.

42mg
Caffeine on board at bedtime
From a 3pm coffee (95mg) and a 12pm espresso (63mg), roughly 42mg of caffeine is still active in your bloodstream at an 11pm bedtime โ€” about a quarter of a fresh cup, working against your sleep onset the whole night.

How Caffeine "On Board" Actually Works

Every dose of caffeine you drink decays on an exponential curve, halving roughly every 5.5 hours (this varies โ€” slow metabolizers, pregnancy, and certain medications can roughly double that). The model is simple: take the mg you consumed, and at any later hour, multiply by 0.5^(hours elapsed / half-life).

The practical effect: caffeine doesn't have a hard "off" switch. A 95mg coffee at noon leaves about 48mg on board at 5:30pm, 24mg at 11pm, and 12mg at 4:30am. If you drink a second cup at 3pm, its 95mg stacks on top of whatever's left from the first โ€” and now your bedtime on-board total is much higher than you'd guess from "I only had two coffees."

A 95mg coffee at noon โ€” caffeine remaining over time
12pm
95mg
3pm
67mg
6pm
48mg
9pm
34mg
12am
24mg
3am
17mg
6am
12mg

Why Your Last Coffee Of The Day Is The One That Matters

Total daily caffeine gets most of the attention, but for sleep, two numbers matter far more: how much is on board when you go to bed, and how many hours separate your last dose from your bedtime.

A 7am espresso and a noon coffee can add up to the same total milligrams as a noon coffee and a 4pm energy drink โ€” but the second combination puts dramatically more caffeine on board at bedtime, because that 4pm dose has barely started decaying by 11pm.

Dose after bedtime is a special case. If you drink caffeine after your usual bedtime โ€” a late-night energy drink, an evening espresso โ€” it hasn't had any time to decay yet by the time you try to fall asleep. The full dose is active. This is the single most disruptive pattern for sleep onset and deep sleep.

On Track, Late Dose, or High Load: The Three Caffeine States

Rather than tracking raw milligrams, it's more useful to know which of three states you're in at bedtime โ€” each one maps to a different action:

On Track
Low caffeine on board
Caffeine on board at bedtime is low and your last dose was well clear of sleep. No action needed.
Late Dose
Cutting it close
A meaningful amount of caffeine (โ‰ˆ30mg+) is on board and your last dose was within 8 hours of bedtime. Consider moving your afternoon coffee earlier tomorrow.
High Load
Likely affecting sleep tonight
Caffeine on board at bedtime is high (โ‰ˆ80mg+), or you drank caffeine after your usual bedtime. Expect a measurable hit to sleep onset and deep sleep.

The thresholds matter less than the principle: your bedtime is the finish line, and every dose of caffeine is still running toward it from the moment you drink it. A cup that felt completely "worn off" by dinner can still be a meaningful fraction of its original dose by the time your head hits the pillow.

Common Drinks, Real Numbers

Caffeine content varies a lot by drink โ€” and "a coffee" can mean anything from 35mg to 200mg depending on what's actually in the cup:

DrinkTypical servingCaffeine
Soda12oz can35mg
Black teasteeped cup47mg
Espressosingle shot63mg
Matchaceremonial70mg
Energy drinkcan80mg
Coffeebrewed, 8oz95mg
Cold brew12oz155mg
Pre-workout1 scoop200mg

A "cold brew at 4pm" is a very different bedtime story than a "soda at 4pm" โ€” 155mg vs 35mg of starting dose means roughly 78mg vs 18mg still on board seven hours later. Knowing what you actually drank, and when, is the first step to understanding why some nights feel worse than others.

What Your Bedtime Actually Is (And Why It Moves)

Most caffeine advice gives you a generic cut-off โ€” "no caffeine after 2pm" โ€” based on an assumed bedtime that may not be yours. If you typically fall asleep at 10:30pm, a 2pm coffee is mostly cleared by then. If you're a night owl who falls asleep at 1am, that same 2pm coffee has another two and a half hours to decay before it matters โ€” your effective cut-off is later than the generic advice suggests.

The reverse is also true: if your bedtime has been creeping earlier as your training load increases, a caffeine habit that was fine for your old schedule may now be landing much closer to sleep than you realize.

This is why a caffeine tracker that pulls your actual recent bedtime from Apple Health sleep data โ€” rather than a number you typed in once and forgot about โ€” gives a meaningfully more accurate picture than a fixed clock-based rule.

From Tracking To Understanding: Where AI Comes In

Logging doses and seeing a decay curve answers what is happening. An AI advisor with access to your caffeine log alongside your sleep, HRV, and recovery data can answer why โ€” and whether it's actually affecting you personally.

Caffeine sensitivity varies enormously between people. Some people can have an espresso after dinner and sleep normally; others see their deep sleep collapse from a single afternoon coffee. The only way to know which kind of person you are is to look at your own nights โ€” comparing sleep stages and HRV on days with a late dose versus days without.

Asking an AI advisor "does my afternoon coffee actually affect my sleep?" โ€” with your caffeine log and 30 days of Apple Health sleep data available โ€” can surface patterns like: deep sleep percentage consistently lower on days with a dose after 3pm, or HRV trending down on days where caffeine on board at bedtime exceeded a certain threshold. That's a personal answer, not a population-average rule of thumb.

How To Actually Use This

โœ“ Do this
โœ“ Log doses as you drink them, not from memory at the end of the day
โœ“ Pay attention to your last dose, not just your total
โœ“ Check caffeine on board against your actual bedtime, not a fixed clock time
โœ“ Look for patterns over a week, not one bad night
โœ“ If you're sensitive, treat "Late Dose" days as a signal to shift tomorrow's timing earlier
โœ— Avoid this
โœ— Assuming "I feel fine" means caffeine has cleared
โœ— Judging a drink only by its name โ€” a cold brew and a soda aren't close
โœ— Using a generic cut-off time that ignores your own bedtime
โœ— Ignoring stacked doses โ€” two "small" cups can add up to a big load
โœ— Cutting caffeine entirely if a small timing shift would fix it

Tracking Is Free, AI Insights Are In Pro

Metrya's Caffeine Tracker lets you log a drink in seconds from eight presets (or a custom amount), and shows your today's intake, caffeine on board, decay curve, last-dose-to-bedtime gap, and a 7-day intake chart โ€” all computed on-device from your log and your Apple Health sleep data.

The AI Insights tab โ€” available in Pro with your own AI key โ€” goes further, analysing how your caffeine timing correlates with your sleep quality and HRV over time, so you can find your personal cut-off instead of guessing from a generic rule.

See your own caffeine curve tonight.

Log your coffee, see exactly how much is still on board at bedtime, and get AI insights into how it's affecting your sleep โ€” built from your Apple Health data.

Download Metrya โ€” Free