Guides · Energy & sleep routines
When to Stop Drinking Coffee for Better Sleep: How Long Caffeine Really Lasts
How long does caffeine last, and when should you have your last coffee? Start with a practical cut-off, check your usual drinks and try a small change to your routine.
By BioHack Optimum ·
← All guidesQuick answer: Try finishing caffeine at least eight hours before bed. For an 11 PM bedtime, that means around 3 PM. This is a starting point, not a guarantee: the dose and your sensitivity matter, and some people need an earlier cut-off. [1]
When should you have your last coffee?
Caffeine can stay in your system after the noticeable lift has faded. A late cup may therefore matter even when you no longer feel especially alert. Sleep Foundation recommends leaving at least eight hours before bedtime. [1]
Use your intended bedtime rather than a universal clock time. Someone heading to bed at 10 PM could start with a 2 PM cut-off; someone sleeping at midnight could start with 4 PM. Count tea, energy drinks and other caffeine sources too.
Below you will find a half-life illustration, examples of caffeine amounts and a practical way to compare your own evenings. You do not need to give up a morning coffee automatically to test whether an afternoon one is getting in the way.
How long does caffeine stay in your body?
The half-life is the time needed to clear half a dose. Sleep Foundation describes a typical four-to-six-hour half-life, with substantial variation between people. Genetics, pregnancy, medicines and smoking can affect clearance. Feeling less stimulated does not mean the caffeine has gone. [1]
Here is an illustration for one drink containing 100 mg, assuming a five-hour half-life and no further caffeine:
| Time | Caffeine remaining, approximately |
|---|---|
| 4 PM: drink | 100 mg |
| 9 PM | 50 mg |
| 2 AM | 25 mg |
| 7 AM | 12.5 mg |
Illustration only, not a measurement or prediction for your body. Earlier drinks also contribute to your total.
EFSA notes that around 100 mg near bedtime can affect sleep in some adults. That is why the time you finish drinking can matter alongside the total amount. [3]
You may not feel it, but your sleep can
Caffeine blocks adenosine signalling, which helps explain its alerting effect. [5] Falling asleep is only one part of rest: a person may still experience disrupted sleep without clearly connecting it to a drink earlier in the day.
A controlled study by Drake and colleagues tested 400 mg at bedtime, three hours before bed and six hours before bed. Sleep was disrupted at each timing compared with placebo. This was a substantial fixed dose, not evidence that every small afternoon coffee costs everyone an hour of sleep. [4]
A later crossover trial in 23 men compared 100 mg and 400 mg at different times. It found no significant sleep effect from 100 mg under the tested conditions, while 400 mg affected sleep even when taken earlier. The small, specific sample does not establish a safe cut-off for everyone, but it reinforces that dose matters. [6]
If you often wake tired or during the night, caffeine timing is worth reviewing alongside other factors. See Why Do You Feel Tired Even After 8 Hours of Sleep? and Why Do I Wake Up at 3 AM?.
How much caffeine is in your drinks?
Amounts vary with the product, brewing method and portion. These are approximate examples from EFSA and FDA, not fixed values for every cup. Check the label or the coffee shop's information where available. [2, 3]
| Drink or food | Serving | Approximate caffeine |
|---|---|---|
| Filter coffee | 200 ml | 90 mg |
| Espresso | 60 ml | 80 mg |
| Decaf coffee | 240 ml (8 oz) | 2–15 mg |
| Black tea | 220 ml | 50 mg |
| Cola | 355 ml | 40 mg |
| Energy drink | 250 ml | 80 mg |
| Plain chocolate | 50 g | 25 mg |
| Milk chocolate | 50 g | 10 mg |
Decaf contains a little caffeine. Green and white teas can contain it too; herbal infusions vary by ingredients. Some medicines, supplements and snack products also contain caffeine. Consider the whole day rather than counting coffee alone. [1, 2]
How much is too much, and who is more sensitive?
FDA cites 400 mg a day as an amount not generally associated with negative effects for most adults. Individual tolerance varies, and it is not a daily target. [2] EFSA identifies up to 200 mg in a single dose and 400 mg across a day as levels that do not raise safety concerns for healthy adults; its pregnancy reference is 200 mg a day from all sources. [3]
These general safety reference points are not promises of undisturbed sleep. You can be below them and still find that an earlier or smaller drink suits you better.
Get individual advice if you are pregnant, trying to conceive or breastfeeding, take regular medicines, or have symptoms or a condition that caffeine may aggravate. Ask a doctor or pharmacist rather than relying on a half-life calculator.
Racing heartbeat, jitters, anxiety, stomach upset, headaches or trouble sleeping can be signs to review intake. If reducing a regular caffeine habit, taper gradually to make withdrawal symptoms easier to manage. [2]
A simple 7-day coffee experiment
This is an informal habit experiment, not a diagnostic test. Keep it manageable and change one thing at a time.
- Days 1–2: notice. Record the amount and time of your last caffeine, bedtime, night waking and morning restfulness from 1 to 5.
- Days 3–7: move it earlier. Aim to finish caffeine eight hours before your usual bedtime. Swap a later drink for decaf, a caffeine-free infusion or water. If cutting a large daily intake, reduce gradually.
- Keep other habits steady. Try to maintain similar sleep and wake times. Note unusual stress, alcohol or illness rather than attributing every change to coffee.
- Day 7: compare. Did falling asleep, night waking or morning restfulness change? Keep a helpful adjustment, or try an earlier cut-off if needed.
No improvement over a few days does not rule caffeine out, and an improvement does not prove it was the only cause. Review stress, light and evening routines too. Our Circadian Rhythm Reset and Tired but Can't Sleep? guides explore the wider picture.
Small changes are easier to repeat when attached to a familiar cue. For more on maintaining one, read How Long Does It Take to Build a Habit?.
What to do instead of a late-afternoon coffee
An afternoon cup often answers a real need: a break, a warm drink or a dip in alertness. Try an alternative that fits the situation:
- Take a short walk, outdoors in daylight when practical.
- Have some water if you have not had much to drink.
- If hungry, choose a small, balanced snack that suits you.
- Choose decaf or a caffeine-free drink if the ritual is what you enjoy.
- Pause screen work briefly and return to one clear next task.
These are practical options, not guaranteed substitutes for sleep. If tiredness is a daily pattern, see Afternoon Slump and How to Stay Focused at Work. Persistent fatigue despite enough rest deserves attention; Why Am I Always Tired? discusses possible causes and when to seek help.
Frequently asked questions
How long does caffeine last?
The noticeable lift and the time needed to clear caffeine are different. A typical half-life is around four to six hours, with considerable individual variation. [1]
When should I stop drinking coffee before bed?
Eight hours before bedtime is a practical starting point. A larger dose or greater sensitivity may call for an earlier cut-off. [1, 6]
Will a coffee at 3 PM affect my sleep?
It depends on the caffeine amount, your sensitivity and bedtime. For an 11 PM bedtime, 3 PM leaves eight hours; that gap does not guarantee the drink will have no effect.
Is decaf caffeine-free?
No. FDA gives a typical range of 2–15 mg per 8-ounce cup. [2]
How much caffeine is too much?
400 mg a day is a general adult reference, not a target or a personal allowance. Pregnancy has a lower reference point, and medicines or health conditions may change the advice. [2, 3]
Why does coffee not keep me awake anymore?
Habitual use can make its alerting effect feel less obvious. That feeling alone cannot tell you whether sleep is unaffected. [5, 6]
See your whole energy picture
Caffeine timing is one piece of daily energy. Sleep, stress, meals, movement and evening habits can interact, so look for a manageable adjustment rather than a perfect routine.
The BioHack Optimum assessment offers reflection across seven areas of daily life. The paid Blueprint provides three priorities and a practical four-week plan, not medical diagnosis or treatment.
Answer 14 questions in about 3 minutes →This guide offers general educational wellness information. It is not medical advice, diagnosis or treatment. If you are pregnant, take regular medication or have a health condition, ask a doctor or pharmacist about caffeine.
Sources
- Sleep Foundation — How Long Does It Take for Caffeine to Wear Off? Half-life, timing and variation.
- FDA — Spilling the Beans: How Much Caffeine Is Too Much? Adult intake, decaf, symptoms and gradual reduction.
- EFSA — Caffeine Safety reference points and approximate drink and food amounts.
- Drake et al., 2013 — Caffeine effects on sleep taken 0, 3, or 6 hours before going to bed Controlled trial using 400 mg.
- NIH News in Health — Tired or Wired? Caffeine, adenosine and habitual use.
- Gardiner et al. — Dose and timing effects of caffeine on subsequent sleep: a randomized clinical crossover trial Comparison of 100 mg and 400 mg at different intervals.
Sources checked 16 November 2026. The seven-day experiment is an editorial planning suggestion, not a validated clinical test. This article has not been clinically reviewed. BioHack Optimum is not affiliated with or endorsed by the organisations cited.