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.

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 →

Lull app: Rain stops at 6:29 am and fades out from 6:24 am

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 app

Bed 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.

DrinkBed at 10:00 PMBed at 11:00 PMBed at 12:00 AM
Brewed coffee4:00 PM5:00 PM6:00 PM
Espresso4:00 PM5:00 PM6:00 PM
Black teaany timeany timeany time
Energy drink4:00 PM5:00 PM6:00 PM
Colaany timeany timeany 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.

A white mug of black coffee on a wooden table
A cup of brewed coffee holds more caffeine than a cup of tea, so its cut-off comes earlier. Photo: Quercus acuta, CC BY-SA 4.0, via Wikimedia Commons; cropped and darkened, shared under the same license

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.

advertisement

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.

An espresso in a white cup, with a square of chocolate on the saucer
Small as it is, an espresso still adds to the caffeine left at bedtime. Photo: Balise42, CC BY-SA 4.0, via Wikimedia Commons; cropped and darkened, shared under the same license

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.

ValueTierSource
Caffeine half-life, low figure
5 h
PrimaryCDC/NIOSH, 2020
Caffeine half-life, high figure
6 h
PrimaryCDC/NIOSH, 2020
Default caffeine amount still active at bedtime
50 mg at bedtime
Studio ruleOur rule, leaning on US FDA, 2024
Brewed coffee
40 mg per 100 g; 1 cup (8 fl oz) = 237 g, so about 95 mg
PrimaryUSDA FoodData Central, 2019
Espresso
212 mg per 100 g; 1 fl oz shot = 29.6 g, so about 63 mg
PrimaryUSDA FoodData Central, 2019
Black tea
20 mg per 100 g; 1 cup (8 fl oz) = 237 g, so about 47 mg
PrimaryUSDA FoodData Central, 2019
Energy drink
29 mg per 100 g; 8.4 fl oz can = 258 g, so about 75 mg
PrimaryUSDA FoodData Central, 2019
Cola
9 mg per 100 g; 12 fl oz can = 370 g, so about 33 mg
PrimaryUSDA FoodData Central, 2019
Caffeine in energy drinks, range across brands
54 to 328 mg per 16 fl oz
PrimaryUS FDA, 2024
Caffeine in decaf coffee
2 to 15 mg per 8 fl oz cup
PrimaryUS FDA, 2024
Daily amount the FDA cites as not generally associated with negative effects for most adults
400 mg a day
PrimaryUS FDA, 2024
Caffeine amount in the Drake 2013 study
400 mg
PrimaryDrake et al., J Clin Sleep Med, 2013
Earliest time before bed in the Drake 2013 study that still disturbed sleep
6 h before bedtime
PrimaryDrake et al., J Clin Sleep Med, 2013
Latest cut-off the caffeine calculator shows
6 h before bedtime
Studio ruleOur rule, leaning on Drake et al., J Clin Sleep Med, 2013

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.