Caffeine Cutoff Calculator
Most people clear caffeine far more slowly than they think. With a typical 7-hour half-life, a quarter of your 9am coffee is still circulating at 11pm. This calculator works backward from your bedtime to the point where caffeine falls below 25% of peak (two half-lives), the threshold research links to protected deep sleep. Enter your bedtime and sensitivity to see your cutoff, or flip the mode to ask the reverse question: I just had coffee, when can I sleep?
Want to know how much caffeine is in you right now instead?
This page answers when to stop drinking. The Caffeine Half-Life Calculator answers the other half: log what you already drank and see the level in your system now and at bedtime.
How caffeine affects sleep
Caffeine works by blocking adenosine receptors in the brain. Adenosine is a chemical that accumulates while you're awake, gradually increasing sleep pressure, the feeling of growing tiredness across the day. Caffeine doesn't eliminate adenosine; it blocks the receptors that detect it, masking the signal. When caffeine clears, adenosine floods back in.
This mechanism explains why caffeine impairs sleep even when it doesn't prevent you from falling asleep. A 2013 study by Drake et al. at the Henry Ford Sleep Disorders and Research Center found that caffeine consumed 6 hours before bedtime reduced total sleep by more than 1 hour, measurable on objective polysomnography, even though participants reported feeling they slept normally.
Caffeine specifically suppresses slow-wave deep sleep (N3). This is the most restorative sleep stage, critical for physical repair, immune function, growth hormone release, and long-term memory consolidation. Having caffeine in your system at bedtime doesn't just make you sleep lighter; it shortchanges the sleep stage your body most needs.
Why the cutoff is two half-lives
Caffeine is eliminated from the body through a predictable exponential decay process. Its half-life, the time for blood concentration to fall by half, is approximately 5–9 hours for most adults. At 7 hours (the average), you still have 50% of peak caffeine in your system after one half-life, 25% after two, and 12.5% after three.
The cutoff used here is two half-lives before bed, the point where caffeine has dropped below 25% of peak. That target comes from the controlled trial by Drake et al. (2013): a normal dose taken even 6 hours before bed (roughly one half-life) still cut objectively measured sleep by more than an hour and suppressed deep sleep. One half-life is simply too lenient. For a typical 7-hour half-life, two half-lives means a cutoff about 14 hours before bed: with an 11pm bedtime, that keeps caffeine to the morning. Fast metabolisers get a more forgiving early-afternoon cutoff; sensitive metabolisers an earlier one.
The decay curve in the calculator shows exactly how your caffeine level drops from the cutoff point through the next 12 hours. The dashed reference line marks the 25% target. If your last coffee is already behind you, switch the calculator to its second mode ("I just had coffee") and it runs the same math forward to show your earliest well-protected sleep time.
Individual variation in caffeine metabolism
Caffeine metabolism is primarily determined by the CYP1A2 gene. Fast metabolizers (roughly 50% of the population) process caffeine with a half-life of around 5 hours and typically experience fewer sleep disruptions from afternoon coffee. Slow metabolizers have a half-life closer to 9 hours and may notice sleep disruption even from morning caffeine consumed before noon.
Several factors slow caffeine metabolism beyond genetics: oral contraceptives extend the half-life to approximately 10–12 hours; pregnancy (especially the third trimester) can extend it to 15+ hours; liver disease slows clearance significantly. Some antibiotics, particularly fluoroquinolones like ciprofloxacin, inhibit CYP1A2 and significantly slow caffeine metabolism during the course of treatment. If you are pregnant or take medication that affects caffeine clearance, a doctor or pharmacist can tell you what applies to your situation; the calculator's settings are general estimates, not medical guidance.
If you're unsure of your sensitivity, the "Normal" setting is the right starting point. Pay attention to how coffee affects your sleep quality; tracking this in the Sleep Debt Calculator over a few weeks can reveal patterns.
Common caffeine amounts by source
| Source | Serving | Caffeine |
|---|---|---|
| Brewed coffee | 8 oz | 80–100mg |
| Espresso | 1 shot | 63mg |
| Latte / cappuccino | 8 oz | 63mg |
| Black tea | 8 oz | 40–70mg |
| Green tea | 8 oz | 20–45mg |
| Energy drink | 8 oz | 80–160mg |
| Cola / soda | 12 oz | 34–46mg |
| Decaf coffee | 8 oz | 2–15mg |
Related calculators
- Caffeine Half-Life Calculator , how much caffeine is in your system right now and at bedtime
- Sleep Calculator , find your optimal bedtime based on wake time and sleep cycles
- Sleep Debt Calculator , track your weekly sleep deficit and recovery time
- Bedtime Calculator , age-adjusted bedtime recommendations based on sleep cycles
- Screen Time Cutoff Calculator , the other big evening cutoff, based on light and melatonin
Frequently asked questions
What time should I stop drinking coffee?
For most people (normal caffeine metabolism, 7-hour half-life), the cutoff is about two half-lives, roughly 14 hours, before bedtime: the point where caffeine falls below 25% of peak. If you sleep at 11pm, that means keeping caffeine to the morning. Fast metabolisers (5h half-life) get an early-afternoon cutoff; sensitive metabolisers (9h half-life) should stop even earlier. Drake et al. (2013) found caffeine taken just 6 hours before bed still cut total sleep by over an hour.
How many hours before bed should I stop drinking coffee?
Two half-lives, which is about 14 hours for an average metaboliser, 10 hours if you clear caffeine fast, and 18 hours if you clear it slowly. That is the gap needed to bring caffeine below 25% of its peak by bedtime. The popular 6-hour rule is far too lenient: Drake et al. (2013) tested exactly that gap and still measured over an hour of lost sleep. If you want to know how much caffeine is left in you at a given moment rather than when to stop, use the Caffeine Half-Life Calculator instead.
Does caffeine really affect sleep quality even if I fall asleep?
Yes. Drake et al. (2013) found that caffeine consumed 6 hours before sleep reduced total sleep time by over 1 hour, even when subjects didn't have trouble falling asleep. Caffeine specifically suppresses slow-wave deep sleep (N3), which is critical for physical recovery and immune function. You may sleep but sleep quality is compromised.
What factors affect caffeine sensitivity?
The CYP1A2 gene determines how quickly your liver metabolizes caffeine. Fast metabolizers process it in about 5 hours; slow metabolizers take 9+ hours. Pregnancy significantly slows caffeine metabolism (half-life can extend to 15 hours in third trimester). Oral contraceptives, some antibiotics (particularly ciprofloxacin), and liver function also affect metabolism. Age generally slows caffeine clearance.
Is decaf actually caffeine-free?
No. Decaf coffee typically contains 2–15mg of caffeine per 8oz cup, compared to 80–100mg for regular. For most people, this is negligible. However, if you're highly sensitive to caffeine or have anxiety disorders, even decaf in the evening may have a measurable effect. The safest option within 3 hours of bed is herbal tea.
How much caffeine is in a cup of coffee?
An 8oz brewed coffee contains approximately 80–100mg of caffeine (average: 95mg). Espresso contains about 63mg per shot (but is consumed in smaller volume). Energy drinks vary widely: 80–300mg per can. Black tea: 40–70mg. Green tea: 20–45mg. The calculator includes common sources with average values based on USDA Food Data Central data.
What is the 90-minute coffee rule?
The 90-minute coffee rule is a popular habit of waiting about 90 to 120 minutes after waking before your first caffeine, rather than drinking it immediately. The reasoning is that the wake-up hormone cortisol is already high in the first hour or so, while adenosine (the sleep-pressure signal caffeine blocks) is still low overnight, so delaying may give a steadier lift and a smaller afternoon dip. The direct evidence is limited and no study has proven one best time for everyone, so treat it as a reasonable experiment rather than a proven rule. It mainly affects daytime energy; for sleep, what matters far more is your last caffeine of the day, which is what this calculator targets.
Is 20mg of caffeine before bed bad?
20mg is a small dose, less than a quarter of a standard coffee, and for most people it sits below the roughly 40mg level at which caffeine starts to measurably delay sleep onset. So for an average adult, 20mg right before bed is unlikely to be a major problem on its own. Slow metabolisers and people who are caffeine-sensitive, anxious, or prone to insomnia can react to even small amounts, though, and 20mg still stacks on top of whatever is left over from earlier in the day. The total caffeine in your system at bedtime is what counts, not just the last sip.
How much caffeine is good for sleep?
Caffeine does not improve sleep; there is no amount that helps you sleep better, since it works by blocking the very signal that makes you drowsy. For sleep, the goal is how little is left in your system at bedtime. Research links protected deep sleep to having caffeine below about 25% of its peak by the time you go to bed, which this calculator works out from your last dose. During the day, up to 400mg total is generally considered safe for healthy adults, but that is a daytime-alertness ceiling, not a sleep benefit.
I had too much caffeine and can't sleep. What can I do?
There is no way to actively flush caffeine out; your liver clears it on its own schedule, roughly half every 5 to 9 hours. What helps is not adding to it: stop any further caffeine, and use this calculator's second mode ('I just had coffee') to estimate when your level drops enough to sleep. In the meantime, keep the room dark and cool, avoid screens and bright light, and try slow breathing or a wind-down routine while it wears off. If it comes with a racing heart, chest discomfort, or severe anxiety, treat that as a reason to seek medical advice rather than wait it out.
Created and maintained by Reede Taylor · fact-checked against the sources below · Last reviewed August 6, 2026
Educational information, not medical advice. Consult a healthcare provider for sleep disorders or before taking any supplement.