β˜• Caffeine & Sleep

Caffeine and Sleep:
When to Stop Drinking Coffee

How caffeine affects your sleep and body clock, why the effect lasts so long, and how to find a caffeine cut-off time that works for you.

πŸ“– 9 min read ✍️ By M Javed Iqbal πŸ”„ Updated November 2026 πŸ“š Researched from peer-reviewed sources
The Short Answer

Does Caffeine Really Affect Your Sleep?

Yes β€” even when you fall asleep easily, caffeine can make your sleep shorter, lighter and more broken.

Caffeine is the most widely used stimulant in the world, found in coffee, tea, cola, energy drinks and some chocolate. It works mainly by blocking adenosine, a chemical that builds up in the brain while you are awake and helps create the pressure to sleep. With adenosine blocked, you feel more alert β€” which is useful in the morning, but not at bedtime.

A systematic review of trials and population studies found that caffeine typically made it take longer to fall asleep, reduced total sleep time and sleep efficiency, and worsened how well people felt they slept. Deep (slow-wave) sleep was usually reduced, while light sleep and awakenings increased.[1]

A more recent meta-analysis of 24 studies put numbers on this: caffeine reduced total sleep time by about 45 minutes and sleep efficiency by 7%, added about 9 minutes to the time taken to fall asleep and about 12 minutes of time awake during the night.[2] Many people do not notice these changes, so “coffee doesn’t affect me” is not always true. You can learn how deep sleep fits into the night in Sleep Cycles Explained.

Infographic: how caffeine affects sleep. Sources: Gardiner et al., 2023, Sleep Med Rev; Drake et al., 2013, J Clin Sleep Med; Burke et al., 2015, Sci Transl Med.
🧠 Key Insight: Falling asleep after an evening coffee does not mean it had no effect. Caffeine can still take away deep sleep and add awakenings later in the night.
βˆ’45 minAverage loss of total sleep with caffeine[2]
>1 hSleep lost from caffeine 6 hours before bed[3]
~40 minBody clock delay from evening caffeine[4]
8.8 hSuggested gap between coffee and bedtime[2]
Timing

How Long Before Bed Should You Stop Caffeine?

The effect lasts much longer than the buzz. Timing matters as much as the amount.

Caffeine leaves the body slowly. Its level in your blood falls gradually over many hours, so an afternoon coffee can still be active at bedtime. You can estimate how much is left at any hour with our Caffeine Half-Life Calculator.

In a controlled study, people took 400 mg of caffeine (roughly the amount in several cups of coffee) at bedtime, 3 hours before bed or 6 hours before bed. All three disrupted sleep compared with a placebo β€” and even the dose taken 6 hours before bed reduced total sleep by more than 1 hour.[3] The researchers concluded this supports avoiding substantial caffeine for at least 6 hours before bed.

The 2023 meta-analysis went further. It estimated that a typical cup of coffee (about 107 mg) should be finished at least 8.8 hours before bedtime to avoid losing sleep, and a standard serve of pre-workout supplement (about 217 mg) at least 13.2 hours before.[2] For someone going to bed at 11 pm, that means the last coffee by around 2 pm.

If your bedtime is…Last regular coffee by about…[2]
10:00 pm1:00 pm
11:00 pm2:00 pm
12:00 am3:00 pm
1:00 am4:00 pm
πŸ’‘ Tip: Find your bedtime first with the Bedtime Calculator, then count back about 9 hours to set your coffee cut-off.
Body Clock

Caffeine and Your Circadian Rhythm

Caffeine does not just keep you awake β€” evening caffeine can also shift your internal clock later.

Your circadian rhythm decides when you naturally feel sleepy, partly through the evening rise of melatonin. In a carefully controlled 49-day study, a caffeine dose similar to a double espresso taken 3 hours before bedtime delayed the melatonin rhythm by about 40 minutes.[4] That was nearly half the delay caused by 3 hours of bright evening light.

A later body clock can make it harder to fall asleep at your usual time and harder to wake up in the morning. If you are trying to become more of a morning person, or recover from jet lag or shift work, cutting evening caffeine is an easy first step. See how to reset your circadian rhythm and our circadian rhythm guide.

Light and caffeine work together: a late coffee plus bright screens in the evening both push the clock later. A dim, caffeine-free evening helps the clock stay on time. If you use melatonin, our melatonin timing guide explains when it is usually taken.

Why People Differ

Why Some People Are More Sensitive to Caffeine

The same coffee can affect two people very differently.

  • 1

    Genes

    Most caffeine is broken down in the liver by one enzyme, CYP1A2, and common genetic differences in this enzyme make caffeine clear much faster in some people than in others.[5] Differences in the brain’s adenosine receptors also affect how sensitive sleep is to caffeine.[5]

  • 2

    Age

    The review of caffeine and sleep found that the sleep of older adults may be more sensitive to caffeine than that of younger adults.[1] A cut-off that worked at 25 may not work at 55.

  • 3

    Smoking, hormones and health

    Caffeine clearance is affected by smoking, sex and hormones, liver disease, obesity and diet.[5] Pregnancy and some hormonal contraceptives are known to slow it.

  • 4

    Medicines

    Caffeine interacts with a number of medicines.[5] If you take regular medicine and notice strong effects from caffeine, ask a doctor or pharmacist.

  • 5

    Your chronotype

    Night owls who already have a later body clock may find evening caffeine pushes their sleep even later. Find yours with the Chronotype Calculator.

πŸ’‘ Tip: Test your own sensitivity. Move your last coffee two hours earlier for a week and note how you sleep and feel in the morning.
Practical Steps

How to Enjoy Caffeine Without Losing Sleep

You don’t have to give up coffee. A few simple changes protect your sleep.

Set a daily cut-off. For most people, early afternoon is a sensible limit β€” around 8 to 9 hours before bed for a regular coffee.[2]

Count all sources. Tea, cola, energy drinks, pre-workout powders, some painkillers and dark chocolate all contain caffeine. Strong drinks need an even earlier cut-off.[2]

Wait a little in the morning if you like. Get daylight first to help set your body clock, then enjoy your coffee.

Swap the afternoon cup. Try decaf coffee, herbal tea or a short walk outside for an afternoon lift.

Don’t use caffeine to cover a sleep debt night after night. Using coffee to fight tiredness from short sleep can harm the next night’s sleep and keep the cycle going. Check your balance with the Sleep Debt Calculator and see how much sleep you need.

Pair it with good habits. A regular schedule and a cool, dark bedroom matter too β€” see our sleep hygiene checklist. If late caffeine wakes you in the night, our guide on waking up at night covers other causes.

If you have ongoing trouble sleeping even after cutting caffeine, speak to a doctor. This guide is for general education about healthy sleep. It is not a diagnosis or a treatment plan, and it does not replace advice from a qualified healthcare professional.

Common Questions

Frequently Asked Questions About Caffeine and Sleep

Research supports avoiding substantial caffeine for at least 6 hours before bed, and a 2023 meta-analysis suggested finishing a regular cup of coffee at least 8.8 hours before bedtime. For an 11 pm bedtime, that means the last coffee by about 2 pm.

Yes, for most people. Keeping caffeine to the morning and early afternoon, and limiting the total amount, lets you enjoy coffee while protecting night-time sleep.

Caffeine can reduce deep sleep and add awakenings during the night even if you fall asleep easily, so your sleep may be less refreshing than it seems.

Yes. In a controlled study, a double-espresso dose 3 hours before bed delayed the body’s melatonin rhythm by about 40 minutes.

Genes that control how fast the liver breaks down caffeine and how sensitive the brain is to it vary between people. Age, smoking, hormones, pregnancy, liver health and some medicines also play a part.

Decaf contains only a small amount of caffeine, so it is a much better choice in the afternoon and evening. Very sensitive people may still prefer to avoid it close to bedtime.

References & Further Reading

  1. Clark I, Landolt HP. (2017). Coffee, caffeine, and sleep: a systematic review of epidemiological studies and randomized controlled trials. Sleep Medicine Reviews, 31, 70–78. PubMed 26899133 Β· doi:10.1016/j.smrv.2016.01.006
  2. Gardiner C, et al. (2023). The effect of caffeine on subsequent sleep: a systematic review and meta-analysis. Sleep Medicine Reviews, 69, 101764. PubMed 36870101 Β· doi:10.1016/j.smrv.2023.101764
  3. Drake C, et al. (2013). Caffeine effects on sleep taken 0, 3, or 6 hours before going to bed. Journal of Clinical Sleep Medicine, 9(11), 1195–1200. PubMed 24235903 Β· doi:10.5664/jcsm.3170
  4. Burke TM, et al. (2015). Effects of caffeine on the human circadian clock in vivo and in vitro. Science Translational Medicine, 7(305), 305ra146. PubMed 26378246 Β· doi:10.1126/scitranslmed.aac5125
  5. Nehlig A. (2018). Interindividual differences in caffeine metabolism and factors driving caffeine consumption. Pharmacological Reviews, 70(2), 384–411. PubMed 29514871 Β· doi:10.1124/pr.117.014407
Medical disclaimer: CircadianIQ tools and articles are for general education only and are not a substitute for professional medical advice, diagnosis or treatment. Talk to a qualified doctor before changing medication (including melatonin), or if you have insomnia, sleep apnea, or excessive daytime sleepiness. Read the full disclaimer.