Caffeine cutoff calculator
Find your last-coffee time
Enter your bedtime and your drink to see the latest time to have it.
Latest time for your last drink
All drinks
Why: we assume caffeine halves every 5 hours and aim for under 25 mg at bedtime. Half-life varies from person to person (roughly 3–7 hours), so adjust the slider to fit you.
Why bother?
In a small lab study, caffeine taken even 6 hours before bed reduced total sleep time by more than an hour compared with placebo (Drake et al., 2013). Caffeine amounts here are typical values from Mayo Clinic's chart; real drinks vary a lot by brand and brewing.
This is a planning aid, not medical advice. If you're pregnant, have a heart condition, or caffeine affects you strongly, ask your doctor what's right for you.
Caffeine cutoff calculator: when to have your last coffee
Caffeine is the most widely used stimulant in the world, and it is also one of the most common reasons people sleep badly. The caffeine cutoff calculator takes your bedtime and the drink you are having and works out the latest time you can finish it so that most of the caffeine has left your system when you want to sleep. It covers coffee, tea, cola and energy drinks.
Search interest in "when to stop drinking caffeine", "caffeine half life" and "how late can I drink coffee" shows how many people suspect that afternoon coffee is costing them sleep. The suspicion is usually right. Caffeine blocks adenosine, the chemical that builds sleep pressure, and it can stay active for many hours.
How the calculator works
Caffeine has a half-life of around five to six hours in healthy adults, which means that after about five or six hours half of it is still in your body. The range is wide: three hours for some people and over ten for others. The calculator uses an average half-life, the amount of caffeine in your drink, and a threshold at which most people sleep normally. It then shows a cutoff time and how much caffeine would remain at bedtime if you drank at a later time.
You can adjust for your sensitivity. If one afternoon coffee keeps you awake, choose the more sensitive setting. Pregnancy, certain medicines and some hormonal contraceptives slow the clearance of caffeine, so the real cutoff may be earlier.
How much caffeine is in common drinks?
A standard brewed coffee has roughly 80 to 120 mg of caffeine, an espresso shot about 60 to 70 mg, black tea around 40 to 60 mg, green tea around 20 to 40 mg, a can of cola about 30 to 40 mg and a typical energy drink 80 mg or much more. These are approximations and vary by brand, size and brewing. Health authorities such as the FDA suggest most healthy adults can consume up to about 400 mg of caffeine a day, but sleep can be affected well below that.
What caffeine does to your night
A well-known study found that 400 mg of caffeine taken six hours before bed cut total sleep by more than an hour. Even when people do fall asleep, caffeine can reduce deep sleep and make sleep lighter. You may not notice because you adapt, but the effect shows up as tiredness the next day, which leads to more caffeine and a cycle of poor sleep. If you track your sleep with a watch or ring, you may see lower deep sleep or a higher resting heart rate on days with late caffeine.
Practical rules for caffeine and sleep
A good rule is to stop caffeine at least eight hours before bed, earlier if you are sensitive. If you go to bed at 10:30 PM, the cutoff is therefore around 2:30 PM. Swap the afternoon cup for decaf, which still contains a small amount, or for herbal tea. Do not use caffeine to repay sleep debt; the sleep debt calculator and bedtime calculator deal with the cause. When you need a boost, a 20-minute nap from the power nap planner before 3 PM is a better tool.
Caffeine for shift workers and travellers
On night shifts, caffeine early in the shift helps alertness, while stopping several hours before the end of the shift helps you sleep when you get home. The shift work planner includes a caffeine timing suggestion. When you cross time zones, caffeine in the local morning can help you adapt, which the jet lag planner accounts for.
See the effect in your own data
A sleep tracker is useful here because it lets you test the cutoff. Keep the same bedtime for two weeks, drink your last coffee before the cutoff in the first week and late in the second, and compare sleep duration and wake-ups in your app or sleep diary. Trackers do not measure caffeine itself, but they show the trend. Our guide to the best sleep tracker covers which metrics are reliable.
Example cutoff times
For a bedtime of 10:00 PM and a standard 8-hour gap, your last coffee should be at 2:00 PM. For 11:30 PM it is 3:30 PM, and for a midnight bedtime 4:00 PM. If you are sensitive or have slept badly, move the cutoff to 10 or 12 hours before bed. The tool lets you adjust. It also shows what fraction of a drink remains at bedtime if you cross the line, which is a clearer argument than a rule of thumb.
Hidden sources of caffeine
Coffee and tea are the obvious sources, but caffeine is also found in cola, energy drinks, dark chocolate, some pre-workout supplements, certain pain relievers and decaf coffee in small amounts. Matcha and yerba mate can have as much as a cup of coffee. Check labels, especially on energy products where the amount can be large. Pre-workout powders taken in the evening are a frequent hidden reason for poor sleep.
Reducing caffeine without a headache
If you drink a lot, cut down gradually over one to two weeks to avoid withdrawal headaches. Bring the last cup forward by 30 minutes every few days, swap one cup for half-caff or tea, and keep drinking water. Morning light, a short walk and a steady wake-up time provide natural alertness. After a couple of weeks many people find they need less caffeine because their sleep improves.
Frequently asked questions
What time should I stop drinking coffee?
Stop at least 8 hours before bed. For a 10:30 PM bedtime that is about 2:30 PM. Sensitive people may need a longer gap.
Is decaf safe before bed?
Decaf contains a small amount of caffeine, usually 2 to 15 mg per cup. Most people are fine, but very sensitive people may notice it.
How long does caffeine stay in your system?
Its half-life is about 5 to 6 hours on average, so a coffee at 3 PM still leaves roughly a quarter of its caffeine at 3 AM.
Does caffeine affect sleep even if I fall asleep easily?
Yes. Caffeine can reduce deep sleep and cause lighter, more fragmented sleep even when you do not have trouble falling asleep.
Does tea have less caffeine than coffee?
Usually, yes. Black tea has about half as much per cup as brewed coffee, and green tea less. Strong or large cups can contain more.
Guides for this tool
General information only. This tool gives general sleep information and is not a substitute for medical advice. If you're worried about your sleep or your child's, talk to a doctor or pediatrician.