Caffeine and sleep
When should you stop drinking caffeine before bed?
On this page
Your last coffee was after lunch, so caffeine seems an unlikely reason for a bad night. But what was in the drink you took before your evening workout? A useful cutoff needs to cover everything you consume, not just the last coffee you remember.
Avoiding tea or coffee for at least six hours before bed is a useful starting point: that is the NHS advice for insomnia. For an 11pm bedtime, it means stopping by 5pm. The next question is how much caffeine you have had, including anything that did not arrive in a coffee cup.
Start with one ordinary day's drinks, supplements and medicines. Write the time beside each item, then look up the amounts you can establish.

Count the caffeine you actually have
EFSA's approximate examples give a sense of scale:
- A 60 ml espresso: around 80 mg.
- A 200 ml filter coffee: around 90 mg.
- A 220 ml black tea: around 50 mg.
- A 355 ml cola: around 40 mg.
- A 250 ml energy drink: around 80 mg.
These are reference portions, not a guarantee about a café's recipe. Preparation, product and serving size vary. A large cup is not the same portion as the 200 ml example, and a drink with additional espresso shots needs the information for that recipe.
For packaged drinks, read both the amount and its unit. A fictional bottle labelled 32 mg per 100 ml and containing 500 ml holds 160 mg altogether: 32 multiplied by five. If you drink half, that would be 80 mg. Keep the calculation attached to the actual label so an estimate does not become a remembered fact about every brand.
For supplements, check the serving size. If two scoops make a serving, a per-serving number does not describe each scoop. Conversely, taking two servings doubles the stated serving amount. Check ingredients as well as the product name: FSA guidance notes that products such as pre-workouts and those containing guarana can contribute caffeine.
The same guidance includes some medicines among caffeine sources. Ask a pharmacist if a product you use regularly contains caffeine or if you are unsure about combining products. Do not change prescribed treatment simply to make the day's total smaller.
Choose the drink or dose to change first
Consider a fictional day: coffee at breakfast, another after lunch and a caffeinated drink before an evening workout. If the final coffee was at 1pm, saying 'I already stop after lunch' would miss the later training drink. The first useful change might be checking that product and choosing a caffeine-free alternative for the evening session.
A different person might have no supplements but refill a large mug several times. Their first job is counting the refills. Someone else may have a single early coffee and persistent insomnia; endlessly moving that one drink earlier may distract from getting help with the wider problem.
Choose an adjustment you can describe: replace the late coffee, move it earlier, order a smaller serving or choose decaf. Keep the enjoyable part where possible. A break from work, a warm drink and a chat with a colleague can remain in the afternoon even if the caffeine changes.
Decaf is an option, but it does not mean zero caffeine. The FDA explains that decaffeinated coffee and tea retain some. Check the product if a clinician has advised complete avoidance. A lower-caffeine choice and a caffeine-free choice answer different needs.
Dose and timing belong in the same decision
- 1
Count the caffeine
Include the drinks and products you actually use.
- 2
Choose what to change
Consider both the dose and the time you have it.
- 3
Notice the pattern
Compare your evenings and nights after the change.
Why an afternoon dose can still matter at bedtime
Caffeine blocks adenosine receptors. Adenosine is involved in the growing pressure to sleep during wakefulness; blocking its action can make you feel more alert. This helps explain why tiredness does not ensure sleep after caffeine. The research paper discussed below describes this action.
How long caffeine remains also varies. EFSA's explanation gives an average half-life of about four hours in healthy adults, with a range of two to eight hours. Half-life means the time needed to eliminate half the amount. Pregnancy, medicines and liver health are among the factors that can change it.
Here is an illustration using a four-hour half-life, not a prediction about your body. Of a 200 mg dose, about 100 mg would remain four hours later and 50 mg eight hours later. The first four hours do not clear the entire dose. A second drink would add another dose with its own time course.
That arithmetic explains why 'I stopped hours ago' can be an incomplete answer. It cannot tell you exactly when your sleep will be unaffected. For a practical decision, record the timing and amount rather than trying to calculate a personalised clearance time from an average.
Does a smaller dose need the same cutoff?
A randomised crossover trial in Sleep analysed 23 healthy men, average age 25, who normally consumed moderate caffeine. They tested 100 mg, 400 mg or placebo at four, eight or twelve hours before bed. Their usual morning intake was maintained separately in capsules. Sleep was measured at home with partial polysomnography and diaries.
Compared with placebo, 400 mg four hours before bed reduced measured sleep by about 51 minutes. At eight hours, it added about 29 minutes awake after initially falling asleep. Even at twelve hours it reduced deep sleep by about 21 minutes. The 100 mg conditions showed no statistically significant sleep differences at the tested times.
The result supports considering dose as well as timing. It does not establish a universal four-hour clearance rule for 100 mg: the sample was small, young and male, with a single experimental dose rather than repeated drinks. People with diagnosed sleep conditions were excluded.
For someone deciding between changes, this makes a large late dose a sensible place to investigate. It also argues against treating every small drink as equivalent to the study's 400 mg capsule. Check the product and quantity before deciding how closely the result resembles your own routine.
Does staying below the daily limit protect sleep?
The FSA says up to 400 mg a day is unlikely to cause adverse effects in most adults; the pregnancy limit is 200 mg a day, counting all sources. It also notes that sensitive people and those with underlying conditions may experience effects at lower amounts. These figures are upper guidance, not a goal to reach.
A useful example is someone who has already counted 300 mg by late afternoon and wants another 100 mg before an evening class. Adding the amounts answers the total-intake question. It does not establish that the final drink suits that person's bedtime or symptoms. Nor should the trial's large capsule be read as advice to take a day's allowance at once.
If you use a concentrated supplement, the FSA advises following the labelled serving and never guessing powder measurements. Its guidance documents serious harm from errors with pure caffeine. For investigating a sleep problem, an ordinary drink swap is a much simpler choice than trying to create a precisely dosed powder experiment.
See what changes without tracking every minute
A sleep diary can hold the relevant information: approximate caffeine amount and timing, when you tried to sleep, what you remember of the night and how you felt the next day. Fill in the sleep details after waking rather than repeatedly checking the clock overnight.
Note other changes that make comparison difficult, such as travel, a child waking you or an unusually late shift. 'Less caffeine, but interrupted by the fire alarm' is more informative than labelling that night a failed experiment. Keep uncertain amounts marked as estimates.
Give the change a chance to become an ordinary routine rather than judging it from one memorable night. This is a way to organise observations, not a diagnostic test with a fixed number of days. If the problem is severe or affects safety, seek help rather than waiting to complete your record.
If you regularly consume caffeine and want to cut back substantially, the FDA recommends reducing gradually because withdrawal can be unpleasant. A staged change might begin with one usual drink rather than removing every source at once. Ask a pharmacist or clinician if symptoms are difficult or medicines complicate the change.
For shift work, write the actual intended sleep time. A 5pm cutoff calculated for an 11pm bedtime is not a rule designed around daytime sleep after a night shift. The record should describe your schedule, including the journey home, rather than force it into an office worker's timetable.
When changing caffeine is not enough
Being able to fall asleep after coffee does not tell you how long you slept or how often you woke later. Conversely, one poor night after a drink cannot establish its cause. Bring your experience and the intake record together without relying on either a single impression or a single sleep-tracker score.
Avoid building a routine in which alcohol is used to solve an evening of feeling too alert. Our alcohol and sleep guide explains the difference between feeling sleepy and the quality of the subsequent night. Changing several substances at once also makes your observations harder to interpret.
The NHS advises GP review when insomnia lasts for months, sleep-habit changes have not helped or the problem makes daily life difficult. It also says not to drive when sleepy. For persistent insomnia, CBT-I offers a structured treatment beyond changing drinks and bedtime habits.
Take one clear question to that conversation: 'Could this amount and timing be contributing, and what else needs considering?' Bring the actual products or their labels if the amounts are unclear. That gives you and the clinician something concrete to work with, while keeping the main aim in view: sleeping and functioning better.