Page updated
Caffeine cut-off calculator: when to stop drinking coffee
Coffee at 8:00 AM and bed at 11:00 PM? This caffeine calculator gives the latest time for your next coffee, tea or cola before bed.
For bed at 11:00 PM
ChangeShow the caffeine curve
Why these times?
Caffeine cut-off calculator: Change the drinks
We start at 50 mg at bedtime (studio rule, no official figure).
Today's drinks
Up to 10 drinks. Leave one drink's time empty to get its latest time. A drink time after your bedtime counts as the day before.
More settingshalf-life 5 h
The one-hour wind-down plan takes it from here →

There’s no perfect night, only a better-planned one.
The Lull app has the sleep calculator from our home page, plus 6 sleep sounds that stop a minute before your phone’s alarm.
See the Lull appBed at 11:00 PM after a brewed coffee at 8:00 AM? The latest time for a second cup is 4:25 PM, which leaves no more than 50 mg of caffeine at bedtime.
Latest time for one drink, by bedtime
The latest time for one drink on its own, using the calculator's starting figures: 50 mg left at bedtime and a 5-hour half-life.
| Drink | Bed at 10:00 PM | Bed at 11:00 PM | Bed at 12:00 AM |
|---|---|---|---|
| Brewed coffee | 4:00 PM | 5:00 PM | 6:00 PM |
| Espresso | 4:00 PM | 5:00 PM | 6:00 PM |
| Black tea | any time | any time | any time |
| Energy drink | 4:00 PM | 5:00 PM | 6:00 PM |
| Cola | any time | any time | any time |
A drink that would still leave more than 50 mg at bedtime gets a cut-off 6 hours before bed. We set that rule ourselves, from a study in which caffeine taken 6 hours before bed still disturbed sleep (more under “What one study found about timing” below). A cup of black tea or a cola holds less than 50 mg to begin with, so on its own it shows “any time”. If you sleep lightly, you may want a cut-off for it anyway. Other drinks the same day move every time earlier, and the calculator above adds them all up.
What this cut-off cannot know
This is arithmetic on averages, not a measurement of the caffeine in your blood. Real drinks vary a lot with brand, brew and cup size: the FDA puts energy drinks anywhere from 54 to 328 mg per 16 fl oz. NIOSH notes that caffeine can stay in some people much longer than its usual half-life. The amount you accept at bedtime is your own choice; we start at 50 mg, a studio rule, because no official body gives a figure. The calculator does not say how much caffeine is right for you.
See a doctor or pharmacist if you are pregnant, take medicines, have a heart or liver condition, or have trouble sleeping, before relying on any caffeine figure. This page is general information, not medical advice: read our disclaimer.
How the cut-off is worked out
Caffeine leaves the body gradually. After one half-life about half of it is still active, after two about a quarter, and so on. The calculator works out each drink on its own: the caffeine in the drink, halved once for every half-life between the drink and your bedtime. It adds up what every drink leaves at bedtime and compares that total with the amount you accept. For the latest time, it runs the same sum backwards for each drink, given everything else you drank.
The half-life is the part that matters most. NIOSH's training for nurses gives 5 to 6 hours, and the calculator offers both ends. With the 5 hour figure, a cup of brewed coffee of about 95 mg drunk 5 hours before bed still leaves about 48 mg at lights-out.
Worked example: two coffees on a workday
Bedtime is 11:00 PM, the half-life is 5 hours, and you have two cups of brewed coffee, at 8:00 AM and 1:00 PM. The first cup is 15 hours before bed and leaves about 12 mg; the second is 10 hours before bed and leaves about 24 mg. Together that is about 36 mg, under the 50 mg starting figure. Given what the first cup leaves, the second could have been as late as 4:25 PM, which is earlier than the 6-hour mark (5:00 PM), so the half-life sets the time. With the 6 hour figure the same two cups leave about 47 mg, and the latest time moves to 1:54 PM.
What the drinks table and the curve show
The large time is the latest time for your last drink of the day. The table gives a latest time for every drink and says what set it, or that your other drinks leave no room. The curve shows the same estimate through the day, and each line under it links to its row on the methodology page.
Where the drink amounts come from
The drinks list uses USDA FoodData Central records: the caffeine per 100 grams and the weight of one serving, multiplied. That gives about 95 mg for brewed coffee (1 cup (8 fl oz)), 63 mg for espresso (1 fl oz shot), 47 mg for black tea (1 cup (8 fl oz)), 75 mg for an energy drink (8.4 fl oz can) and 33 mg for cola (12 fl oz can). They are one record each, not your cup. A cafe coffee or a large mug can be well above them, so type the real figure into the custom amount if you know it.
The FDA gives two ranges worth knowing. Energy drinks vary from 54 to 328 mg per 16 fl oz between brands, and decaf coffee still has some caffeine: typically 2 to 15 mg in an 8 fl oz cup.
What one study found about timing
Drake and colleagues (2013) gave volunteers 400 mg of caffeine at bedtime, 3 hours before, or 6 hours before, and compared their sleep at home with a placebo. All three times disturbed sleep, and the authors wrote that caffeine taken 6 hours before bedtime still had important disruptive effects. That amount is about 4 cups of brewed coffee from the list above, so the study shows the direction of the effect rather than a time that suits one cup. The calculator therefore does two things. It works out from the half-life what each drink leaves at bedtime, and when that gives a clock time, it never shows one later than 6 hours before bed, a studio rule built on this study. The result is the earlier of the two times, and it says which one set it. A drink that already leaves no more than your figure shows “any time”, because the study's 6 hours were for 400 mg of caffeine. If no time today keeps a drink under your figure, it says so instead of giving a clock time.
The daily figure
The FDA cites 400 mg a day as an amount not generally associated with negative effects for most adults, and says people vary in how sensitive they are. The calculator shows that figure next to your day's total when you go above it, for reference only. It is a daily amount, not a bedtime one, and a day well under it can still leave enough caffeine at bedtime to matter to you.
When a cut-off is not the question
If you work nights, caffeine timing follows the shift, not a usual bedtime; the night-shift sleep planner gives a caffeine stop for that. If you are thinking of a coffee just before a short nap, the nap planner explains what NIOSH says about it.
The values behind these times
Each row is one value this tool uses, with its tier: Primary = read off the source page, Secondary = reported by the source from another body, Studio rule = our own choice, with the reason given on the methodology page. The links in the result above go to the same rows there.
Quotes, notes and the date we last read each source are on the methodology and sources page.
Caffeine questions
How many hours before bed should I stop caffeine?
There is no single number. It depends on how much caffeine is in your drinks, how fast your body clears it and how much you accept at bedtime. In one study, 400 mg taken 6 hours before bed still disturbed sleep. The calculator works out a time for your own drinks; when the half-life gives a clock time, it never shows one later than 6 hours before bed.
What is caffeine's half-life?
NIOSH gives 5 to 6 hours and notes it can be much longer in some people. The calculator lets you pick either end.
How much caffeine is in my drink?
The list uses USDA FoodData Central records: about 95 mg in a cup of brewed coffee and 63 mg in an espresso shot, for example. Real drinks vary, so use the custom amount if you know yours.
Why does it start at 50 mg at bedtime?
It is our starting figure, a studio rule. No official body gives an amount of caffeine that is fine at bedtime, so you can change it.
Does decaf count?
It can. The FDA says decaf coffee typically has 2 to 15 mg in an 8 fl oz cup. Add it as a custom amount if you want it counted.
What is the 400 mg figure?
The FDA cites 400 mg a day as an amount not generally associated with negative effects for most adults. It is a daily figure, shown for reference, and says nothing about bedtime.
Are the drinks I enter stored anywhere?
No. Everything is worked out in your browser. The share link holds only the bedtime, your figure, the half-life and the drinks, and only if you copy it.
More questions about the site, its sources and privacy are answered in the Lull FAQ.