By Christian KruegerFounder of Momental Sleep · Checked
Short answer: Have your last regular coffee about nine hours before bed, because caffeine stays in your blood far longer than it feels like it does. Alcohol works the other way: it helps you fall asleep, then breaks up the second half of the night. If you drink, drink less and finish earlier.
Key takeaways
- Caffeine's half-life is usually 3 to 6 hours, and it varies a lot between people. A strong afternoon coffee can still be working at bedtime.
- In a review of 24 studies, caffeine cut sleep by about 45 minutes on average. To protect sleep time, the authors put the last regular coffee at least 8.8 hours before bed.
- Alcohol helps you fall asleep faster, then breaks up the second half of the night and cuts REM sleep. Even about two drinks reduce REM.
- Dose matters more than the drink. One small drink early in the evening is a very different night from several close to bed.
- Your own limit is easier to find than to guess. Move your caffeine cutoff for a week, or try an alcohol-free week, and write down how you sleep each morning.
Caffeine and alcohol work in opposite directions, and both can cost you sleep without you noticing. Caffeine keeps you alert for longer than it feels like it should, so an afternoon coffee can still be in your blood at bedtime. Alcohol does the reverse: it makes you drowsy and helps you fall asleep, then breaks up the second half of the night.
The short version: have your last regular coffee about nine hours before bed, and if you drink, drink less and finish earlier. The longer version, with the numbers behind it, is below, along with two simple experiments to find your own limits.
Caffeine and alcohol at a glance
| Caffeine | Alcohol | |
|---|---|---|
| Falling asleep | Takes longer | Faster |
| Deep sleep | Reduced | More in the first half of the night |
| Later in the night | More waking, lighter sleep | More waking, less REM sleep |
| How much it takes | Effects grow with the dose | Effects on REM start at about two drinks |
| Rule of thumb | Last coffee about 9 hours before bed | One or two drinks, finished a few hours before bed |
How long caffeine lasts
Caffeine's half-life
Half-life is the time your body takes to clear half of a dose. For caffeine it is usually 3 to 6 hours, and caffeine levels in the blood peak 30 to 120 minutes after you drink it (Mort and Kruse). With a half-life of 5 hours, half of a 2 p.m. coffee is still in your system at 7 p.m. and about a quarter at midnight.
That range hides big differences between people. How fast you clear caffeine depends on your genes, age, sex and hormones, smoking, diet, liver health and the medications you take (Nehlig). Two people can drink the same coffee at the same time and have very different amounts left at bedtime.
How long the effects last
You feel caffeine within half an hour or so, and the obvious buzz fades after a few hours. The effect on sleep lasts longer than the buzz. Caffeine blocks adenosine, the chemical that builds up while you are awake and makes you sleepy, so even when you no longer feel wired, it can still keep your sleep lighter.
When to stop drinking coffee before bed
In one well-known study, people took 400 mg of caffeine (about two to three large mugs of coffee) at bedtime, 3 hours before, or 6 hours before. All three timings disturbed sleep compared with a placebo, and the authors concluded that even 6 hours before bed, caffeine had important effects on sleep (Drake and colleagues).
A larger review pulled together 24 studies. On average, caffeine cut sleep by 45 minutes, added 9 minutes to the time it took to fall asleep and 12 minutes of waking during the night, and reduced deep sleep. To avoid losing sleep time, the authors worked out that a regular coffee should be drunk at least 8.8 hours before bed, and a standard serving of pre-workout supplement at least 13.2 hours before (Gardiner and colleagues).
A simple rule that fits both studies:
| Your bedtime | Last regular coffee | Last strong dose (pre-workout, big energy drink) |
|---|---|---|
| 10 p.m. | 1 p.m. | 9 a.m. |
| 11 p.m. | 2 p.m. | 10 a.m. |
| Midnight | 3 p.m. | 11 a.m. |
If you are sensitive to caffeine, start earlier. If you sleep well and want to test a later cutoff, try it as an experiment (see below) rather than assuming.
How much caffeine is in your drinks
Caffeine varies a lot by brand, brew and cup size. These are the FDA's typical ranges (FDA):
| Drink | Size | Typical caffeine |
|---|---|---|
| Brewed coffee | 12 fl oz (355 ml) | 113 to 247 mg |
| Black tea | 12 fl oz | 71 mg |
| Green tea | 12 fl oz | 37 mg |
| Caffeinated soft drink, such as cola | 12 fl oz | 23 to 83 mg |
| Energy drink | 12 fl oz | 41 to 246 mg |
| Decaf coffee | 8 fl oz (240 ml) | 2 to 15 mg |
For comparison, a standard serving of pre-workout supplement in the review above contained about 218 mg, more than most coffees (Gardiner and colleagues).
Hidden caffeine
Coffee is the obvious source. The less obvious ones are the afternoon tea, the cola with dinner, chocolate desserts and decaf, which still has a little. The FDA also lists energy and protein bars, ice cream, chewing gum, dietary supplements and some over-the-counter medicines as products that can contain added caffeine (FDA). If your nights are light and you have already moved your coffee earlier, check the labels.
How much caffeine is too much?
For most healthy adults, the FDA cites 400 mg a day as an amount not generally linked to negative effects, which is about two to three 12-ounce cups of coffee. It also notes wide differences in how sensitive people are and how quickly they clear caffeine, and suggests talking to your doctor if you are pregnant, breastfeeding, or take medicines that may interact with it (FDA).
For sleep, timing matters as much as the daily total. Two coffees before noon and two after 4 p.m. add up to the same number, but not the same night.
Why caffeine affects some people more
A review of the research found that caffeine typically makes it take longer to fall asleep, shortens sleep, reduces deep sleep and makes people rate their sleep worse. It also found large individual differences, partly genetic, and that the sleep of older adults seems more sensitive to caffeine than that of younger adults (Clark and Landolt).
So "coffee doesn't affect me" can be true for you, or it can be a sign that you fall asleep fine but sleep more lightly than you would without it. A sleep journal is the easiest way to tell which.
If you had caffeine too late
It happens. A few things make the night easier:
- Don't add more. Skip the evening tea or chocolate.
- Keep your usual bedtime. Going to bed much later shifts your whole schedule.
- Wind down properly. Dim the lights and do something calm. A bedtime routine helps here.
- Keep the room cool, dark and quiet.
- Get up if you can't sleep. Lying awake and frustrated makes it worse. Read in dim light until you feel sleepy, then go back to bed.
How alcohol affects sleep
You fall asleep faster, then sleep worse
A review of the studies in healthy adults found that at all doses, alcohol shortens the time it takes to fall asleep and makes the first half of the night more solid, with more deep sleep. In the second half, sleep becomes more disturbed (Ebrahim and colleagues). That is the trade: an easier start, a worse finish. If you often wake in the early hours after a drink, see waking up at 3am.
Less REM sleep
The same review found that alcohol delays the first REM period at all doses and reduces total REM sleep at moderate and high doses (Ebrahim and colleagues). A newer review of 27 studies found a clear dose effect: REM sleep was disrupted even after a low dose of about two standard drinks, and the disruption grew with each extra drink (Gardiner and colleagues). REM sleep comes mostly later in the night (more in sleep cycles explained).
Your body doesn't fully settle
In a real-world study of more than 4,000 Finnish employees wearing heart rate monitors, nights after drinking showed less physical recovery during the first hours of sleep than nights without, and the effect grew with the dose. Even low amounts made a difference (Pietilä and colleagues).
Snoring and breathing
A review of 21 studies found that higher alcohol consumption was linked to a 25% higher risk of sleep apnea, where breathing repeatedly stops and starts during sleep (Simou and colleagues).
The sleepy effect wears off
People can quickly build up tolerance to the sedative effect of alcohol (Roehrs and Roth). A nightcap that once helped you drift off may stop working, while the disruption later in the night stays.
How long before bed to stop drinking alcohol
The research does not give one exact cutoff, and the amount matters more than the clock. A sensible rule of thumb: keep it to one or two drinks and finish a few hours before bed. The more you drink, the longer the gap you need.
How to enjoy a drink and still sleep
- Drink earlier. A drink with an early dinner leaves more time before bed than a nightcap.
- Drink less. Smaller pours, or a single drink instead of two.
- Alternate with water and switch to alcohol-free drinks for the last part of the evening.
- Keep your bedtime and wake time the same as usual. A regular sleep schedule softens the effect of one rough night.
- Don't use alcohol to fall asleep. If you need a drink to get to sleep, swap it for a caffeine-free warm drink and a calm wind-down.
Two experiments to find your limits
General rules are a starting point. The quickest way to find your own limits is to test them, one change at a time, and write down what happens. Our guide on how to keep a sleep journal covers the basics.
Experiment 1: move your caffeine cutoff
For one week, keep your usual coffee habits and note the time of your last caffeine each day. For the next week, move that last caffeine at least nine hours before bed and keep everything else the same. Compare the two weeks.
Experiment 2: an alcohol-free week
Note your usual drinking for one week, then go a week without alcohol. If a full week is not realistic, compare nights with a drink against nights without over two or three weeks.
What to write down each morning
- When you went to bed and when you got up
- Roughly how long it took to fall asleep
- How many times you remember waking
- How rested you feel, on a scale of 1 to 5
- The time and amount of your last caffeine and any alcohol
Keep the test fair
Other things change sleep too: stress, late meals, exercise, travel, illness, a noisy night or a weekend lie-in. Note anything unusual so you don't blame the coffee for a bad night that had another cause. One night proves little; look at the week as a whole.
When to talk to a doctor
Talk to a doctor if you have trouble sleeping most nights for weeks, if a partner notices loud snoring or pauses in your breathing, or if you are sleepy during the day despite enough time in bed. If you find it hard to cut down on alcohol, or feel you need a drink to sleep, a doctor can help without judgment. This article is general information, not medical advice.
In Momental
The sleep journal is the simplest way to run both experiments: write a short note each morning with your last coffee, any drinks and how you slept. Over a few weeks, insights show whether your routine is holding, and a bedtime reminder keeps your bedtime steady while you test one change at a time.
Questions
Is 4 p.m. too late for coffee?
For many people it is. If you go to bed around 11 p.m., a 4 p.m. coffee is only seven hours before bed, and in studies caffeine taken six hours before bed still disturbed sleep. If you sleep fine after an afternoon coffee, you may metabolise caffeine quickly, but it is worth testing an earlier cutoff for a week.
How long after coffee can I sleep?
You can often fall asleep, but that is not the same as sleeping well. Caffeine tends to make sleep lighter and shorter even when you drift off easily. For a regular coffee, a gap of around nine hours before bed is a safer default.
Does caffeine affect you more as you get older?
It can. A review of the research found that the sleep of older adults seems more sensitive to caffeine than the sleep of younger adults. If coffee never used to bother you but nights have got lighter, try moving your last cup earlier.
Does decaf keep you awake?
Rarely, but it is not caffeine-free. Decaf coffee typically has a few milligrams per cup, much less than regular coffee. If you are very sensitive or drink several cups in the evening, it can add up.
Does one glass of wine affect your sleep?
A single small drink has a smaller effect than several, and some people notice nothing. A review found that disruption to REM sleep starts at low doses of about two standard drinks and grows with each extra drink. One glass with an early dinner is the gentlest way to drink if sleep matters to you.
Why do I wake up in the middle of the night after drinking?
Alcohol makes the first part of the night deeper and the second part lighter and more broken. As your body clears the alcohol, sleep becomes more restless, which is why the early morning hours are often when you wake. Drinking less and finishing earlier usually helps.
When should I stop drinking alcohol before bed?
There is no exact cutoff in the research, and how much you drink matters more than the clock. As a rule of thumb, finish your last drink a few hours before bed and keep to one or two. The more you drink, the longer the gap needs to be.
Sources
- Caffeine effects on sleep taken 0, 3, or 6 hours before going to bed. Drake C, Roehrs T, Shambroom J, Roth T. Journal of Clinical Sleep Medicine, 2013, accessed November 18, 2026.
- The effect of caffeine on subsequent sleep: A systematic review and meta-analysis. Gardiner C et al. Sleep Medicine Reviews, 2023, accessed November 18, 2026.
- Coffee, caffeine, and sleep: A systematic review of epidemiological studies and randomized controlled trials. Clark I, Landolt HP. Sleep Medicine Reviews, 2017, accessed November 18, 2026.
- Timing of blood pressure measurement related to caffeine consumption. Mort JR, Kruse HR. Annals of Pharmacotherapy, 2008, accessed November 18, 2026.
- Interindividual Differences in Caffeine Metabolism and Factors Driving Caffeine Consumption. Nehlig A. Pharmacological Reviews, 2018, accessed November 18, 2026.
- Spilling the Beans: How Much Caffeine is Too Much?. U.S. Food and Drug Administration, 2024, accessed November 18, 2026.
- Alcohol and sleep I: effects on normal sleep. Ebrahim IO, Shapiro CM, Williams AJ, Fenwick PB. Alcoholism: Clinical and Experimental Research, 2013, accessed November 18, 2026.
- The effect of alcohol on subsequent sleep in healthy adults: A systematic review and meta-analysis. Gardiner C et al. Sleep Medicine Reviews, 2025, accessed November 18, 2026.
- Sleep, sleepiness, and alcohol use. Roehrs T, Roth T. Alcohol Research and Health, 2001, accessed November 18, 2026.
- Acute Effect of Alcohol Intake on Cardiovascular Autonomic Regulation During the First Hours of Sleep in a Large Real-World Sample of Finnish Employees: Observational Study. Pietilä J et al. JMIR Mental Health, 2018, accessed November 18, 2026.
- Alcohol and the risk of sleep apnoea: a systematic review and meta-analysis. Simou E, Britton J, Leonardi-Bee J. Sleep Medicine, 2018, accessed November 18, 2026.

