When Should You Stop Drinking Caffeine for Sleep?

Why the dose matters as much as the clock, and how to find a cutoff that fits you.

Steaming coffee cup on a kitchen counter in late-afternoon sun, with long shadows across the floor toward an open bedroom door.

If you are trying to work out when to stop caffeine before bed, you will find plenty of confident answers.

No caffeine after noon. Stop six hours before bed. Stop eight hours before bed. Never touch coffee after lunch, or else.

The research does not support one perfect cutoff for everybody. The dose matters. The timing matters. And your own body matters, possibly more as you get older.

A large coffee at 3 PM is not the same thing as a small tea at 3 PM.

So instead of treating one clock time as a law of nature, use the evidence to pick a sensible starting point, then test it on your own nights.

There is no universal caffeine curfew

One of the best-known caffeine studies gave people 400 mg of caffeine at bedtime, three hours before bed, or six hours before bed.

That 2013 study found sleep was disrupted at all three times, including six hours out. It is where the familiar "six-hour rule" comes from.

But look at the dose. 400 mg is a lot of caffeine in one go. By the FDA's figures, it is roughly two to three 12-ounce cups of brewed coffee.

A 2025 trial in the journal Sleep tested two doses, 100 mg and 400 mg, taken 12, 8 or 4 hours before bed. Its results are more interesting than any rule of thumb:

  • 100 mg had no significant effect on sleep at any of the three times, including four hours before bed.
  • 400 mg delayed falling asleep when taken anywhere within 12 hours of bedtime.
  • 400 mg also broke sleep up more when taken within 8 hours of bed.
  • Yet people only felt their sleep was worse when the 400 mg came 4 hours before bed.

That last point matters. At 8 and 12 hours, the sleep monitor picked up changes the sleepers themselves did not notice.

Grid comparing 100 mg and 400 mg of caffeine taken 12, 8 and 4 hours before bed, showing which combinations changed sleep in a 2025 trial.
What the 2025 trial found. 23 healthy young men, one dose each time. Results in other people may differ.

Who was actually tested

Here is the fine print. The 2025 trial studied 23 healthy men with an average age of 25. Each got one dose, once, not a day of refills.

The authors say plainly that this limits how far the results stretch.

They also note that adults over 40 have been shown to be more susceptible to sleep disruption from caffeine, and that hormones may change how women process it.

So if you are past 40, treat "100 mg four hours before bed looked fine" as a best case, not a promise.

It means the amount matters as much as the clock. It does not mean your 4 PM latte is cleared for takeoff.

First, find out how much caffeine you are actually drinking

"One coffee" is not a dose. A small coffee made at home and a large café coffee can be very different animals.

The FDA lists typical caffeine amounts for 12-ounce drinks:

Drink, 12 ouncesTypical caffeine
Regular brewed coffee113 to 247 mg
Energy drink41 to 246 mg
Black teaabout 71 mg
Green teaabout 37 mg
Caffeinated soft drink23 to 83 mg

Real products vary, and cafés are not required to tell you how much caffeine is in the cup. You can ask.

So before deciding that 2 PM is your cutoff, find out roughly what 2 PM contains. A green tea at 2 PM and a large brewed coffee at 2 PM could differ by more than 200 mg.

The 400 mg figure is not a sleep cutoff

You may have seen 400 mg described as the "safe" daily limit. The FDA says that for most adults, 400 mg a day is an amount not generally associated with negative effects.

That is a whole-day reference.

It does not mean 400 mg late in the afternoon will leave your sleep alone. As the 2013 study showed, the same 400 mg can disrupt sleep six hours later. Daily safety and bedtime timing are different questions.

Caffeine is not just coffee

Painted specimen plate of everyday items that can contain caffeine: a teacup of tea, a soda can, dark chocolate, an energy drink can, cold tablets and a cup of decaf coffee.

Coffee, espresso, black tea, green tea, cola and energy drinks are the obvious ones. They are not the only ones.

MedlinePlus notes that caffeine occurs naturally in cacao, so chocolate has some.

It is also added to some pain relievers, cold medicines and over-the-counter alertness tablets, as well as "energy" gums and snacks. The FDA adds protein bars, ice cream and some dietary supplements.

Even decaf is not caffeine-free. The FDA says decaf coffee typically has 2 to 15 mg in an 8-ounce cup. For most people that is a rounding error. For someone very sensitive, it may still be worth knowing.

Afternoon tea still counts

This one is easy to miss when tea is part of a relaxing afternoon. Black and green tea usually have less caffeine than brewed coffee, but they are not caffeine-free.

If you are testing a cutoff, include them.

Otherwise you can quit the afternoon coffee while quietly replacing it with enough tea to muddy the result. Herbal teas are different, but read blends carefully, because some contain real tea leaves.

Energy drinks: read the label, not the can

The words "energy drink" tell you nothing about the dose.

The FDA gives a range of 54 to 328 mg per 16 ounces. Check the caffeine per serving, and how many servings are in the container you actually drink.

Pre-workout powders and supplements deserve their own look. Do not assume they hold the same amount as a coffee.

What about chocolate at night?

Chocolate contains caffeine naturally, usually far less than coffee.

You do not need to turn dessert into a laboratory calculation. If your caffeine test gives confusing results, jot down evening chocolate as one more possible source and move on.

Why one person can drink coffee after dinner and another cannot

Your friend who has an espresso after dinner and sleeps like a log is not lying.

The FDA says there is wide variation both in how sensitive people are to caffeine and in how fast they clear it from the body.

Some medicines and health conditions make people more sensitive too.

According to MedlinePlus, caffeine peaks in the blood within an hour, and you may feel its effects for four to six hours. Feeling it and being affected by it are not the same thing, though.

Remember the 2025 trial.

The sleep monitor picked up delayed and broken sleep from a big dose taken 8 or 12 hours before bed, and the sleepers did not feel the difference.

That is why "I fall asleep fine after coffee" does not settle the question.

Falling asleep is only one outcome. You also care about:

  • how long you sleep
  • how often you wake
  • how rested you feel in the morning
  • how sleepy you are the next afternoon

Check with your doctor or pharmacist first if you are pregnant or breastfeeding, have high blood pressure, a heart rhythm problem, anxiety, reflux or ulcers, or take stimulants, asthma or heart medicines, or certain antibiotics. MedlinePlus lists all of these as reasons to ask whether you should limit caffeine, and some medicines interact with it.

A simple caffeine timing experiment

Start with your own routine, not somebody else's cutoff. Suppose you usually wake at 6:30 AM, have coffee at 7 and 11, drink a caffeinated tea or coffee at 3:30 PM, and go to bed around 10:30.

You do not need to declare caffeine after noon forbidden forever. Test the part of the routine most likely to matter. Here, that is the 3:30 PM cup.

Step 1: Record three ordinary days

Change nothing yet. Write down:

  • each caffeinated drink or product, and roughly how much
  • the time you had it
  • your bedtime and roughly how long it took to fall asleep
  • night waking
  • how rested you felt in the morning
  • daytime sleepiness

Our sleep diary guide already includes caffeine timing, so you can use that instead of starting another tracker.

Step 2: Move only the last caffeine earlier

Illustrated ribbon of a day from sunrise to night, with a hand lifting the afternoon cup and moving it earlier.

For the next several days, move your final caffeine two or three hours earlier than usual. Keep the rest of your caffeine roughly the same.

And resist the urge to improve everything at once.

This is not the week to buy a new pillow, start magnesium, shift your bedtime by two hours, ban all screens and take up spin class.

One change is easier to read. Five changes is a mystery novel with no last chapter.

Step 3: Compare the pattern

Look for changes in:

  • how long it seems to take to fall asleep
  • how often you wake
  • how rested you feel in the morning
  • daytime sleepiness
  • how much caffeine you feel you need the next day

If things improve consistently, your old cutoff may have been too late for you.

If nothing changes, caffeine timing may not be the main problem.

That is useful too. It means you can stop blaming the latte and look elsewhere.

If you drink a lot, or need caffeine to function

Do not assume you need to quit everything tomorrow.

If you have been having caffeine regularly and suddenly stop, withdrawal can bring headaches, drowsiness, irritability, nausea and trouble concentrating. MedlinePlus says these usually pass after a couple of days.

Headaches and drowsiness are exactly what make a sleep experiment confusing. The FDA's advice is to cut back gradually, and that also gives you a cleaner picture.

There is a bigger question hiding here.

If you need large amounts of caffeine just to stay awake through an ordinary day, ask why.

You may not be getting enough sleep. Your sleep may be broken up. You may be working shifts. Or something else may be causing the daytime tiredness.

Caffeine can make you feel more awake for a while.

It does not tell you why you are struggling, and it does not fix it.

If you are routinely exhausted despite enough time in bed, that deserves its own look, and a conversation with your doctor, rather than another coffee.

Caffeine cannot make drowsy driving safe

This deserves a boundary of its own. If you are dangerously sleepy behind the wheel, coffee is not permission to keep driving.

NHLBI explains that lack of sleep can lead to microsleep, brief moments of sleep you cannot control and may not even notice. Arriving somewhere and not remembering part of the drive is one sign.

If you are struggling to stay awake, stop driving and get somewhere safe. Repeated severe daytime sleepiness also deserves a medical assessment.

When to look beyond caffeine

So, which cutoff should you start with? There is no clock time that fits everyone.

The research gives a useful boundary instead: big doses can affect sleep many hours later, smaller doses may matter less, and older adults may be more sensitive than the young men most often studied.

A practical approach:

  1. Find your current last caffeine time.
  2. Find out roughly how much caffeine it holds.
  3. Move that dose earlier.
  4. Keep the rest of your routine steady.
  5. Compare several nights.

If you have moved caffeine earlier and still struggle, caffeine may not be the main issue.

Look at other patterns: an inconsistent bedtime, alcohol, pain, frequent bathroom trips at night, restless legs, snoring or breathing problems, stress, or medicines that affect sleep.

If you keep waking in the small hours, our guide to why you wake up at 3 AM walks through the usual suspects.

Do not keep moving the cutoff earlier and earlier if your own diary is pointing somewhere else.

This article provides general information, not an individual diagnosis or treatment plan. If you are pregnant or breastfeeding, have a medical condition, or take medicines or supplements, talk to your healthcare professional about caffeine before making changes.

Common questions about caffeine and sleep

How long before bed should you stop drinking caffeine?
There is no single number. A 2013 study found 400 mg disrupted sleep even six hours before bed, and a 2025 trial found effects from 400 mg up to 12 hours out, while 100 mg four hours before bed showed no significant effect. Start with your current last cup, move it earlier, and watch your own nights.
Is 2 PM a good caffeine cutoff?
It can be a sensible personal cutoff, but it is not a biological rule. Someone in bed at 9 PM and someone in bed at midnight are working with very different gaps. What is in the 2 PM cup matters too. A small tea and a large brewed coffee are not the same dose.
Can I drink coffee six hours before bed?
Possibly, depending on how much caffeine it holds and how sensitive you are. The six-hour finding came from a 400 mg dose, roughly two to three 12-ounce brewed coffees at once. Smaller amounts may affect sleep less. The only way to know for you is to try moving it and compare.
Does tea affect sleep like coffee?
Tea has caffeine, usually less than brewed coffee. The FDA lists about 71 mg for 12 ounces of black tea and 37 mg for green tea, against 113 to 247 mg for brewed coffee. If you are testing your caffeine timing, count afternoon tea too, or the result gets muddy.
Does decaf coffee contain caffeine?
Yes, a little. The FDA says decaf coffee typically has 2 to 15 milligrams in an 8-ounce cup. For most people that is too small to matter at bedtime. If you react strongly to caffeine, it may be worth switching to a caffeine-free drink in the evening instead.
Should I quit caffeine completely?
Not necessarily. The useful question is whether your current amount and timing are getting in the way of your sleep. If you drink a lot and want to cut back, do it gradually. Stopping suddenly can bring headaches and drowsiness for a couple of days, which confuses any sleep test.

Your next step

If your caffeine log shows that timing is one of several habits worth changing, Sleep Like a High-Performer is built for exactly that: an interactive app plus a printable workbook, US$27 one time.

It helps you set targets, track one change at a time, and see what actually moves.

No gadgets, no extreme routines. The point is not to become perfect at sleep. It is to make one useful change, see what happens, and keep what helps.