On this page
A cup of coffee in the morning may have little obvious connection to your bedtime. An afternoon coffee, energy drink or pre-workout supplement can be more difficult to judge.
You may fall asleep normally and assume the caffeine had no effect. You may also have trouble sleeping without knowing whether caffeine, your schedule, stress or another part of the evening was responsible.
There is no single caffeine cut-off time that works for everyone. The effect depends on the amount consumed, the timing, your individual sensitivity and your usual bedtime.
This guide will help you choose a practical caffeine cut-off and test whether changing it supports your nightly sleep goal.
How late is too late for caffeine?
The short answer is that caffeine in the afternoon or evening may be too late for some people.
The CDC recommends avoiding caffeine in the afternoon or evening as part of healthy sleep habits. This is broader and more useful than a universal rule such as “never drink coffee after 2 p.m.” because people have different bedtimes and caffeine habits.
A practical starting point is to stop consuming caffeine at least six hours before your intended bedtime. However, six hours is not a guarantee that caffeine will no longer affect sleep, particularly when the dose is high or you are sensitive to it.
For example:
- If your bedtime is 10 p.m., a six-hour cut-off would be 4 p.m.
- If your bedtime is 11 p.m., the cut-off would be 5 p.m.
- If your bedtime is midnight, the cut-off would be 6 p.m.
If sleep remains difficult, move the cut-off earlier and compare the results.
Why can caffeine affect sleep hours later?
Caffeine promotes alertness by interfering with the action of adenosine, a substance involved in the build-up of sleep pressure while you are awake.
The body does not remove caffeine immediately after you finish a drink. A portion can remain active for many hours, and the rate at which it is processed varies between individuals.
This means that you may still have caffeine in your system at bedtime even if you no longer feel a strong energy boost.
Caffeine may be connected to:
- taking longer to fall asleep
- shorter total sleep duration
- more fragmented sleep
- changes in sleep stages
- feeling less refreshed after sleep
You may not always notice these effects accurately. Some studies have found differences between objectively measured sleep and how participants believed they had slept.
The amount of caffeine matters
A small cup of tea and a large high-caffeine energy drink do not provide the same dose.
A 2025 randomised crossover study examined 100 mg and 400 mg doses taken at different times before bed. In that study, the 100 mg dose did not significantly affect the measured sleep outcomes when taken four hours before bedtime. The 400 mg dose affected sleep when consumed much earlier, with disruption increasing as bedtime approached.
This does not create a rule that 100 mg is always harmless four hours before bed. The study was small and individual responses vary. It does demonstrate why both timing and dose need to be considered.
A six-hour cut-off may be a reasonable experiment for a moderate amount of caffeine. A large dose may require a much earlier cut-off.
What contains caffeine?
Coffee is the most familiar source, but it is not the only one.
Caffeine may be found in:
- coffee and espresso drinks
- black and green tea
- energy drinks
- cola and some other soft drinks
- pre-workout products
- caffeinated water or gum
- chocolate
- some pain-relief and cold medications
The amount can vary considerably between products and serving sizes. A large café drink may contain much more caffeine than a small home-brewed drink, and energy drinks can differ widely.
Check labels where caffeine information is available. Remember to count the total amount consumed, not only the final drink of the day.
Start with your intended bedtime
A caffeine cut-off should be connected to the time you intend to sleep.
First establish:
- when you need to wake up
- how many hours you intend to sleep
- when you therefore need to be ready for sleep
Then count backwards to choose an initial caffeine cut-off.
If you have not selected a nightly target, read How to Choose a Realistic Sleep Goal.
If your bedtime changes widely throughout the week, it may be more useful to create a steadier schedule first. See How to Build a Consistent Bedtime and Wake-Up Routine.
Use six hours as a starting experiment, not a guarantee
Research published in 2013 found that a 400 mg caffeine dose affected sleep even when taken six hours before bedtime.
A later randomised trial also found that a 400 mg dose could affect sleep when taken considerably earlier. Together, these results suggest that a large caffeine dose may require a longer gap before bed.
Rather than treating six hours as a universal safe zone, use it as an initial boundary:
- Choose your normal bedtime.
- Count backwards six hours.
- Avoid caffeine after that time for one week.
- Track your bedtime, approximate sleep duration and sleep quality.
- If necessary, move the cut-off earlier and compare another week.
If you drink a large amount at one time or know that you are sensitive to caffeine, begin with an earlier cut-off.
Notice your individual response
Two people can consume the same drink at the same time and experience different effects.
Your response may be influenced by factors including:
- how much caffeine you consume
- how regularly you consume it
- your individual sensitivity
- medications or health conditions
- pregnancy
- smoking or recently stopping smoking
Do not assume that caffeine has no effect simply because you can fall asleep after consuming it. Also avoid assuming that every difficult night is caused by caffeine.
Look for a repeated pattern across several comparable nights.
Keep a simple caffeine and sleep record
For one or two weeks, record:
- the caffeinated product
- the approximate serving size or listed caffeine amount
- the time you consumed it
- your planned bedtime
- approximately when you fell asleep
- your approximate sleep duration
- how refreshed you felt in the morning
You do not need to calculate every milligram perfectly. The aim is to identify repeated connections.
For example, you may notice that:
- sleep is more difficult after a second afternoon coffee
- a high-caffeine drink affects you differently from tea
- caffeine after a certain time is connected to later sleep
- bedtime remains difficult even when caffeine ends earlier
If you want a simple sleep-recording method, read How to Track Your Sleep Without an App or Wearable.
Move the final caffeinated drink earlier
If your usual caffeine intake continues into the evening, choose one clear change.
You could:
- move the final coffee to an earlier break
- choose a smaller serving
- replace the final drink with a caffeine-free option
- avoid high-caffeine products later in the day
- carry an alternative drink so that caffeine is not the only convenient choice
The replacement can be simple:
- water
- sparkling water
- a caffeine-free herbal drink
- decaffeinated coffee or tea
- another caffeine-free drink you already enjoy
Check the label if completely avoiding caffeine is important to you, because decaffeinated products can still contain small amounts.
Pay attention to the reason you want caffeine
An afternoon caffeinated drink may be connected to more than taste.
You might reach for it because:
- you slept too little the previous night
- you skipped a meal
- you have been sitting for a long time
- the drink is part of a work break
- you associate driving, studying or gaming with caffeine
- you need to remain alert for work
Identifying the reason helps you decide whether changing the drink is enough.
If late caffeine is repeatedly used to compensate for short sleep, a cycle can develop: caffeine supports alertness later in the day, bedtime sleep becomes more difficult and more caffeine feels necessary the following day.
The practical goal is to change one part of that cycle rather than blaming yourself for feeling tired.
What about caffeine for shift work?
People who work nights or changing shifts may use caffeine to remain alert when their work schedule conflicts with normal sleep timing.
In this situation, “avoid caffeine in the afternoon” may not be meaningful. The relevant time is the intended sleep period, not the clock time used by someone following a daytime schedule.
Count backwards from when you plan to sleep and consider both the dose and the time remaining before that sleep period.
Shift work can create significant sleep and safety challenges. If you regularly struggle to sleep or remain alert safely, discuss your schedule with a qualified healthcare professional or occupational health provider.
Do not change medication without professional guidance
Some medications contain caffeine or can affect sleep in other ways.
Do not stop or change prescribed medication because of a sleep tracker or general article. Check the label and speak with a pharmacist or healthcare professional if you have questions about timing, caffeine or possible sleep effects.
Pregnant people and anyone with a medical reason to limit caffeine should follow guidance from their own healthcare professional.
What if stopping caffeine earlier does not help?
Caffeine is only one possible reason for difficulty sleeping.
Your sleep may also be affected by:
- going to bed later than intended
- an inconsistent sleep schedule
- screen use in bed
- noise, light or room temperature
- stress or an active mind
- a health condition or sleep disorder
If your evening keeps extending beyond your planned sleep time, read How to Stop Going to Bed Later Than Planned.
If you create enough time for sleep but regularly cannot fall asleep, continue with What to Do When You Cannot Fall Asleep at Night.
Connect your caffeine cut-off to a 30 day sleep goal
The 30 Day Better Sleep Path allows you to choose a realistic nightly sleep goal and complete one circle each morning after reaching it.
You can use an earlier caffeine cut-off as one supporting action:
- Choose your nightly sleep-duration goal.
- Calculate your approximate bedtime.
- Select an initial caffeine cut-off.
- Track when you consume caffeine.
- Complete the next circle after every goal-reaching night.
The Path tracks your sleep goal rather than your caffeine intake. The caffeine record helps you investigate whether timing affects your ability to reach that goal.
For the complete sleep challenge, read How to Get 8 Hours of Sleep: 30 Day Challenge.
Find the cut-off that works for your routine
There is no single latest caffeine time that applies to everyone.
Begin by avoiding caffeine during the afternoon or evening, as recommended by the CDC. Alternatively, count backwards at least six hours from your bedtime and use that as a starting experiment.
Consider the amount as well as the time. A large dose may affect sleep much earlier than a small one.
Track your final caffeinated drink and sleep over several comparable nights. If necessary, move the cut-off earlier and observe whether the pattern changes.
You can use the 30 Day Better Sleep Path to make goal-reaching nights visible or explore more practical resources in the Sleep Better collection.
Sources
Ready to take the next step?
Better Sleep30 Day Better Sleep Path
Track every night you reach your chosen sleep goal.