Caffeine and sleep: when should you have your last coffee?
Coffee is part of the day for many people, and there is no need to give it up. The real question is when you drink your last one. Caffeine stays in the body for hours, and if you have it late, it can show in your sleep, even if you can fall asleep.
According to EFSA’s opinion, caffeine intakes of up to 400 mg a day raise no safety concerns for healthy adults (that is roughly 4 cups of filter coffee). For a single dose, the limit is about 200 mg. During pregnancy the daily limit is 200 mg.
What does it do to sleep?
Caffeine stays in the body for hours, with an average half-life of 5–6 hours, but this varies greatly from person to person. In a smaller, controlled study, even 400 mg of caffeine taken 6 hours before bed measurably reduced sleep time.
Practical rules
- Have your last coffee at least 6 hours before bed; earlier if you are sensitive.
- Do not forget energy drinks, tea, cola and pre-workout powders: they contain caffeine too.
- If you struggle to get going in the morning, look at your sleep time first, not your coffee intake.
Training and caffeine
Many people drink coffee or a pre-workout powder before training. If you train in the evening, check how much caffeine it contains and when you take it. If you sleep badly after evening training, caffeine could be one of the suspects.
What else matters?
Caffeine is only one factor. Bedtime, screen use and your evening routine affect sleep at least as much. You will find the full picture in the sleep and muscle growth article.
This article is general information, not medical advice.
Sources
- EFSA (2015): Scientific Opinion on the safety of caffeine. EFSA Journal 13(5):4102
- Drake C et al. (2013): Caffeine effects on sleep taken 0, 3, or 6 hours before going to bed. J Clin Sleep Med 9(11):1195–1200
Updated: November 2026
Read on
Sleep and muscle growth: why the night matters
How much sleep you need, what happens to your muscles while you sleep, and what you can do to sleep better alongside training.
Sleep and recoveryScreens in the evening: does blue light matter?
What research says about using screens before bed, and what is worth changing.
BiohackingMorning light and your body clock: the cheapest biohack
Light is the strongest signal for your circadian rhythm. What we know about morning sunlight, and how to fit it into your day.
Napra: training, meals and weight in one place
Follow your goals with the Napra app: a training log that knows your machines and a meal log.