Home/Articles/How Long Before Bed Should You Stop Caffeine?
Sleep Guide

How Long Before Bed Should You Stop Caffeine?

The Sleep Foundation suggests stopping at least 8 hours before bed. Here is why, what research found, and a last-cup time for your bedtime.

By Daniel Carter · Updated November 15, 2026

Short answer: Stop caffeine at least 8 hours before bedtime, according to the Sleep Foundation. If you are sensitive to caffeine, stop earlier. In a 2013 study, 400 mg of caffeine taken even 6 hours before bed cut sleep by more than an hour, and the volunteers did not notice.

Why Caffeine Lingers

Caffeine has a half-life of about 2 to 12 hours, which is the time your body needs to clear half of it. In most people about half is gone within 4 to 6 hours, so an afternoon coffee is still partly in your system at bedtime. The Sleep Foundation lists genetics, sex, age, body weight, pregnancy, some medical conditions, oral contraceptives, alcohol or cigarette use, high altitude and eating before caffeine as things that change how fast you clear it.

What the Research Found

In a 2013 study of 12 healthy sleepers, researchers gave 400 mg of caffeine 0, 3 or 6 hours before bedtime. Sleep was significantly disrupted at all three times. When the dose was taken 6 hours before bed, total sleep time measured by a home monitor fell by more than one hour. The volunteers’ sleep diaries suggested they were unaware of the disturbance, so feeling fine is not proof that your sleep was unaffected. This was a small study with one high dose, so treat it as a warning rather than a rule for every cup.

Last Cup by Bedtime

BedtimeLast caffeine (8 hours before)
9:00 PM1:00 PM
10:00 PM2:00 PM
11:00 PM3:00 PM
12:00 AM4:00 PM

These times simply apply the Sleep Foundation’s 8-hour guideline to a clock. If you are sensitive to caffeine, move your last cup earlier.

Example: What Is Left at Bedtime

Say you drink 200 mg of caffeine at 3 PM and your half-life is 5 hours (an assumption for illustration). About 100 mg is left at 8 PM and about 50 mg at 1 AM. If your half-life is closer to 8 or 9 hours, much more remains. The real range is wide, which is why the same afternoon coffee ruins one person’s night and not another’s.

Easy Ways to Cut Caffeine Later in the Day

  • Switch to decaf after lunch. Decaf still has a little, about 2 to 15 mg per 8 oz cup, according to the FDA.
  • Pick lower-caffeine drinks. The FDA lists regular brewed coffee at 113 to 247 mg per 12 oz, black tea at 71 mg and green tea at 37 mg.
  • Check energy drinks, which range from 41 to 246 mg per 12 oz.
  • Keep your daily total in mind. The FDA says 400 mg a day, about two to three 12 oz cups of coffee, is not generally associated with negative effects in most adults.

Check Your Own Numbers

Use these free tools to see how your habits add up:

Caffeine Calculator · Sleep Cycle Calculator · Sleep Debt Calculator · Nap Calculator

Sources: Sleep Foundation, How Long Does It Take Caffeine to Wear Off?; AASM, Late afternoon and early evening caffeine can disrupt sleep at night (Drake et al., J Clin Sleep Med, 2013); FDA, Spilling the Beans: How Much Caffeine Is Too Much?. This article is general information, not medical advice.

FAQ

Frequently Asked Questions

Is a 4 PM coffee bad for sleep?

It can be. In a 2013 study, 400 mg taken 6 hours before bed reduced sleep by more than an hour. A smaller cup affects people differently, so if you sleep badly, move your last cup earlier.

Does decaf coffee have caffeine?

Yes, a small amount. The FDA says decaf typically has 2 to 15 mg per 8 oz cup, far less than regular coffee.

How long does caffeine stay in your body?

Its half-life is roughly 2 to 12 hours, and for most people about half is cleared in 4 to 6 hours. Some caffeine can remain longer, depending on genetics, medications and other factors.

How much caffeine is too much?

The FDA says 400 mg a day is not generally associated with negative effects in most adults. If you are pregnant, trying to become pregnant or breastfeeding, the FDA advises talking to your health care provider about limiting caffeine.