Caffeine: when should you have your last coffee?
Calculate a per-dose guide and your last caffeine time based on your bedtime, usual intake and sensitivity. Based on EFSA reference values and a 2023 meta-analysis on caffeine and sleep.
Short answer
To avoid cutting your sleep short, have your last coffee about 9 hours before bed, and a dose of pre-workout supplement about 13 hours before. For healthy adults, EFSA sets the upper limit at 400 mg per day and 200 mg per dose.
Calculator
Validated inputsYour settings
Your answer provides a guide to your sensitivity. A genetic test is not necessary.
Per-dose guide
--
mg • per dose
Max per day
--
mg • EFSA adult reference value
Last dose
--
last coffee before
Half-life: 5h
Complete elimination in approximately 25h
Blood caffeine levels throughout the day
Key takeaways
💡 EFSA guidelines for healthy adults: up to 200 mg in a single dose and 400 mg over the day. During pregnancy, the limit is 200 mg per day.
💡 The latest caffeine timing is based on a 2023 meta-analysis: around 9 hours before bed for a coffee, 13 hours for a dose of pre-workout supplement.
💡 Caffeine's half-life ranges from 2 to over 10 hours depending on the person. Oral contraceptives and pregnancy lengthen it; smoking shortens it.
What the tool measures
Why afternoon caffeine costs you sleep
Caffeine blocks adenosine, the molecule that builds up sleep pressure throughout the day. Its half-life averages about 5 hours, with large differences between people: from 2 hours to more than 10.
The catch is that you can fall asleep easily and still sleep less well. In a 2013 trial, 400 mg of caffeine taken 6 hours before bed still reduced sleep by more than an hour. A 2023 meta-analysis concludes that you need about 9 hours between a coffee and bedtime to avoid losing sleep time.
This calculator turns those reference points into a specific time. For more detail, read the guide to your caffeine cut-off window.
Interpreting the result
Interpret without overpromising
The calculator displays three reference points:
- Per-dose guide: 1 to 3 mg per kilo depending on your usual intake, without exceeding 200 mg. This is enough to affect alertness, not a dose to aim for.
- Daily upper limit: 400 mg for a healthy adult, 200 mg during pregnancy.
- Last dose: 9 hours before bed for up to 150 mg, 13 hours for higher doses, and 2 extra hours if afternoon caffeine affects you.
If you sleep poorly despite taking your last dose early, caffeine is probably not the only cause.
Calculation and assumptions
Methodology
- Amount per dose = weight × 1, 2 or 3 mg/kg depending on your reported usual intake, rounded to the nearest 10 mg and capped at 200 mg (EFSA reference value for a single dose).
- Last dose = bedtime − 9 h for doses of 150 mg or less, − 13 h for higher doses, based on the thresholds in the meta-analysis by Gardiner and colleagues. An extra 2 hours is added if you report that afternoon caffeine affects you.
- Curve: exponential decay with a half-life of 5 hours, or 7 hours if you are sensitive, for two simulated doses at 8 am and 10 am.
The half-life shown is an average guide, not a measurement of your metabolism.
Sources consulted
Sources
- EFSA (2015) : Scientific Opinion on the safety of caffeine
Key European guidance: up to 400 mg per day and 200 mg per dose for healthy adults, 200 mg per day during pregnancy.
- Gardiner et al. (2023) : The effect of caffeine on subsequent sleep, systematic review and meta-analysis
Meta-analysis: coffee should be consumed at least 8.8 hours before bed, and a dose of pre-workout supplement at least 13.2 hours before.
- Drake et al. (2013) : Caffeine effects on sleep taken 0, 3, or 6 hours before going to bed
Controlled trial: 400 mg of caffeine taken 6 hours before bed still significantly disrupts sleep.
Scope of validity
Limitations to know
- Actual half-life varies widely: oral contraception and pregnancy lengthen it, smoking shortens it, and some medicines alter it.
- The caffeine content of coffee varies with preparation. Energy drinks, tea, chocolate and some medicines also contain it.
- The calculation does not apply to minors, or if you have a heart rhythm disorder, significant anxiety or are receiving medical treatment: ask your doctor for advice.
Frequently asked questions
Before using the result
When should you stop drinking coffee to sleep well?
About 9 hours before bed for a regular coffee, according to a 2023 meta-analysis. For an 11 pm bedtime, that puts your last cup at around 2 pm. For a high dose, such as a pre-workout supplement, allow around 13 hours instead.
What is caffeine's half-life?
About 5 hours on average in adults, but it ranges from 2 to more than 10 hours. Oral contraception and pregnancy lengthen it, while smoking shortens it.
What is the maximum daily caffeine intake?
EFSA sets the upper limit at 400 mg per day for a healthy adult, or about 4 to 5 espressos, and 200 mg per dose. During pregnancy, the reference value is 200 mg per day.
Should you wait 90 minutes after waking before drinking coffee?
No robust study demonstrates this. The rule is based on an interpretation of the morning cortisol peak. What matters most for sleep is the timing of your last dose.
Do you need a CYP1A2 genetic test?
No. Your reaction to an afternoon coffee already gives a useful indication, and the test does not change what to do: move your last dose earlier if your sleep suffers.

