Caffeine has a half-life of roughly 4 to 6 hours, so a coffee at 4 pm can still keep half of its caffeine in your system at 9 to 10 pm. A practical, sleep-friendly rule is to stop caffeine 6 to 8 hours before bed. This guide gives you a cutoff table by bedtime, daily limits, hidden caffeine sources, and a calmer evening swap.
How many hours before bed should you stop caffeine?
The Sleep Foundation's general guidance is to stop caffeine at least 8 hours before bedtime. For an 11:00 pm bedtime, that means a cutoff around 3:00 pm. Because caffeine's half-life varies a lot between people, lighter sleepers may need an earlier cutoff, and steady sleepers can sometimes hold closer in.
For most healthy adults, the cutoff depends on your dose. A small cup (around 100 mg of caffeine) is usually fine 4 to 6 hours before bed. A larger or stacked dose (300 to 400 mg) is best stopped 8 hours before bed, and closer to 10 to 12 hours if you sleep lightly, are pregnant, or are caffeine-sensitive. If you fall asleep slowly, wake up at night, or feel tired in the morning, start on the safer side and move closer in only after a week or two of solid sleep. The table below turns this rule into a concrete cutoff time by your bedtime.
Cutoff by dose: 4, 6, 8, and 12 hours
The "right" cutoff depends on how much caffeine you actually have, not just on the hour of day. The grid below pairs typical doses with a conservative window for healthy adults. Use the longer side when sleep has been fragile, and the shorter side only after a calm week.
| Dose (approx.) | Typical example | Conservative cutoff (sensitive sleep) | Safer side (most healthy adults) | Closer-in (only if sleep stays solid) |
|---|---|---|---|---|
| 50–100 mg | 1 small cup of drip coffee, 1 cup of black tea | 8 hours before bed | 6 hours before bed | 4 hours before bed |
| 150–200 mg | 1 large coffee, 1 strong matcha, 1 espresso double | 10 hours before bed | 8 hours before bed | 6 hours before bed |
| 300–400 mg | 2 large coffees, 1 cold brew + 1 cup of tea, energy drink stack | 12 hours before bed | 10 hours before bed | 8 hours before bed |
These windows are general guidance for healthy adults. People who fall asleep slowly, wake at night, are pregnant or breastfeeding, take medication that slows caffeine breakdown, or notice a fast heartbeat from caffeine should sit on the longer side. A 2024 trial published in SLEEP (Oxford Academic) reported that 400 mg taken about 8.8 hours before bed already cut total sleep, while smaller doses interfered when taken closer to bedtime — which is why dose and timing should be read together, not separately.
Last-coffee time by bedtime
Here is the practical answer first. The table assumes a 5 to 6 hour half-life and the 6 to 8 hour rule for healthy adults. It applies to caffeine-heavy drinks like coffee, espresso, strong green tea (matcha, gyokuro), and energy drinks.
| Bedtime | Stop by (6 hours before) | Safer side (8 hours before) |
|---|---|---|
| 10:00 pm | 4:00 pm | 2:00 pm |
| 11:00 pm | 5:00 pm | 3:00 pm |
| 12:00 am | 6:00 pm | 4:00 pm |
| 1:00 am | 7:00 pm | 5:00 pm |
If your bedtime moves day to day, use the Bedtime Calculator to find tonight's bedtime from your wake time, then subtract 6 to 8 hours to set your cutoff.
People react to caffeine very differently. If you fall asleep slowly or wake up tired, start with the 8 hour rule for a week. If your sleep stays solid, you can move closer to 6 hours.
How caffeine pushes sleep away
While you are awake, your body slowly builds up a substance called adenosine. As it accumulates, it presses the brain toward sleep. Caffeine fits into the same receptors as adenosine and blocks them temporarily, so the sleep signal is harder to feel.
Caffeine does not remove sleep pressure, it only masks it. Adenosine keeps building in the background. When the caffeine wears off, the pressure can come back in a wave, and the sleep you do get can be lighter and less restorative. For background on which sleep stages get cut short, see Sleep cycles: the truth about the 90 minute rhythm.
A well-known study found that caffeine taken 6 hours before bedtime still reduced total sleep time by about 1 hour. That is one reason an afternoon coffee is an easy-to-miss cause of "I slept eight hours but I still feel tired."
Caffeine half-life and why it varies
The half-life of caffeine — the time for half of it to leave your body — averages 4 to 6 hours. So if you drink a regular cup of coffee (about 100 mg) at 3 pm, around 50 mg is still active at 8 to 9 pm.
But the half-life varies a lot between people, roughly 2 to 12 hours. Common factors include:
- Genetics (the activity of the CYP1A2 enzyme that breaks caffeine down)
- Age (metabolism tends to slow with age)
- Smoking (speeds breakdown)
- Pregnancy (slows breakdown significantly)
- Some medications and oral contraceptives (can slow breakdown)
This is why one person can sleep fine after dinner espresso, while another stays wired from a 3 pm cup. A 7-day self-test, described later, is a quick way to figure out where you sit.
How long does 100, 200, or 400 mg of caffeine last?
Because the half-life averages 4 to 6 hours, caffeine leaves in steps rather than all at once. After about one half-life (5 to 6 hours) roughly half is left; after two half-lives (about 10 to 12 hours) only about a quarter remains. The table below applies that pattern to three common doses.
| Dose taken | Right after | After ~5–6 hours (one half-life) | After ~10–12 hours (about a quarter) |
|---|---|---|---|
| 100 mg (a regular cup of coffee) | 100 mg | ~50 mg | ~25 mg |
| 200 mg (a large coffee or strong matcha) | 200 mg | ~100 mg | ~50 mg |
| 400 mg (the daily ceiling, e.g. an energy-drink stack) | 400 mg | ~200 mg | ~100 mg |
For many people, sleep is easier to protect once caffeine falls back toward 25 mg or so, which is roughly where a 100 mg cup lands after 10 to 12 hours. Treat this as a guide for an average metabolism, not a fixed figure: half-life ranges from about 2 to 12 hours, so if you are caffeine-sensitive, pregnant, over 50, or taking medication that slows the breakdown, the same dose stays active longer and an earlier finish is safer.
This is the duration view — how long a dose stays in your system. To turn it into a stop time, the cutoff-by-dose table above pairs each dose with a "stop by" hour before bed.
Sensitive groups and special situations
The general 6 to 8 hour rule fits most healthy adults. If any of the following apply to you, build the day around an 8 to 10 hour buffer instead:
- You usually fall asleep slowly
- You wake up several times at night
- Caffeine gives you a fast heartbeat or jitters
- You feel anxious easily
- You are over 50 and notice slower metabolism
For pregnancy and breastfeeding, caffeine is metabolized more slowly. The American College of Obstetricians and Gynecologists (ACOG) suggests under 200 mg per day during pregnancy, and most clinicians advise an early afternoon cutoff regardless of bedtime. Talk to your OB or pediatrician for personal targets.
For children and teenagers, sensitivity is higher and effects last longer. Energy drinks and strong coffees should not be treated as adult beverages, and routine consumption is best avoided.
If you are being treated for heart, blood pressure, anxiety, or sleep conditions, or you take prescription medication, caffeine interactions are case-by-case. Check with your prescriber rather than relying on a generic cutoff.
Caffeine amounts in common drinks and foods
The "how many hours" question matters most when there is real caffeine in the cup. The same cup of coffee versus hojicha is a very different load. The numbers below are general references.
| Drink or food | Approximate caffeine per serving |
|---|---|
| Drip coffee (8 oz / 240 ml) | 95–120 mg |
| Espresso (1 oz / 30 ml) | 60–80 mg |
| Cold brew (8 oz) | 100–200 mg |
| Matcha (1 tsp powder) | 60–80 mg |
| Green tea (8 oz) | 25–45 mg |
| Black tea (8 oz) | 40–70 mg |
| Energy drink (8 oz) | 75–150 mg |
| Energy shot (2 oz) | 200 mg |
| Cola (12 oz) | 30–50 mg |
| Dark chocolate (1.5 oz / 45 g) | 20–30 mg |
| Milk chocolate (1.5 oz / 45 g) | 5–10 mg |
For most healthy adults, the European Food Safety Authority (EFSA) and the U.S. FDA point to a general daily ceiling around 400 mg, with single doses up to 200 mg considered safe outside of close-to-exercise situations. For pregnancy, the target drops to under 200 mg per day. Four cups of drip coffee already approach 400 mg, which is useful context when you weigh a late-afternoon refill.
Hidden caffeine you may not count
Caffeine arrives in places people often forget. The checklist below covers the most common surprises.
- Dark chocolate (70%+ cacao bars can carry 30 mg or more per serving)
- Matcha lattes, matcha ice cream, matcha desserts
- Cola and some flavored sodas
- Some cold and pain medications (combined with caffeine for absorption)
- Pre-workout supplements (often 200–300 mg per scoop)
- "Caffeinated" protein bars and gum
- Flavored black teas like Earl Grey
Pay extra attention to caffeine pills, powders, energy shots, and pre-workout. They are not equivalent to a coffee. The dose is concentrated and easy to underestimate, and for slow metabolizers the effect can stretch into the night. Treat them as a separate category, not a stronger coffee.
If you avoid afternoon coffee but still sleep lightly, scan your evening snacks and the labels of any over-the-counter medication you take after lunch.
A calmer evening swap
A cutoff is easier to keep when you replace the cup with something else, instead of just removing it. Sensible evening choices include:
- Decaf coffee: usually a few mg of caffeine per cup, so the ritual stays intact
- Herbal tea (chamomile, rooibos, lemon balm): zero caffeine, and the warmth itself helps wind down
- Hojicha or barley tea: low in caffeine and easy to pair with dinner
- Plain warm water or warm water with lemon: simple and gentle on the stomach
To make this stick, anchor the new cup inside an evening routine instead of leaving it standalone. The Evening Routine Builder takes your bedtime and the time you have, and lays out a plan with a warm drink, a tidy step, and a breathing block. It runs in the browser with no login or data saved.
A good time slot for the swap is 60 to 90 minutes before bed. Avoid drinking a full cup right before lights-out, since fluid late at night can wake you up for bathroom trips. Aim to finish at least 30 minutes before bed.
What to do if you had a late coffee anyway
It happens. A 4 pm meeting, a long drive, a friend who wanted to catch up over coffee. Don't panic.
Time is the only real "reset" for caffeine. Hard exercise and large amounts of water do not flush it out, and a late workout can actually push your bedtime back by raising body temperature and alertness.
Instead, plan the rest of the day like this:
- Work backward from the cup: drink time + 6 to 8 hours is a realistic target bedtime. Pair this with the Sleep Calculator to see whether your usual wake-up time still fits. To pick the bedtime from your wake time first, Best Bedtime for Your Wake-Up Time walks through the reverse-calculation.
- Make tonight's wind-down a little gentler: dim the lights, take a warm-not-hot shower, and stretch. Body-temperature drop after a warm shower helps cue sleep.
- Reset with morning light: 10 to 20 minutes of outdoor light within 30 minutes of waking helps pull your clock back into alignment.
Knowing in advance "tonight may take longer to fall asleep" reduces the pressure of trying to force sleep, which often makes it come faster. If you are still awake after 15 to 20 minutes in bed, When You Cannot Fall Asleep covers what to actually do on those nights instead of staring at the ceiling.
A 7-day self-test
The clearest signs that caffeine is affecting your sleep are taking more than about 20 to 30 minutes to fall asleep, waking during the night, or feeling unrested after a full night, especially on days that included afternoon or evening caffeine. A short experiment beats a generic rule. Try this for one week.
- Days 1–3: keep your usual caffeine schedule
- Days 4–7: move your last caffeine 1–2 hours earlier (e.g., from 4 pm to 2 pm)
- Each night: log how long it took to fall asleep, how often you woke, and how you felt at wake-up
If days 4–7 feel clearly lighter and your mornings improve, you are likely on the more sensitive end and 8 hours fits you better. If nothing changes, the 6 hour rule is probably fine for your body.
Don't suddenly quit if you drink coffee daily
If you usually have two or more cups a day, an abrupt zero-caffeine day can trigger withdrawal headache, fatigue, and trouble concentrating, often peaking 24 to 48 hours after the last cup. Symptoms typically settle within a few days to a week. If you want to cut back, lowering by one cup at a time over a week or two is easier on your body than going cold turkey. If your coffee has stopped working and you are cutting back to restore the effect rather than for sleep, How to Reset Your Caffeine Tolerance walks through the taper and how long it takes.
FAQ
Is chocolate before bed okay?
A small piece of milk chocolate is usually fine — it carries roughly 5 to 10 mg of caffeine per serving. Dark chocolate and matcha desserts can hit 30 to 50 mg, which is enough to delay sleep onset for sensitive people. If your nights have been light, finish those by late afternoon.
Does decaf still have caffeine?
Yes, a small amount. A typical cup of decaf coffee has roughly 2 to 5 mg of caffeine. For most people that's negligible, but during pregnancy or for very caffeine-sensitive people, it is still worth limiting late-evening cups.
How much morning coffee is okay?
For healthy adults, a general ceiling is 400 mg per day, which is roughly four 8-oz cups of drip coffee. Spreading them from morning through about 2 to 3 pm — rather than stacking them in the morning — usually helps avoid the late-afternoon energy dip and the urge for another cup.
What about an evening energy drink?
A single energy drink carries roughly 75 to 150 mg of caffeine, plus sugar and other stimulants, so its sleep impact tends to be stronger than coffee. If you genuinely need it for a deadline or a long drive, plan for shorter or lighter sleep that night and rebalance the next day.
How many hours before bed should I stop, exactly?
For most adults, 6 hours is a research-backed minimum, and 8 hours is the safer side. If your sleep is fragile or you are pregnant, lean toward 8 to 10 hours and check with your clinician for a personal target.
What major sleep authorities say about caffeine timing
Caffeine guidance from major public bodies is often quoted as a single number ("8 hours before bed", "4 to 6 hour half-life", "100 mg close to bedtime"). The notes below pair each authority with what it actually states — and, just as importantly, what it does not — so you can match these statements against the dose and bedtime numbers above without overreading them.
- U.S. Food and Drug Administration (FDA) — describes caffeine's typical half-life as 4 to 6 hours and lists a daily ceiling of about 400 mg for most healthy adults. The FDA does not publish a fixed "stop X hours before bed" rule for the general public; the half-life range is what people most often cite for the cutoff math above.
- Sleep Foundation — its general guidance is to avoid caffeine at least 8 hours before bedtime. This is a conservative target written for people who want to protect sleep; healthy adults with solid sleep often manage closer to 6 hours, which is why the dose-based table above offers both sides rather than a single number.
- European Food Safety Authority (EFSA) — its 2015 Scientific Opinion notes that a single 100 mg dose of caffeine taken close to bedtime may increase the time it takes to fall asleep and shorten sleep duration in some adults. EFSA also lists a daily ceiling around 400 mg for most healthy adults and 200 mg per single dose outside of close-to-exercise situations.
- American College of Obstetricians and Gynecologists (ACOG) — suggests keeping caffeine under 200 mg per day during pregnancy and breastfeeding, with an early afternoon cutoff regardless of bedtime. ACOG does not publish hour-specific cutoffs for the general population.
These statements are general guidance, not personal prescriptions. They sit behind the cutoff and dose tables above; the tables turn the same numbers into a per-bedtime answer for healthy adults.
A note on safety
This article is general guidance, not medical advice. If trouble falling asleep or daytime sleepiness lasts more than two weeks, if caffeine triggers a fast heartbeat or strong anxiety, or if you are pregnant or breastfeeding and want a personal limit, please talk to a qualified clinician. If you take prescription medication, your pharmacist can help you check caffeine interactions.
Related tools
- Evening Routine Builder: plan a wind-down with a calmer evening drink built in
- Bedtime Calculator: work back from your wake time to set tonight's bedtime, then subtract 6 to 8 hours
- Sleep Calculator: when caffeine pushes bedtime later, check whether the morning still fits
Related reading
- Evening Routine Guide: 60, 90, and 30-Minute Templates: where the new evening drink fits inside a fuller wind-down
- 30-Minute Wind-Down Routine: a short evening plan you can drop the new evening drink into
- Best Bedtime for Your Wake-Up Time: work back from your wake time to set tonight's bedtime, then read the cutoff chart above
- How to Get Over Jet Lag: managing caffeine on the first night at a new local time
- Phone Before Bed: the other common reason "8 hours" feels lighter than it should
- Best Bedroom Temperature for Sleep: the room-environment factor that sits alongside caffeine and screens
- Cannot Fall Asleep: a calm playbook for nights when caffeine may still be in your system
Sources
- Sleep Foundation, "Caffeine and Sleep Problems" (https://www.sleepfoundation.org/nutrition/caffeine-and-sleep)
- U.S. Food and Drug Administration, "Spilling the Beans: How Much Caffeine is Too Much?" (https://www.fda.gov/consumers/consumer-updates/spilling-beans-how-much-caffeine-too-much)
- European Food Safety Authority (EFSA), "Caffeine" (https://www.efsa.europa.eu/en/topics/topic/caffeine)
- Drake C, et al. "Caffeine Effects on Sleep Taken 0, 3, or 6 Hours before Going to Bed", Journal of Clinical Sleep Medicine, 2013 (https://pmc.ncbi.nlm.nih.gov/articles/PMC3805807/)
- Gardiner C, et al. "Dose and timing effects of caffeine on subsequent sleep", SLEEP (Oxford Academic), 2024 (https://academic.oup.com/sleep/article/48/4/zsae230/7815486)
- American College of Obstetricians and Gynecologists (ACOG), "How much coffee can I drink while I'm pregnant?"
- Centers for Disease Control and Prevention (CDC), "Caffeine and Sleep"
- USDA FoodData Central — caffeine values for common drinks and foods
