How Many Hours Before Bed Should You Stop Drinking Coffee? Work Back From Your Bedtime
You often hear “no coffee within 6 hours of bedtime,” but whether 6 hours is really enough depends on how much you drink, how many cups you've had that day and your own metabolism. This guide first explains how caffeine affects sleep, then gives a chart that works back from your bedtime to the latest time for your last cup, guidelines for green tea, energy drinks and other drinks, how to think about it on days you've already had a few cups in the morning, and what to watch out for when you use caffeine for night shifts or late-night studying.
How caffeine gets in the way of sleep
While you're awake, a substance called adenosine builds up in your brain and creates sleep pressure. Caffeine works by blocking the receptors that adenosine binds to, so you feel less sleepy. That's handy for fighting daytime drowsiness, but if caffeine is still in your body at bedtime, the same mechanism interferes with sleep.
- It takes longer to fall asleep
- Deep sleep (the deep stages of non-REM sleep) decreases and sleep becomes lighter
- You're more likely to wake up during the night
- Even if you feel you slept fine, measurements show your total sleep time is shorter
In a study that compared 400 mg of caffeine taken 0, 3 and 6 hours before bed, total sleep was about an hour shorter even when it was taken 6 hours before. The larger the dose, the earlier you need to stop. Conversely, a small amount may have little effect even a few hours before bed. Rather than setting a fixed “N hours before bed,” it is more realistic to think in terms of how many mg are still in your body when you go to sleep.
If you drink at this time, how many mg are left at bedtime?
This is how much caffeine remains in your body at bedtime if you drink only one cup of drip coffee (about 90 mg in 150 ml) and go to bed at 11 p.m. The calculation includes the time it takes to be absorbed.
| When you drank it (time before bed) | 3-hour half-life | 5-hour half-life | 8-hour half-life | 10-hour half-life |
|---|---|---|---|---|
| 2:00 p.m. (9 hours before) | About 12 mg | About 27 mg | About 42 mg | About 49 mg |
| 3:00 p.m. (8 hours before) | About 15 mg | About 31 mg | About 46 mg | About 53 mg |
| 4:00 p.m. (7 hours before) | About 19 mg | About 35 mg | About 50 mg | About 56 mg |
| 5:00 p.m. (6 hours before) | About 24 mg | About 41 mg | About 55 mg | About 60 mg |
| 6:00 p.m. (5 hours before) | About 30 mg | About 47 mg | About 60 mg | About 65 mg |
| 7:00 p.m. (4 hours before) | About 38 mg | About 54 mg | About 65 mg | About 69 mg |
| 8:00 p.m. (3 hours before) | About 48 mg | About 62 mg | About 71 mg | About 74 mg |
For someone with a typical 5-hour half-life, a cup 6 hours before bed has dropped to about 41 mg, so the “6 hours before bed” rule roughly holds. But for slow metabolizers (a half-life of 8–10 hours), close to 40–50 mg remains even when they drink 9 hours before bed. If you feel that “coffee in the late afternoon keeps me up,” you may be this type.
Chart: the latest time for your last cup, worked back from bedtime
These are the latest times you can drink one cup of drip coffee (about 90 mg) and still be at 50 mg or less at bedtime, assuming no other caffeine that day.
| Bedtime | 3-hour half-life | 5-hour half-life | 8-hour half-life | 10-hour half-life |
|---|---|---|---|---|
| 10:00 p.m. | 7:12 p.m. | 5:30 p.m. | 2:58 p.m. | 1:16 p.m. |
| 11:00 p.m. | 8:12 p.m. | 6:30 p.m. | 3:58 p.m. | 2:16 p.m. |
| 12:00 a.m. | 9:12 p.m. | 7:30 p.m. | 4:58 p.m. | 3:16 p.m. |
For a typical person, the last cup should be about 4.5 hours before bed. If you set the target at 25 mg or less (for light sleepers), the last cup for an 11 p.m. bedtime moves earlier to 5:12 p.m. with a 3-hour half-life, 1:30 p.m. with 5 hours and 7:58 a.m. with 8 hours. If you metabolize caffeine slowly and also sleep lightly, “coffee in the morning only” is the realistic choice.
Green tea, black tea, energy drinks: what's the cutoff?
Using the same approach, these are the latest times a typical person (5-hour half-life) going to bed at 11 p.m. can have one serving and stay at 50 mg or less at bedtime.
| Drink (one serving) | Caffeine | Cutoff for an 11 p.m. bedtime |
|---|---|---|
| Black tea, 150 ml | About 45 mg | One cup alone won't exceed 50 mg (6:30 p.m. if your target is 25 mg) |
| Sencha or hojicha, 120 ml | About 24 mg | One cup alone won't exceed 50 mg |
| Energy drink, 250 ml | About 80 mg | 7:21 p.m. |
| Gyokuro, 60 ml | About 96 mg | 6:02 p.m. |
| Drip coffee, 150 ml | About 90 mg | 6:30 p.m. |
| Caffeine tablet, 1 tablet (100 mg) | 100 mg | 5:45 p.m. |
| Energy drink, 355 ml | About 142 mg | 3:13 p.m. |
| Two cups of drip coffee (300 ml mug) | About 180 mg | 1:30 p.m. |
Black tea and sencha come in small servings, so one cup alone stays under the guideline even in the evening. Of course, if you keep refilling from the teapot it adds up: one cup of sencha each at 2, 4 and 6 p.m. leaves about 29 mg at 11 p.m. Gyokuro has about 2.7 times as much caffeine per 100 ml as coffee, so even a small cup can equal a cup of coffee.
For a second or third cup, assume the earlier ones are still there
The chart assumes only one cup that day. If you've already had coffee in the morning, what's left of it moves your cutoff earlier. Here is a comparison for a typical person going to bed at 11 p.m. (5-hour half-life, 50 mg target).
| What you've already had today | Cutoff for one more cup of drip coffee |
|---|---|
| Nothing | 6:30 p.m. |
| One cup of drip coffee at 8:00 a.m. | 4:35 p.m. |
| One cup of drip coffee each at 8:00 a.m. and 12:30 p.m. | Skip it today (any time you drink it, you'll be over 50 mg at 11 p.m.) |
Just one cup in the morning moves your second-cup cutoff about 2 hours earlier. On a day with coffee in the morning and at lunch, even a third cup at 12:30 p.m. puts you over 50 mg at 11 p.m., so it's safer to switch to decaf or barley tea in the afternoon. For more on how caffeine accumulates, see how long caffeine stays in your system.
Using caffeine for night shifts or late-night studying
On a night shift or when cramming before an exam, you need to think about both the hours when you want caffeine to keep you awake and the hours afterward when you want to sleep. For example, if a typical person drinks a 355 ml energy drink (about 142 mg) at 9 p.m., it decreases like this.
| Time | Amount remaining (5-hour half-life) |
|---|---|
| 12:00 a.m. | About 97 mg |
| 3:00 a.m. | About 64 mg |
| 6:00 a.m. | About 42 mg |
| 9:00 a.m. | About 28 mg |
- If you sleep from 9 a.m. after a night shift, one can at 9 p.m. works out to about 28 mg when you go to bed. Adding more after 2 a.m. leaves a lot in your body when you want to sleep.
- To fight sleepiness, drink it 30 minutes to an hour before you need it to work. It takes about an hour to peak.
- Don't drink several cans at once; keep a single dose under 200 mg. Two 355 ml energy drinks in a row add up to about 284 mg.
- Even when cramming, cutting sleep impairs memory consolidation. Caffeine can only cover sleepiness; it is not a substitute for sleep.
Work out “how late can I have one more cup?” with the tool
- 1
Enter what you've drunk today
Enter every drink and time since the morning. For cans and bottles, use “Other” and match the mg on the label for accuracy.
- 2
Enter when you woke up and when you'll go to bed
If you go to bed after midnight, just enter it as is, such as “0:30,” and it is calculated as the next day.
- 3
Choose your metabolism (half-life) and target amount
If you know late-afternoon coffee keeps you awake, try a half-life of 8 hours and a target of 25 mg.
- 4
Check “If I have one more cup, by what time?”
Choose the drink you want next, and it shows the latest time that keeps the amount at bedtime under your target. If that's no longer possible, it shows “Skip it for today.”
The total for the day is shown at the same time, so check the amount itself too. How many mg a day is OK is explained in the daily caffeine limit.
FAQ
- How many hours before bed should I stop drinking coffee?
- For one cup of drip coffee (about 90 mg), a typical person (5-hour half-life) will be at 50 mg or less at bedtime if they drink it about 4.5 hours before bed. For an 11 p.m. bedtime, that's around 6:30 p.m. Slow metabolizers need about 7 hours, and on days you've already had coffee in the morning or at lunch, the cutoff moves even earlier. Think of the common “6 hours before bed” rule as a guideline with a little margin.
- Why can't I sleep after drinking coffee in the late afternoon?
- You may have a long caffeine half-life. If someone with an 8-hour half-life drinks one cup of drip coffee at 4 p.m., about 50 mg is still there at 11 p.m. What you drank in the morning also remains, so a late-afternoon cup pushes the amount at bedtime higher. Switching to decaf or barley tea in the afternoon can help.
- Is it OK to drink green tea or black tea before bed?
- One cup of sencha (about 24 mg in 120 ml) or black tea (about 45 mg in 150 ml) won't exceed the 50 mg bedtime guideline on its own. Gyokuro, however, has about 96 mg in 60 ml, about the same as coffee, so avoid it at night. If you sleep lightly or drink several cups, caffeine-free drinks such as barley tea or rooibos are a safer choice than hojicha.
- How late can I drink an energy drink and still sleep?
- For a typical person going to bed at 11 p.m., a 250 ml product (about 80 mg) should be finished by around 7:20 p.m., and a 355 ml product (about 142 mg) by around 3 p.m., to stay at 50 mg or less at bedtime. The amount varies by product, so calculate using the mg of caffeine printed on the can.
- If I can still fall asleep after caffeine, does that mean it has no effect?
- Even if you fall asleep, your sleep may be lighter or shorter. One study found that 400 mg taken 6 hours before bed cut sleep by about an hour without the participants noticing. If daytime sleepiness won't go away, try reducing how much is left in your body at night.
Tools in this article
Related articles
How Long Does Caffeine Stay in Your System? Half-Life Math and When It Drops by Half
Will the coffee you had in the late afternoon be gone by bedtime? Caffeine peaks in your body about an hour after you drink it, and then drops by half every “half-life.” This guide uses concrete numbers to explain how caffeine moves through your body, how to calculate what remains using the half-life, how long each drink takes to fall to a target level, and how several cups stack up into the night.
Read article →Breathing Techniques: How to Do 4-7-8, Box Breathing and Resonance Breathing (and Which to Choose)
A night when you can't fall asleep, the minutes before an exam or interview, a wave of irritation that won't settle. People tell you to “take a deep breath,” but how many seconds should you breathe in and out, and which technique should you use? This guide explains five common breathing techniques — 4-7-8 breathing, box breathing, resonance breathing, the physiological sigh and belly breathing — with exact timings, and compares them by breaths per minute and by the exhale-to-inhale ratio. It also covers why breathing calms you down, which technique to pick for sleep, nerves or anger, how to fix the problem when it feels uncomfortable, how to measure your resting breathing rate, and when not to do breathing exercises.
Read article →What Is the Zengin Format? How to Build Japanese Bulk and Payroll Transfer Files (120-Byte Layout)
When a company in Japan sends dozens of bank transfers at once through internet banking, the bank usually asks for a file in the Zengin format. The Zengin format is the transfer-data layout defined by the Japanese Bankers Association (Zengin-kyo): fixed-length text where every line is exactly 120 bytes, built from four record types — header, data, trailer and end. This guide covers the difference between bulk transfers (sogo furikomi), payroll and bonus transfers, every field and its byte position, the rules for writing payee names in half-width katakana and the corporate abbreviations カ) and (カ, how to convert Japan Post Bank account numbers, how to build the file from Excel or CSV, and what causes import errors — in the order people actually get stuck.
Read article →