Free tool
Caffeine cutoff calculator
Caffeine lingers far longer than its lift. Enter when you want to be asleep and this tool shows the latest sensible time for your last cup.
Medically reviewed by Shariq Refai, MD, MBA, FAPA, board certified psychiatrist · Last reviewed June 17, 2026 · Editorial policy

The science
Why caffeine wrecks sleep hours later
Caffeine works by blocking adenosine, the molecule that builds up through the day and creates the pressure to sleep. Because your liver clears caffeine slowly, with a half-life around five to six hours, a 3 p.m. coffee can still have a quarter of its dose circulating near midnight. That residual caffeine keeps blocking the sleep signal even when you feel tired enough to drop off.
The effect isn't always obvious. Even when caffeine doesn't stop you falling asleep, studies find it reduces deep, slow-wave sleep and fragments the night, so you wake less restored without knowing why. Cutting it off well before bed removes that hidden tax.
Using it well
How to pick your cutoff
If you're caffeine-sensitive, sleep lightly, or are working on a sleep problem, lean toward the earlier cutoff. If you sleep soundly regardless, the later time may be enough. The recommended middle option, around eight hours before bed, suits most adults.
Sensitivity varies a lot between people, shaped by genetics, tolerance, pregnancy, and other medications. Treat the times as a starting point and adjust based on how you actually sleep over a week or two.
Beyond coffee
What counts, and what else helps
The calculator applies to total caffeine: coffee, espresso, black and green tea, energy drinks, many sodas, pre-workout, and even dark chocolate. A late espresso martini counts twice over. If you're tracking a sleep problem, it helps to notice all the sources, not just the morning cup.
Timing is one lever among several. A consistent wake time, morning light, and limiting alcohol close to bed often matter as much. Use this alongside the sleep calculator to line up both ends of the night.
Keep exploring
Keep exploring
Related conditions
Frequently asked questions
Good questions, clear answers
Is the 8-hour cutoff exact?
No. It's a practical average based on caffeine's long half-life. Sensitive people may need a wider gap; others tolerate caffeine later without obvious harm.
Does this include tea, soda, and chocolate?
Yes. Anything with caffeine counts toward your total, so the cutoff applies to all of it, not just coffee.
I fall asleep fine after coffee. Do I still need a cutoff?
Possibly. Late caffeine can lighten and fragment sleep even when it doesn't delay falling asleep, so you may wake less rested without realizing the cause.
What about decaf?
Decaf has a small amount of caffeine, usually low enough not to matter, but very sensitive people occasionally notice it. If in doubt, treat a late decaf cautiously.
Does caffeine affect anxiety too?
Yes. For some people caffeine increases anxiety, jitteriness, and a racing heart, and poor sleep can worsen mood, so the two often interact.
How is this different from the sleep calculator?
The sleep calculator finds good bedtimes or wake times by sleep cycles. This one finds the last safe time for caffeine. They're designed to be used together.
Is my data saved?
No. Everything is calculated in your browser and nothing is stored.
Related reading
shrinkMD offers board-certified telepsychiatry by secure video. See where we offer care and how care works.
Explore the Shrink Network
shrinkMD is part of a connected family of mental health resources. For more on this topic, explore:
Sources
Sources and further reading
Sleep and mood tangled together?
shrinkMD provides licensed online psychiatric care for adults, including how sleep affects mood and anxiety. Join the waiting list and we'll reach out when booking opens.
Join Our Waiting List