Caffeine and Sleep: How Long Before Bed Should You Stop?

Caffeine can sharpen your focus, get you through an early start and make a demanding day feel more manageable. But the coffee that carries you through the afternoon can still be part of your night.

Understanding caffeine and sleep starts with two questions: how much are you having, and how close is it to bedtime?

If you want a practical starting point, try finishing caffeine around 8–10 hours before bed, then adjust based on your sleep. This is a starting experiment, rather than a guaranteed threshold: larger doses and greater sensitivity can call for an earlier cut-off. (1)(2)

You do not necessarily need to give up your morning coffee. You need to understand what your last one might be costing you.

Your sleep routine starts long before bedtime.

How does caffeine affect sleep?

During waking hours, adenosine signalling contributes to the growing pressure to sleep. Caffeine blocks adenosine receptors, particularly A1 and A2A receptors, reducing the sleepy signal your brain receives. (3)

Think of it as turning down the volume on tiredness. The underlying need for sleep is still there.

That distinction matters when caffeine becomes the default response to a poor night. You can feel more alert without having replaced the sleep you missed. As the effect wears off, tiredness can become noticeable again. (3)

Sleep also depends on your circadian rhythm: the internal timing system that helps coordinate when you feel awake and when your body prepares for night. Caffeine can influence this system too.

In a small controlled study of five adults, caffeine taken three hours before habitual bedtime delayed the evening melatonin rhythm by around 40 minutes compared with placebo. The dose was 2.9 mg per kilogram of body weight. This does not mean every evening coffee delays everyone's body clock by 40 minutes, but it shows that caffeine can affect sleep timing as well as alertness. (4)

How long does caffeine stay in your system?

Caffeine does not disappear when the noticeable buzz fades. Your body takes time to clear it.

The term half-life describes the time it takes to eliminate half of a substance. EFSA describes an average caffeine half-life of approximately four hours in healthy adults, with a range of two to eight hours. (5)

That variation is a reason to be cautious about any exact caffeine calculator. It can illustrate a pattern, but it cannot tell you precisely what is happening in your body.

What could be left at bedtime?

Take the example from our caffeine carousel: 200 mg at midday, using an illustrative five-hour half-life.

Time Estimated caffeine remaining
12 pm 200 mg
5 pm 100 mg
10 pm 50 mg
3 am the following day 25 mg

Illustrative estimates for one 200 mg dose at midday, assuming a five-hour half-life and no further caffeine. These are calculated values, not measurements or a prediction of an individual's sleep.

In this example, a quarter of the original dose remains at 10 pm. Have another coffee later and you add a second dose while some of the first is still being cleared.

The amount remaining also does not translate directly into a fixed amount of lost sleep. Clearance and sensitivity are different things: two people with similar caffeine exposure may respond differently. Genetic differences, hormones, smoking, liver health and other factors can affect caffeine metabolism or its effects. (6)

What does the research say about caffeine and sleep quality?

A 2023 systematic review and meta-analysis included 24 studies. Across the included research, caffeine was associated with approximately:

  • 45 minutes less total sleep.
  • Nine minutes longer to fall asleep.
  • 12 additional minutes awake after initially falling asleep.
  • 11 minutes less deep sleep. (1)

These are pooled averages across different doses, timings and study conditions. They do not mean every afternoon coffee costs exactly 45 minutes of sleep.

The point is that sleep disruption can extend beyond difficulty drifting off. For more on sleep stages, read Sleep Cycles Explained.

“But I can drink coffee and still fall asleep”

Falling asleep is only one part of the picture. Sleep duration, time awake during the night and sleep depth matter too.

A 2025 Sleep crossover trial tested 100 mg and 400 mg at four, eight and 12 hours before bed in 23 healthy men. No statistically significant sleep effects were found for 100 mg at those timings. However, 400 mg affected aspects of sleep even 12 hours before bed. Participants did not always notice the disruption. (2)

This small study cannot establish a universal safe cut-off. Dose matters, and feeling unaffected is not a complete measure of sleep quality.

How many hours before bed should you stop caffeine?

There is no single cut-off that guarantees undisturbed sleep for everyone.

The often-quoted 8.8-hour figure comes from modelling in the 2023 review for a coffee containing 107 mg of caffeine. It is a dose-specific estimate, not a universal deadline. (1)

For a manageable first step, work backwards from your usual bedtime and try an 8–10-hour caffeine-free window.

Usual bedtime Example last-caffeine window
10 pm 12–2 pm
11 pm 1–3 pm
Midnight 2–4 pm

These windows are practical starting points to test, not personalised predictions. Choose the earlier end if sleep is a priority or you suspect caffeine sensitivity.

If you are still taking a long time to fall asleep, waking frequently or feeling unrefreshed, try moving that cut-off earlier or reducing your dose.

What about pre-workout and energy drinks?

Check the milligrams, rather than relying on the number of drinks. A large serving can change the equation considerably.

An earlier controlled study found that 400 mg of caffeine disrupted sleep even when taken six hours before bed. (7) If you train in the evening, a stimulant-free option is worth considering when you want to protect the night that follows.

Ask yourself whether the boost is helping the whole training day, including the time you have set aside to recover.

Count all your caffeine, including tea

Swapping coffee for tea does not automatically remove caffeine. Black tea, green tea, matcha, cola and many energy products contain it. Some medicines contain caffeine too. (8)

Here are a few approximate reference amounts from EFSA:

Drink Example serving Approximate caffeine
Filter coffee 200 ml 90 mg
Espresso 60 ml 80 mg
Black tea 220 ml 50 mg
Energy drink 250 ml 80 mg
Cola 355 ml 40 mg

These are examples, not fixed values. Serving size, preparation and brand can substantially change the amount. Check product labels or the coffee shop's published information where available. (8)

“One coffee” is a habit description. Milligrams give you a better idea of the dose.

Also, a daily intake considered acceptable for general health is not a promise of unaffected sleep. EFSA notes that even 100 mg close to bedtime may alter sleep in some adults. (8)

Why does caffeine affect some people more than others?

Your colleague's ability to drink an espresso after dinner does not tell you what will work for you.

Caffeine is mainly metabolised in the liver, with the enzyme CYP1A2 playing a major role. Differences in metabolism and in the response to adenosine receptor blockade help explain why people experience caffeine differently. Hormonal factors and some medicines can also alter clearance. (6)

You do not need a genetic test to start making a useful change. Start with a repeatable routine, keep a simple record and look for a pattern in your own nights.

If you take regular medication, ask a pharmacist whether it could affect caffeine's clearance or effects before assuming that your usual amount is suitable.

Try this: a 7–14-night caffeine reset

Treat this as a small personal experiment. The aim is to learn whether changing caffeine improves your nights, rather than to achieve a perfect sleep score.

1. Record your current pattern

For a few typical days, write down each caffeinated drink or product, the time you have it and its estimated caffeine content. Include supplements and any caffeine-containing medicines.

Alongside that, note your bedtime, roughly how long you take to fall asleep, noticeable awakenings and how rested you feel in the morning.

2. Choose one clear change

Start by replacing caffeine after your chosen cut-off. If you normally finish at 4 pm and go to bed at 11 pm, try moving your last caffeinated drink to 1 pm.

Keep your morning intake broadly consistent initially. Changing several things at once makes it harder to work out what helped.

3. Make the replacement easy

Keep a drink you enjoy ready for the afternoon. A caffeine-free herbal infusion or hot water with lemon can preserve the break without adding another stimulant. Check blends for tea leaves, mate or guarana.

Decaf can be a useful lower-caffeine step, although it is not necessarily completely caffeine-free. If you are very sensitive, choose a drink explicitly labelled caffeine-free. (9)

4. Taper if you are cutting back substantially

Abruptly reducing regular caffeine intake can cause headaches, tiredness, irritability and difficulty concentrating. Withdrawal commonly starts within 12–24 hours and can last several days. (10)

If you drink a lot of caffeine, gradually replace servings or reduce their strength rather than making a large overnight change. Allow any withdrawal effects to settle before judging your daytime energy.

5. Compare a run of nights

Once you have settled into the change, follow it for 7–14 nights. Keep sleep and wake times reasonably consistent, and note unusual stress, alcohol or late training that might explain a difficult night.

Compare your typical experience before and after: easier sleep onset, fewer noticeable awakenings and better morning energy are useful signals. A wearable can provide additional context, but one night's stage estimates should not decide whether the experiment worked.

This is a practical way to learn about your habits, not a controlled clinical trial. If there is no improvement, caffeine may be only a small part of the picture.

Build a routine that works across the whole day

An evening ritual makes more sense when your daytime habits give it room to work. Start with caffeine timing, then build a consistent wind-down you can repeat.

For more ideas, explore our nighttime routine guide. If you prefer a structured plan, The Science of Better Sleep brings the wider picture together, with a seven-night reset and a printable tracker.

Night Blend can be part of your HAKD evening ritual. Build that ritual alongside the habits explored here: a deliberate caffeine cut-off, time to wind down and a consistent bedtime.

Enjoy your coffee. Be deliberate about the last one. Give your night room to recover.

Caffeine and sleep: frequently asked questions

Can morning coffee affect sleep at night?

It can, particularly at higher doses or in people who clear caffeine slowly. A morning-only routine does not automatically mean caffeine has no effect on your night. Consider both your total intake and how you respond. (2)(6)

Does caffeine reduce deep sleep?

It can. The 2023 meta-analysis found less deep sleep on average, although the effect depends on the conditions studied. (1)

Is tea better than coffee before bed?

Black tea generally contains less caffeine per typical serving than coffee, but it still contributes to your intake. A caffeine-free drink is the clearer option during your cut-off window. (8)

Should everyone stop caffeine at midday?

No. Midday is a simple rule that may suit some routines. Working backwards from bedtime, considering the dose and testing how you sleep is more useful than treating one clock time as universal.

What if I still cannot sleep after reducing caffeine?

Look at the wider picture rather than continuing to bring your cut-off forward indefinitely. If sleep difficulties persist or affect daily life, speak to your GP. Loud snoring, breathing pauses or marked daytime sleepiness also deserve assessment. (11)(12)

References:

0 comments

Leave a comment

Please note, comments need to be approved before they are published.