Wind-Down Routine BuilderSleep & Evenings · ~4 min
Interactive preview
More templates like this
Browse all templates →About this template · Updated September 2026

Most advice about caffeine and sleep arrives as a single hour: nothing after two, nothing after noon, nothing after lunch. The trouble is that the hour was worked out for somebody else. It assumed their mug, their bedtime and, above all, their liver. This page does the working for you instead, and shows it as a curve you can argue with.
The idea: doses that halve
Caffeine gets in fast. A safety review in Frontiers in Psychiatry describes it as fully absorbed from the gut in under an hour. After that, to a good approximation, your body clears a fixed share of whatever is left every hour. The handy number is the half-life: how long it takes for the amount on board to drop by half. Drink 140 milligrams at eight in the morning and, on a five-hour half-life, about 70 are left at one, 35 at six and 18 at eleven.
Every cup runs on its own clock, and the cups add up. That is why a small tea at four can matter more than it looks. It is not landing in an empty system. It lands on top of whatever the morning left behind.
Why there is no single magic cutoff here
The same review puts the adult half-life anywhere from three to seven hours. It also reports that oral contraceptives tend to double it, that pregnancy stretches it by hours more, that liver disease and heavy drinking slow clearance, and that smoking roughly doubles the clearance rate in the other direction. Two people can split a pot of coffee at noon and carry very different amounts to bed.
Nobody can measure their own half-life at the kitchen table, so the dial is a judgment call. Start at five hours. If a mid-afternoon coffee reliably costs you sleep, slide it longer. If an espresso after dinner has never troubled you, slide it shorter. The green stretch of the slider is the usual adult range, and everything to its right exists for the situations that review names.
How the worksheet works
Set your bedtime first. With nothing logged, the page already answers the question most people arrive with: the latest moment a twelve-ounce coffee can go in and still fade to your line before bed. It draws that cup as a dashed curve that comes down to meet the line right under the moon.
Then pour your day. Pick a drink, choose a size in ounces or milliliters, drag the time or tap the chart where the cup went, and press pour it. Each cup sits on the peak it creates. The red mark at bedtime is what is still on board when you lie down, and the headline switches from your last cup to whether there is room for one more, and until when. If the day is already over your line, it says so without drama. A day holds eight cups, and new day clears them in two taps.
The milligrams behind each drink are middling figures. The FDA's consumer guide to caffeine lists a twelve-ounce coffee at anywhere from 113 to 247 milligrams, so a strong coffee-shop brew can carry nearly double a home one. If yours is strong, log the next size up.
About your line
The line is how many milligrams you are willing to take to bed. No study fixes that number, and the dial admits as much. The default of 35 is borrowed arithmetic. A 2023 meta-analysis in Sleep Medicine Reviews pooled 24 studies and estimated that a 107 milligram coffee needs at least 8.8 hours before bedtime to leave total sleep time alone, while a 217 milligram pre-workout needs 13.2. Run either figure through a five-hour half-life and roughly 30 to 35 milligrams remain at lights out. That last sum is ours, not the authors', and it leans on a half-life nobody measured. Treat 35 as a place to start and move it as your own nights teach you.
The two marks under the log
Below your cups, a bar totals the day against two quoted figures. The FDA cites 400 milligrams a day as an amount not generally associated with negative effects for most adults. ACOG's committee opinion on caffeine in pregnancy describes moderate intake as less than 200 milligrams a day. Both sit on the bar with their sources named. Neither is this page's advice, and a clinician who knows your history outranks the pair of them.
What the curve leaves out
It treats each cup as arriving all at once, when real absorption rounds the peaks and nudges them later. And it knows nothing about your sleep itself. A number at bedtime does not predict how your night will go. It is one input you can finally see.
When to use it
Open it in the morning to find the hour worth protecting, and again before the cup you are unsure about. Keep a Sleep Log alongside it for two weeks and you will learn whether your line sits in the right place. If the afternoon cup is really about a slump, the coffee-nap preset in The Nap Timer squeezes more out of an early one, and the Hydration Calculator looks after the glass of water that ought to sit beside it.
Frequently asked questions
How does a caffeine calculator work?
It treats every drink as a dose that halves once per half-life. Stack those fading doses along the day and you get a curve, and reading the curve at bedtime tells you roughly how many milligrams are still circulating when you try to sleep.
What is the half-life of caffeine?
A review in Frontiers in Psychiatry gives three to seven hours for adults, notes that oral contraceptives tend to double it and pregnancy stretches it further, and reports that smoking speeds clearance. With a spread that wide, this page asks you to choose a half-life instead of assuming five hours for everybody.
When should I have my last cup of coffee before bed?
A 2023 meta-analysis in Sleep Medicine Reviews estimated that a coffee of about 107 milligrams should be finished at least 8.8 hours before bedtime to avoid losing sleep time, and a 217 milligram pre-workout at least 13.2 hours before. Your own hour moves with cup size, half-life and whatever you drank earlier, which is the sum the curve does for you.
How much caffeine is too much in a day?
The FDA cites 400 milligrams a day as an amount not generally associated with negative effects for most adults. An ACOG committee opinion describes moderate intake during pregnancy as less than 200 milligrams a day. The page shows both as quoted marks beside your daily total, and a clinician who knows you overrides either one.
Do I have to sign up to work out my last cup?
No sign-up is needed to read the filled-in day shown on this page. Pouring your own cups, and keeping your bedtime, half-life and line between visits, happens inside HabitatZero, which is free to open.
Ready to give it a try?
By the team behind Fabulous, the science-based self-care app used by over 30 million people.