Coffee and Sleep: Until What Time Can You Drink It
Your "final cutoff," counted back from the caffeine half-life
For anyone who vaguely decides "decaf in the evening." How to judge quantitatively, from the three axes of half-life, individual differences and metabolic speed, how many hours before bed you can drink coffee and still sleep.
Contents · 7
Whether evening coffee is the cause of your poor sleep, or it is your own daily rhythm — to separate them you need to know "how long caffeine stays in your body."

Caffeine's half-life is about 5 hours
In a healthy adult, the time for caffeine to halve in the body (the half-life) averages 5 hours. Drink one cup of coffee (about 100mg) at 3pm and, by the math, 50mg remains at 8pm and 25mg is still there at 1am. The half-life is surprisingly long.
Individual differences are more than twofold
- CYP1A2 gene "fast metabolizer" type: half-life 2–3 hours (45% of people)
- The same gene "slow metabolizer" type: half-life 7–10 hours (20% of people)
- The intermediate type, the rest: 4–6 hours
- Pregnancy: half-life extended to as much as 15 hours
- Smokers: shortened to half the time
There are genetic tests to check whether you are fast or slow, but a simpler method is "drink one cup at 2pm and observe how you fall asleep that night." If fast, no problem; if slow, effects appear such as trouble falling asleep or vivid dreams.
Counting back for someone who sleeps at 11pm
In sleep science, the ideal is to keep the caffeine remaining at bedtime to 25mg or less (the line where effects on deep sleep are unlikely). For an intermediate-type person (5-hour half-life) going to bed at 11pm, the final cutoff for a 100mg coffee is 1pm. For a Starbucks tall (150mg) it is 11am; for an espresso (64mg), 3pm is the boundary.
Final-cutoff quick reference by bedtime
These are rough final cutoffs for one drip cup (about 100mg), assuming the intermediate type (5-hour half-life, a target of 25mg or less at bedtime). Slow types should move 2–3 hours earlier, fast types 1–2 hours later.
- Bed at 10pm: finish drinking by noon
- Bed at 11pm: by 1pm
- Bed at 12am: by 2pm
- Note: a Starbucks tall (150mg) is about 2 hours earlier still; a single espresso (64mg) about 2 hours later
You can also use the "coffee nap." Drink coffee in the early afternoon and take a 15–20 minute nap; as you wake the caffeine starts to kick in and you feel sharp. This is a daytime focus technique, not a before-bed one.
Decaf is not "zero"
The decaf label means 97%+ of the caffeine is removed, leaving 2–5mg per cup. If a slow-metabolizer pregnant woman drinks 3 cups, that is over 15mg. If you want to cut it out completely, switching to herbal tea or genmaicha is the sure thing.
Another reason for "evening coffee"
After-dinner coffee has an effect as a "ritual," not just "caffeine." As long as it does not reach a sleep-disrupting amount, a relaxing taste experience can raise sleep quality. Making an "evening coffee culture" by blending in decaf or herbs is a healthy option too.
FAQ
Does adding milk slow caffeine absorption?
The total caffeine does not change; sitting in the stomach only makes the peak slightly gentler. For a before-bed decision, thinking in terms of "total mg and the time" is the reliable way.
Is decaf fine at any time?
Almost no problem, but it is not "zero" (2–5mg a cup). If you are a slow type, or pregnant and drinking several cups, keep an eye on the total.
Can I sleep if I switch to green or black tea?
Tea leaves have caffeine too (about 20–30mg a cup for green, 30–50mg for black). Less than coffee, but not "caffeine-free," so before bed a caffeine-free tea or a herbal tea is the sure thing.
Why can some people drink it in the evening and still sleep?
Yes — the main cause is the individual difference in half-life. The CYP1A2 "fast" type (about 45% of people) breaks caffeine down by half in 2–3 hours, so even an evening cup leaves almost nothing by bedtime. The "slow" type (about 20%), conversely, takes 7–10 hours, so an early-afternoon cup is still working at night. That is why the same dose feels different. Try "one cup at 2pm" first and observe how you fall asleep that night to gauge your type.
Once you build a tolerance, is night coffee fine?
A "tolerance" forms for the felt sleepiness, but the effect on deep sleep is a separate matter. Regular drinkers come to feel caffeine's alerting effect less, yet studies show that even without awareness, caffeine before bed reduces deep (slow-wave) sleep. The point to watch: "able to sleep despite it" and "sleeping deeply" are not the same. See also coffee and health.
If I fall asleep but wake in the night, is caffeine to blame?
It is possible. Caffeine affects the "quality" of sleep more than falling asleep itself. Even if you drop off, the proportion of deep non-REM and REM sleep falls, making you more likely to wake in the night or to feel your sleep was shallow. Don't judge by whether you fell asleep alone; when morning recovery feels poor, it is worth reviewing the prior night's caffeine amount and timing.
Should energy drinks and cola count in the count-back too?
Yes. What matters in the count-back is not "how many coffees" but the "total mg and the last time" of caffeine you took that day. Energy drinks (80–150mg a can), cola (about 35mg per 350ml), green and black tea, chocolate, and some painkillers all contain caffeine. To protect your night's sleep, adding up every source is the reliable approach.
How soon does caffeine kick in, and how long does it last?
Generally, blood levels approach their peak about 15–45 minutes after you drink, and you begin to feel alert. The time for the effect to halve (the half-life) then averages about 5 hours. Drink at 3pm, for example, and the peak is around 3:30–4pm while half still remains around 8pm. Caffeine's hallmark is that "clearing out" takes far longer than "kicking in" — and for thinking about the effect on sleep, it is this "long tail" that matters.
The key is not to declare "no coffee at night" outright, but to count back from your own metabolic type and bedtime. Hold the 25mg-remaining line and evening coffee and good sleep can coexist, through timing.
Was this article helpful?
Choose & compare
Related links
References
More articles
The Science and History of Instant Coffee — How Was the “Just-Add-Water” Cup Born?
CultureThe Economics of Coffee — From the C-Market to the Price of a Cup: The Story of “Why This Price?”
CultureA World History of Coffee — From an Ethiopian Legend to the Cup That Moves the World
CultureA Cultural History of the Kissaten — From Ueno’s “Kahi Chakan” to the World’s “KISSATEN”