What time to stop drinking coffee for better sleep
Caffeine lingers for hours after the buzz fades. A practical cutoff for your last coffee, where else caffeine hides, and how to find your own line.
If you go to bed around 11 PM, aim to finish your last coffee by about 3 PM, and earlier if caffeine tends to keep you up. A common rule of thumb among sleep specialists is to leave around eight hours between your last caffeine and bedtime. For most people with an ordinary bedtime, that puts the cutoff in the early afternoon.
The reason is that caffeine stays in your body far longer than the buzz lasts. The lift fades within a few hours, but a good share of the caffeine is still there at dinner, and some of it is still there when you turn out the light. Below: how long it lingers, what it does to sleep, where else it hides, and how to find the cutoff that suits you.
How long caffeine stays in your body
Caffeine is usually described by its half-life: the time your body takes to clear half of it. For a healthy adult this is often quoted as around five hours, but the range between people is wide. Some clear it in a few hours. Others take a good deal longer than five.
Several things change it:
- Genes. Some people's livers simply break caffeine down faster than others'.
- Pregnancy. Caffeine clears much more slowly, especially later in pregnancy. A doctor or midwife can tell you how much is sensible.
- Some medicines, including some hormonal contraceptives, can slow it down. A pharmacist can tell you whether yours do.
- Smoking tends to speed it up.
Many people also find they get more sensitive to caffeine as they get older, so a habit that was fine at 25 may not be at 45.
Run the numbers with a five hour half-life and the problem is easy to see. Finish a coffee at 4 PM and roughly half of its caffeine is still in you at 9 PM. About a quarter is still there at 2 AM.
What a late coffee does to your sleep
Through the day, a chemical called adenosine builds up in the brain. The more there is, the sleepier you feel, and it is a large part of what sleep researchers call sleep pressure. Caffeine works by blocking the receptors adenosine acts on. You don't have less adenosine. You just can't feel it as well.
That is useful at 10 AM and less useful at 11 PM. With caffeine still on board you may take longer to fall asleep. Even if you drop off easily, caffeine can make sleep lighter and shorter, with less of the deep sleep that leaves you rested. People who say coffee never affects them are often thinking only about falling asleep, not about how they feel the next morning.
One often-cited study gave people a large dose of caffeine at bedtime, three hours before bed or six hours before. All three cut into their sleep, the six hour one included. It was a big dose and a small study, but it is a fair reason to treat six hours as a minimum gap, not a target.
It also feeds itself. A lighter night means a foggier morning, the foggy morning asks for a stronger coffee, and the afternoon asks for one more.
A practical cutoff: count back from bedtime
Start from your bedtime, not from the clock. Leave about eight hours as a default. If you already know caffeine keeps you up, try ten.
| Bedtime | Last coffee (about 8 hours before) | If caffeine keeps you up (about 10 hours before) |
|---|---|---|
| 10 PM | 2 PM | Noon |
| 11 PM | 3 PM | 1 PM |
| Midnight | 4 PM | 2 PM |
If you would rather not do sums, "no coffee after 2 PM" is a decent rule for most people who go to bed between 10 and midnight.
Two details matter more than people expect. First, the time that counts is when you finish the drink. A large coffee sipped slowly through the afternoon counts from the last sip. Second, the cutoff works best when the morning gets the caffeine instead. Have your coffee early, when it does the most good, and let the afternoon run on something else.
Where else caffeine hides
Coffee is the obvious source, not the only one. If you stop coffee at 2 PM and still sleep badly, look at the rest of the afternoon.
- Tea. Black and green tea both contain caffeine. A cup usually has less than a cup of coffee, but four mugs over an afternoon add up. Matcha is made from the whole leaf and tends to be stronger than ordinary green tea.
- Herbal teas such as peppermint, chamomile and rooibos have no caffeine of their own, which makes them a good afternoon swap.
- Decaf is low in caffeine, not zero. It only matters if you drink several cups late in the day or are very sensitive.
- Cola and energy drinks. Many contain caffeine, and some energy drinks contain a lot.
- Chocolate, especially dark chocolate, has a little.
- Some pain relievers and cold remedies include caffeine. The label will say so.
On the daily total, the US Food and Drug Administration says that up to about 400 milligrams a day, roughly four or five cups of coffee, is not generally linked to harmful effects in healthy adults. That is a safety figure, not a sleep figure. You can stay well under it and still sleep badly if the last cup comes late. Cup sizes vary a lot, too: a large café coffee can hold far more than a mug made at home.
Find your own line
Because people differ so much, the cutoff that matters is the one you find by testing it on yourself. A simple way:
- Keep your usual amount, but move your last caffeine two hours earlier than it is now.
- Hold it there for a week or two. One night tells you very little, because sleep varies for all sorts of reasons.
- Each morning, write one line about how you slept and how you feel, on paper or in Notes. If you wear an Apple Watch that tracks sleep, the Sleep section of Health on iPhone gives you a rough second opinion.
- Compare with a normal week. If mornings are better, keep the new cutoff. If nothing changes, caffeine may not be the main thing keeping you up.
If you decide to cut back on the total as well, go gradually. Stopping suddenly can bring headaches and a few tired, irritable days, which is a good way to give up on the experiment.
If you sleep badly even after sorting out caffeine, feel very sleepy in the day despite enough time in bed, or notice a racing heart or jittery anxiety after coffee, talk to a doctor. Those are worth a proper look, not just a new cutoff.
Getting through the afternoon without a late cup
The 3 PM coffee is often less about caffeine and more about the afternoon dip, the drop in alertness many people feel a few hours after lunch. A few things take the edge off it without costing you the night:
- A glass of water. Being a little short on water can add to the fog, and the trip to refill it gets you up. If you wonder whether all that coffee counts toward your fluids, here is how coffee and water compare.
- Light and a short walk. Ten minutes outside in daylight is a wake-up that doesn't follow you to bed.
- A short nap, early in the afternoon, if your day allows it. Keep it brief so it doesn't cost you the night either; this post on naps covers how long and when.
- A warm drink without caffeine, if what you miss is the ritual of making something.
Notchpals doesn't know how much coffee you drink, and it has no coffee cutoff reminder; that line is yours to hold. It can help at the two ends of the problem, though. If a Water character such as Melo or Puddle is in your crew, its Afternoon water moment comes once between 2 and 5 PM, right around the time a late coffee starts calling. And if a Sleep character like Snooze is in your crew, it works from the bedtime you gave it and comes by in the hour before to start your wind down.
SnoozeBedtime's coming soon... start slowing down... I've been practicing all day...
That evening visit is a good moment to check in with yourself. If you feel wired an hour before bed, look back at when your last cup was. Move it earlier, give it two weeks, and let your mornings tell you whether it worked.
More on sleep
SleepWhy a consistent bedtime matters, weekends includedYour body clock likes routine. Why steady sleep and wake times make nights and mornings easier, what weekend drift does, and how to keep a regular bedtime.
SleepA wind-down routine for people who work at screensA simple routine for the hour before bed if you work at a screen all day: stop work, dim the screen and the room, write tomorrow's list, then go offline.
SleepCoding past 1 AM: why it feels productive, and how to stopLate-night coding can feel like your best work. Why the quiet hours tempt you, what they cost the next day, and how to stop at a good point, not at 4 AM.
