Adult sleep · Lifestyle
Edited by · Logan Foley, CSSC· Updated

Caffeine and your sleep architecture.

Built from reviews of caffeine metabolism and of caffeine's effects on sleep, a home study of caffeine timing, and FDA figures for caffeine content.

10 min read · 2,215 wordsUpdated Next review 8 cited sources

Stop caffeine at least 6 hours before bed: in one home study, 400mg of caffeine taken six hours before bedtime still disrupted sleep. Caffeine's half-life is 3 to 7 hours in adults, so a 2pm coffee can still be partly in your system at bedtime; if you sleep badly, move your last cup earlier and compare.

If you fall asleep fine but wake up feeling like you didn't really sleep, caffeine is one possible reason. A systematic review of caffeine and sleep found it typically delays sleep, shortens it and reduces deep slow-wave sleep, with more awakenings and arousals, and that both the dose and the timing matter. A home study found that 400mg taken six hours before bed still disrupted sleep and cut total sleep time. How long caffeine lingers differs a lot from person to person, which is why one fixed cutoff time does not suit everyone.

A cup of coffee in soft morning light
Photo by Janesca on Unsplash
Hours after dose3-hour half-life5-hour half-life7-hour half-life
0h200mg200mg200mg
5habout 63mg100mgabout 122mg
10habout 20mg50mgabout 74mg
15habout 6mg25mgabout 45mg
20habout 2mgabout 12mgabout 28mg
Caffeine left from a 200mg dose at three half-lives across the 3-7 hour adult range (simple half-life arithmetic, not a measurement of you).

The half-life that catches everyone out

Caffeine has a relatively long half-life: 3 to 7 hours in adults.[3] That spread matters. At a 5-hour half-life, a 200mg coffee at 2pm leaves about 57mg in your system at 11pm; at 7 hours, about 82mg; at 3 hours, about 25mg.

The liver enzyme CYP1A2 handles about 95% of the caffeine you drink, and genetic differences in it are a main reason caffeine levels vary so much from person to person.[1]

Several things change the half-life:

  • Oral contraceptives tend to double it[3]
  • Pregnancy lengthens it by about 8 hours on average, and by as much as 16 hours[3]
  • Smoking doubles the rate at which caffeine is cleared[3]
  • Heavy drinking lengthens it[3]
  • Medications: caffeine interacts with many of them, so ask a pharmacist if you take regular medicines[1]

If any of those apply, the usual "stop after 2pm" rule may not be early enough.

Three exponential decay curves showing how a 200mg caffeine dose clears at a 3-hour, 5-hour and 7-hour half-life, the range reported for adults. Simple half-life arithmetic, not measured data.0mg50mg100mg150mg200mg0h3h6h9h12h15h18h21h24hHours after consumptionCaffeine remaining
3h half-life5h half-life7h half-life
Caffeine left from a 200mg dose at a 3, 5 and 7-hour half-life, the adult range (Temple et al., 2017). Simple half-life arithmetic, not measured data; the contraceptive pill tends to double the half-life.

“In a home study, 400mg of caffeine taken six hours before bed still disrupted sleep and cut total sleep time.”

— Drake et al., 2013

What caffeine actually does to your sleep

Caffeine's main target in the brain is the adenosine A2A receptor.[1] Differences in genes linked to adenosine and to caffeine metabolism help explain why caffeine disrupts some people's sleep more than others'.[4]

A systematic review of the studies on caffeine and sleep found that caffeine typically:[4]

  1. Made it take longer to fall asleep
  2. Shortened total sleep and lowered sleep efficiency
  3. Reduced deep slow-wave sleep, while light stage-1 sleep, time awake and arousals increased
  4. Made sleep feel worse to the sleepers themselves

The size of the effect depended on the dose and on how close to bedtime the caffeine was taken, and older adults may be more sensitive than younger ones.[4]

In a home study, 400mg of caffeine taken at bedtime, 3 hours before or 6 hours before bed all disrupted sleep compared with a placebo, and even the 6-hour dose cut total sleep time.[2]

How caffeine blocks the sleep-pressure signalTwo side-by-side schematics of an adenosine receptor on a neuron. On the left, an adenosine molecule binds the receptor and produces a sleep-pressure signal. On the right, a caffeine molecule has taken the receptor instead — adenosine cannot bind, and the signal is suppressed. The caffeine molecule is structurally similar enough to compete for the same binding site.Adenosine binds → sleep signalAdenosine receptorADO"Sleep now"Caffeine blocks → no signalAdenosine receptorCAFADO✕"Stay alert"
Caffeine's main target in the brain is the adenosine A2A receptor, which it blocks (Nehlig, 2018). Schematic, not anatomical.

“Decaf is not caffeine-free: an 8-ounce cup typically has 2 to 15mg.”

— FDA

Does tolerance protect your sleep?

The most common pushback on caffeine timing advice is "I drink coffee at 6pm and sleep fine." Some people really are less sensitive: the review found large differences between people, partly genetic.[4]

What the sources here do not show is that regular coffee drinkers stop having their sleep disrupted. Feeling fine at bedtime also does not rule out lighter sleep, because caffeine reduces deep sleep and adds awakenings as well as delaying sleep.[4]

The practical test is your own: move your last caffeine two hours earlier for a week or two and compare how you sleep and how you feel in the morning. Consumer sleep trackers estimate sleep stages inconsistently,[8] so treat a tracker's deep-sleep number as a rough guide rather than proof either way.

Sleep architecture comparison: normal night vs night with late-day caffeineTwo schematic hypnograms over an 8-hour sleep period, not measured data. The top trace shows a 5-cycle night with deep N3 sleep early and REM late. The bottom trace shows the same night drawn with late caffeine: less deep N3 sleep and more brief arousals (red dots).Normal nightWakeREMN1N2N3 (deep)With late caffeineWakeREMN1N2N3 (deep)0h1h2h3h4h5h6h7h8h
Schematic, not measured data. Caffeine typically reduces deep slow-wave sleep and increases arousals (Clark and Landolt, 2017, a systematic review); the drawing shows that pattern, not a measured amount.
Sleep Toolkit
Free · 12 printables

The complete printable sleep toolkit.

Twelve printables that pair with the SleepyHero tools — caffeine cutoff cards, sleep-debt logs, jet-lag schedules, the cycle-boundary bedtime planner, and more. Free downloads, always updated.

Get the 12 free printables →

How to find your real cutoff

The common advice is no caffeine within 6 hours of bed, and the home study backs that as a minimum: a 400mg dose taken six hours before bed still disrupted sleep.[2] Because the half-life runs 3 to 7 hours and tends to double with the pill, a later or larger dose leaves more in your system at bedtime.

The arithmetic for a 200mg coffee at 2pm and an 11pm bedtime:

  • 3-hour half-life: about 25mg left at 11pm
  • 5-hour half-life: about 57mg left at 11pm
  • 7-hour half-life: about 82mg left at 11pm

No study cited here sets a "safe" amount at bedtime, so use these numbers to compare options, not as a line. Our caffeine cutoff calculator does this arithmetic for your own bedtime and dose.

If you don't want to do the math: move your last caffeine 2 hours earlier than your current cutoff for a week or two, and note how you sleep and how you feel at the alarm.

Try it now

Calculate your personal caffeine cutoff.

Plug in your bedtime, sensitivity, and typical dose. The calculator suggests a last-cup time 6, 8 or 10 hours before bed, depending on your sensitivity, and shows how much caffeine is left at bedtime.

Inputs

Open the full tool →

Hidden caffeine you're not counting

Coffee is the obvious source. The FDA's typical figures for a 12-ounce drink:[6]

  • Regular brewed coffee: 113 to 247mg
  • Black tea: about 71mg
  • Green tea: about 37mg
  • Caffeinated soft drinks: 23 to 83mg
  • Energy drinks: 41 to 246mg
  • Decaf coffee: 2 to 15mg in an 8-ounce cup, so not caffeine-free

Chocolate counts too: bittersweet chocolate with 55% cocoa has about 124mg of caffeine per 100g, and the darker the chocolate, the more caffeine.[3] Check the label on energy drinks and supplements.

These add up. A 12-ounce black tea at 4pm (about 71mg) still leaves about 27mg at 11pm at a 5-hour half-life.

Drip coffee
8oz cup
95mg
Espresso
1oz shot
64mg
Black tea
8oz cup
47mg
Green tea
8oz cup
25mg
Matcha
8oz cup
70mg
Cola
12oz can
34mg
Red Bull
8.4oz can
80mg
Monster
16oz can
160mg
Bang energy
16oz can
300mg
Pre-workout
1 scoop
200mg
Dark choc.
1oz / 55%
35mg
Decaf
8oz cup
5mg
under 40mg40–79mg80–199mg200mg+
Typical caffeine content per serving. Drip coffee, tea, cola and decaf are scaled from the FDA's published figures and chocolate follows Temple et al. (2017); espresso, matcha, brand drinks and pre-workout are approximate, so check the label. All of these count toward your daily total.
The strategies

What actually moves the needle.

Each strategy below is rated by evidence strength, with the specific source and what it does and doesn't solve. Run them in order.

Strategy 1 of 3 · Start hereEvidence: Moderate

Set a personal cutoff time and hold it for two weeks

Pick a cutoff from your bedtime, your usual dose and what you know about your own sensitivity, then hold it for one to two weeks before judging. Judge by how you sleep and feel, not by one night or one tracker number.

Helps with
  • +If afternoon caffeine seems to delay your sleep
  • +If your sleep feels light or broken
  • +Working out how sensitive you personally are
Doesn't help
  • −Sleep apnea or other medical sleep disorders
  • −Insomnia with causes other than caffeine
  • −Stress-driven hyperarousal independent of caffeine
Time investment: None beyond the switch; give it one to two weeks before judging.
Source: Drake et al. (2013, Journal of Clinical Sleep Medicine): 400mg of caffeine taken at bedtime, 3 or 6 hours before bed all disrupted sleep compared with placebo. Clark & Landolt (2017, systematic review): both dose and timing matter.
Strategy 2 of 3 · Easy swapEvidence: Limited

Switch the afternoon cup to decaf or herbal

If your social or work routine makes you want a hot drink at 3pm, the answer is rarely 'go without': it's a swap. Decaf coffee typically has 2 to 15mg per 8-ounce cup, against 113 to 247mg in 12 ounces of regular brewed coffee. The ritual is preserved; most of the caffeine isn't.

Helps with
  • +Ritual-driven afternoon drinkers (the cup matters more than the caffeine)
  • +People who want to keep a caffeine fix earlier in the day
  • +People who know they are sensitive to caffeine
Doesn't help
  • −Heavy caffeine users who rely on the dose for alertness (start with the cutoff first)
  • −People who actually like the taste of strong coffee specifically
Time investment: Zero — same routine, different ingredients.
Source: FDA caffeine figures for decaf and regular coffee; Clark & Landolt (2017) found caffeine's effects on sleep grow with dose.
Strategy 3 of 3 · NicheEvidence: Limited

Try the caffeine nap (caffeine, then a 20-minute nap)

If you need an early-afternoon boost, take your caffeine and lie down straight away for a 20-minute nap. In a small study, this was the most effective of the conditions tested for afternoon sleepiness and performance. It was not tested for its effect on that night's sleep, so keep it early in the day.

Helps with
  • +Early-afternoon (post-lunch) sleepiness
  • +Replacing a late-afternoon coffee with an earlier dose
Doesn't help
  • −People who can't fall asleep on demand for a 20-min nap
  • −Late-afternoon slumps close to bedtime
Time investment: About 25 minutes (a few to fall asleep, 20 to nap).
Source: Hayashi, Masuda & Hori (2003, Clinical Neurophysiology): in 10 young adults, 200mg of caffeine before a 20-minute nap at 12:40 was the most effective of five conditions for sleepiness and performance; bright light after the nap was comparable except on performance.
Why this guide is different

What you get here that you don't get elsewhere.

Half-life arithmetic across the real range
This guide
Worked numbers for a 3, 5 and 7-hour half-life (the adult range), what the pill, pregnancy and smoking do to it, plus a calculator for your own bedtime and dose.
Typical alternative
One fixed cutoff time, as if everyone cleared caffeine at the same speed.
Three evidence-rated strategies
This guide
Cutoff, decaf swap, and the caffeine nap — each rated by evidence strength with the specific study, what it helps, what it doesn't help, and time investment.
Typical alternative
Generic "drink less coffee" advice with no ranking and no consideration of which strategy fits your life.
Hidden sources, by milligram
This guide
FDA figures for coffee, tea, soft drinks, energy drinks and decaf, plus chocolate by cocoa content, with a visual grid.
Typical alternative
A bullet list of "caffeine is in tea and chocolate too" with no quantification.
What the evidence does and doesn't say about tolerance
This guide
Why feeling fine at bedtime does not rule out lighter sleep, and how to test your own sensitivity instead of guessing.
Typical alternative
Either ignores tolerance entirely or accepts the "I'm fine with late coffee" rationalisation.
When to see a doctor

If you've cut caffeine entirely for 2+ weeks and still wake up groggy after 7 or more hours of sleep, the cause probably isn't caffeine. Other possible causes include sleep apnea (loud snoring, witnessed pauses, daytime sleepiness despite full nights), restless legs syndrome (uncomfortable leg sensations relieved by movement) or a thyroid disorder. A primary care visit is the right next step; a sleep study (polysomnography) is the reference test for sleep disorders such as sleep apnea.

Related tools

Related tools

People also ask

People also ask

How many hours before bed should I stop drinking caffeine?

At least 6 hours: in one home study, 400mg taken six hours before bed still disrupted sleep (Drake et al., 2013). Caffeine's half-life is 3 to 7 hours in adults and the contraceptive pill tends to double it (Temple et al., 2017), so some people need longer. The simplest test: move your cutoff 2 hours earlier for a week or two and see whether your sleep improves.

Does caffeine actually keep you awake or just make you feel awake?

Both can happen. In a systematic review, caffeine typically made it take longer to fall asleep, shortened total sleep and reduced deep slow-wave sleep, with more awakenings; the effect depended on dose and timing and differed a lot between people (Clark & Landolt, 2017).

Why do I sleep fine after coffee but feel groggy in the morning?

Falling asleep is only part of it. Caffeine also reduces deep slow-wave sleep and adds awakenings and arousals (Clark & Landolt, 2017), so a night can start normally and still be lighter. Grogginess has many causes, though; if two weeks with an earlier cutoff changes nothing, read the advice on when to see a doctor.

How long does caffeine stay in your system?

Its half-life in adults is 3 to 7 hours (Temple et al., 2017). At a 5-hour half-life, a 200mg coffee leaves 100mg after 5 hours, 50mg after 10 and 25mg after 15. The contraceptive pill tends to double the half-life, pregnancy lengthens it, and smoking speeds clearance.

Key terms

Glossary.

The technical vocabulary used in this article, in plain English.

Half-life
The time it takes for half of a substance to be cleared from the bloodstream. Caffeine's half-life is 3 to 7 hours in adults; the contraceptive pill tends to double it and pregnancy lengthens it.
CYP1A2
The liver enzyme that metabolises about 95% of caffeine. Genetic differences in it are a main reason caffeine levels vary so much between people.
Adenosine
A signalling molecule in the brain. Caffeine's main target in the brain is the adenosine A2A receptor, which it blocks.
REM sleep
Rapid eye movement sleep, the stage in which most vivid dreaming occurs. The first REM period may last only 1 to 5 minutes, and REM grows longer through the night.
Slow-wave sleep (N3)
The deepest stage of sleep, marked by slow delta waves on EEG. Most of it falls in the first third of the night, and growth hormone is released mostly during it.
Sleep inertia
The groggy, slowed state right after waking, before you are fully alert.
WASO
Wake After Sleep Onset: total minutes spent awake after first falling asleep. A standard sleep-study measure. Caffeine typically increases time awake and arousals during the night.
Polysomnography
The clinical sleep study performed at a sleep lab — measures EEG, eye movement, muscle tone, breathing, and oxygen saturation overnight. The reference standard for diagnosing sleep disorders and measuring sleep architecture changes.

From our comparison desk

Gear that helps

Picks that pair with this guide — scored independently.

Compare all →
-36%
Oura Ring 4 sleep tracker in stealth black

Oura

Oura Ring 4

$223.39 (Amazon price as of – Details)
-16%
Fitbit Charge 6 sleep + fitness tracker in graphite

Fitbit

Fitbit Charge 6

$134.99 (Amazon price as of – Details)

Affiliate disclosure: purchases via these links fund our work at no extra cost to you. Scores are independent of revenue.

FAQ

FAQ

Does decaf affect sleep?

Much less than regular coffee: decaf typically has 2 to 15mg of caffeine per 8-ounce cup, while 12 ounces of regular brewed coffee has 113 to 247mg (FDA). Caffeine's effects on sleep grow with the dose (Clark & Landolt, 2017), so decaf is the usual swap when you want the ritual without most of the caffeine. If you are very sensitive, even decaf late in the evening is worth testing.

What about caffeine in chocolate or tea?

Both count. A 12-ounce black tea has about 71mg and a green tea about 37mg (FDA). Bittersweet chocolate with 55% cocoa has about 124mg per 100g, more in darker chocolate (Temple et al., 2017). Energy drinks range from 41 to 246mg per 12 ounces (FDA), so read the label.

Why do I feel fine if I drink coffee late?

Some people really are less sensitive to caffeine, partly for genetic reasons (Clark & Landolt, 2017). Feeling fine at bedtime does not rule out lighter sleep, though: caffeine also reduces deep sleep and adds awakenings. Test it by moving your last cup earlier for a week or two.

Can I just drink less caffeine instead of cutting it earlier?

Both help, because dose and timing both matter (Clark & Landolt, 2017). The arithmetic: at a 5-hour half-life, 200mg at 7am leaves about 22mg at 11pm, roughly the same as 100mg at 1pm (25mg). An earlier cutoff plus a moderate dose gives you the least caffeine at bedtime.

How long until I see results from changing my cutoff?

Give it one to two weeks before you judge. Consumer trackers estimate sleep stages inconsistently (Chinoy et al., 2021), so judge by how you sleep and feel in the morning as well as by a tracker's deep-sleep number.

Does the caffeine nap work?

In one small study it did: in 10 young adults, 200mg of caffeine just before a 20-minute nap at 12:40 was the most effective of five conditions for afternoon sleepiness and performance (Hayashi et al., 2003). The study did not test safety or the effect on that night's sleep, so keep it early in the day. For most healthy adults, the FDA cites 400mg a day as an amount not generally associated with negative effects.

How this was written

Built from Nehlig (2018, Pharmacological Reviews) and Temple et al. (2017, Frontiers in Psychiatry) on caffeine metabolism; Clark & Landolt (2017, Sleep Medicine Reviews), a systematic review of caffeine and sleep; Drake et al. (2013, Journal of Clinical Sleep Medicine), a home study of caffeine timing; Hayashi et al. (2003) on the caffeine nap; and FDA figures for caffeine content. Worked examples use simple half-life arithmetic, not measurements of you; your own half-life can fall outside the ranges cited. We update this article annually and whenever a new study on caffeine and sleep is published.

References
  1. [1]Nehlig, A. (2018). Interindividual differences in caffeine metabolism and factors driving caffeine consumption. Pharmacological Reviews, 70(2), 384-411. (CYP1A2 metabolises 95% of caffeine; metabolism varies with genetics, age, hormones, smoking and medications; the adenosine A2A receptor is caffeine's main brain target.)
  2. [2]Drake, C., Roehrs, T., Shambroom, J., & Roth, T. (2013). Caffeine effects on sleep taken 0, 3, or 6 hours before going to bed. Journal of Clinical Sleep Medicine, 9(11), 1195-1200. (400mg of caffeine; sleep measured at home with a portable monitor.)
  3. [3]Temple, J.L., Bernard, C., Lipshultz, S.E., et al. (2017). The safety of ingested caffeine: a comprehensive review. Frontiers in Psychiatry, 8, 80. (Adult half-life 3-7 hours; oral contraceptives tend to double it; pregnancy lengthens it by 8.3 hours on average, up to 16; smoking doubles clearance; chocolate caffeine by cocoa content.)
  4. [4]Clark, I., & Landolt, H.P. (2017). Coffee, caffeine, and sleep: A systematic review of epidemiological studies and randomized controlled trials. Sleep Medicine Reviews, 31, 70-78.
  5. [5]Hayashi, M., Masuda, A., & Hori, T. (2003). The alerting effects of caffeine, bright light and face washing after a short daytime nap. Clinical Neurophysiology, 114(12), 2268-2278.
  6. [6]U.S. Food and Drug Administration. Spilling the Beans: How Much Caffeine is Too Much? (Content current as of 28 August 2024; typical caffeine in 12-ounce drinks, decaf 2-15mg per 8 ounces, 400mg a day cited for most adults.)
  7. [7]Institute of Medicine (2006). Sleep Disorders and Sleep Deprivation: An Unmet Public Health Problem. Chapter 2, Sleep Physiology. National Academies Press. (Slow-wave sleep mostly in the first third of the night; growth hormone released mostly during slow-wave sleep; first REM period 1-5 minutes.)
  8. [8]Chinoy, E.D., Cuellar, J.A., Huwa, K.E., et al. (2021). Performance of seven consumer sleep-tracking devices compared with polysomnography. Sleep, 44(5), zsaa291. (Devices detected sleep well; sleep-stage estimates were inconsistent.)
About this article
LF
Editor

Logan Foley, CSSC

Certified Sleep Science Coach (CSSC) trained through the Spencer Institute. Edits SleepyHero's adult-sleep tools, gear reviews, and articles.

Last updated:

SleepyHero independently researches every article. We do not accept payment from supplement brands, sleep tracker manufacturers, or pharmaceutical companies for editorial coverage. Affiliate links to recommended tools support the site at no cost to you.