Back to top
Tools

Sleep Calculator with a Caffeine Check

A woman stretches in the morning light.
Bedtimes in 90-minute sleep cycles plus a caffeine check with EFSA half-life data: how much caffeine is still in your body at bedtime.

This sleep calculator answers two questions that belong together: when should you go to bed if you want to plan your night around full sleep cycles, and how much caffeine is still in your body when you get there? Open method, honest ranges, nothing to sign up for.

I want to ...
Wake-up time
Go to bed at
21:156 cycles (9 h of sleep, 9:15 pm)
22:455 cycles (7.5 h of sleep, 10:45 pm)
00:154 cycles (6 h of sleep, 12:15 am)
The math: cycles of 90 minutes plus 15 minutes to fall asleep. Both are rules of thumb; real cycles run 70 to 120 minutes.
Caffeine check
Drink
How many
Had it at
Planned bedtime
Half-life: 4 h (2 to 8, depends on your metabolism)
Pregnancy, the pill and some medications can push the half-life past 8 hours; the check then shows too little.
Caffeine in your body at bedtime
49 mg
The 100 mg reference: EFSA describes an ingested single dose of about 100 mg close to bedtime as an amount that disturbs sleep in some people. We hold the remaining amount against it, although no threshold has been established for what is still circulating, so a low number does not make a large dose safe for sleep. Runs in your browser; nothing is sent anywhere.

Why plan in cycles?

Sleep runs in cycles of light sleep, deep sleep and REM that together last roughly 90 to 110 minutes. Whole cycles give you a simple way to plan your wake-up window: 6 cycles is about 9 hours, 5 is 7.5, 4 is 6. Whether waking at the end of a cycle feels easier than waking from deep sleep isn't settled. Some studies have linked waking from deeper sleep to more grogginess, mostly after long naps and under high sleep pressure. Others have found no such link.

To be honest about it: the 90 minutes is a rule of thumb. No calculator knows your cycles; they vary between 70 and 120 minutes and even across a single night. Treat the suggested times as starting points, and let your mornings tell you what works.

The afternoon caffeine problem

Caffeine does not leave when the taste does. It is cleared with a half-life of about 4 hours: of two cups of brewed coffee at 3 pm, around 49 mg are still in your body at 10:30 pm. EFSA, the European food safety authority, points to roughly 100 mg taken close to bedtime as an amount that measurably disturbs sleep in some people. We compare that figure with the amount still in your body, although no one has set a threshold for that amount. For large doses, the comparison falls short. In a 2025 trial, 23 young men took caffeine as a single capsule: after 400 mg they fell asleep later and got less deep sleep even with 12 hours to go before bed, while 100 mg taken 4 hours before bed had no significant effect on sleep. With this calculator's formula and a 4-hour half-life, both doses would leave about 50 mg at bedtime.

Decay curve of 180 mg of caffeine over 12 hours at a 4-hour half-life, with EFSA's 100 mg figure for a single dose close to bedtime

How the calculation works

Sleep part: bedtime = wake-up time minus (cycles times 90 minutes, plus 15 minutes to fall asleep). The 15 minutes is a typical value; if you know you take longer, add the difference yourself.

Caffeine part: remaining = dose times 0.5 to the power of (hours divided by half-life). The average plasma half-life in adults is around 4 hours, individually roughly 2 to 8 hours (EFSA 2015); pregnancy, the pill and some medications extend it substantially: in pregnancy, EFSA reports 6 to 16 hours, and on the pill two studies found means of 10.7 and 7.88 hours (6.2 and 5.37 without it). The slider runs from 2 to 8 hours, so with a longer half-life the check shows too little caffeine. We offer no fixed setting for the pill or pregnancy, because the studies do not yield a single value. When more than 200 mg is taken at once with 12 hours or less to go before bed, the check shows the finding of the 2025 trial instead of a verdict based on what is left. The 200 mg line is our choice: EFSA considers a single dose up to that amount safe for healthy adults, and the trial only tested 100 and 400 mg. The drink values follow the table of Germany's Federal Institute for Risk Assessment (BfR), which is based on EFSA figures: brewed coffee 90 mg (200 ml), espresso 80 mg (60 ml), energy drink 80 mg (250 ml), black tea 45 mg (200 ml), cola 35 mg (330 ml); the BfR calls all of them approximations.

Reference points from the curve

Situation (half-life 4 h)Left at bedtime
90 mg (1 cup of brewed coffee) at 2 pm, bed at 11 pm19 mg
160 mg (2 espressos) at 4 pm, bed at 10:30 pm52 mg
180 mg (2 cups of brewed coffee) at 3 pm, bed at 10:30 pm49 mg

Calculated with exactly the formula this tool uses.

Frequently asked questions

When should I go to bed if I wake up at 6:30 am?

For 6 cycles (9 hours of sleep) at 9:15 pm (21:15), for 5 cycles (7.5 hours) at 10:45 pm (22:45), for 4 cycles (6 hours) at 12:15 am (00:15), each including 15 minutes to fall asleep. The formula behind it: bedtime equals wake-up time minus your cycles times 90 minutes, minus 15 minutes for falling asleep.

How many sleep cycles do I need?

Most adults do well on 5 cycles (7.5 hours); the common recommendation of 7 to 9 hours corresponds to 5 to 6 cycles. Four cycles is an emergency option for the odd night, not a routine. The real test is how rested you feel over several mornings. Cycles just help you plan.

How long does caffeine really last?

With a 4-hour half-life, half is left after 4 hours and a quarter after 8. About a quarter of an espresso you had at 4 pm is still in your body at midnight. At an 8-hour half-life, the top of EFSA's adult range, those times double.

At what point does caffeine disturb sleep?

EFSA points to around 100 mg taken close to bedtime as an amount that measurably changes how long some people take to fall asleep and how long they sleep. The size of a single dose matters, not just what is left at bedtime: in a 2025 trial in 23 young men, 400 mg still disturbed sleep 12 hours before bed, while 100 mg taken 4 hours before bed had no significant effect. No threshold has been established for the amount still in your body; we use the 100 mg only as a reference. Sensitivity is individual: some people sleep fine after a 9 pm espresso, others lie awake after an afternoon cup. The half-life slider only covers how fast your body clears caffeine, not how strongly the same amount affects you.

How much caffeine per day is considered safe?

For healthy adults, EFSA considers up to 400 mg across the day and up to 200 mg in a single dose safe; that is roughly four cups of brewed coffee spread over the day. For pregnant women, EFSA's figure is half that: it found intakes up to 200 mg a day raise no safety concerns for the fetus.

Do tea and cola count?

Yes. According to the BfR, black tea carries about 45 mg per 200 ml cup, cola about 35 mg per 330 ml can and an energy drink about 80 mg per 250 ml can. Green tea counts too, at about 30 mg per cup. Decaf is not caffeine-free: the FDA puts a typical 8-ounce cup at 2 to 15 mg.

Sources

Retrieved August 24, 2026. EFSA: Scientific Opinion on the safety of caffeine, EFSA Journal 2015;13(5):4102 (half-life, 100 mg note, 200/400 mg values). · Carskadon MA, Dement WC: Normal Human Sleep, in: Kryger et al., Principles and Practice of Sleep Medicine, 6th edition, Elsevier 2017 (average cycle length 90 to 110 minutes; first cycle approx. 70 to 100, later cycles approx. 90 to 120 minutes).

Retrieved September 29, 2026. Gardiner CL et al.: Dose and timing effects of caffeine on subsequent sleep: a randomized clinical crossover trial, Sleep 2025;48(4):zsae230 (100 and 400 mg, 4 to 12 hours before bed). · BfR: Frequently asked questions on caffeine and foods containing caffeine, Table 1 (serving contents). · Patwardhan RV et al., J Lab Clin Med 1980;95(4):603-608 and Abernethy DR, Todd EL, Eur J Clin Pharmacol 1985;28(4):425-428 (half-life on the pill). · Culm-Merdek KE et al., Br J Clin Pharmacol 2005;60(5):486-493 (medications, with fluvoxamine as the example). · FDA: Spilling the Beans: How Much Caffeine is Too Much? (decaf).

Retrieved November 8, 2026. Hilditch CJ, McHill AW: Sleep inertia: current insights, Nat Sci Sleep 2019;11:155-165 (sleep depth and grogginess after waking).

Published August 24, 2026 · Updated November 9, 2026

Rules of thumb, not medicine. If sleep problems persist, see a doctor; how fast your body clears caffeine and how strongly it affects you depend on genetics, pregnancy and medication, among other things.

More from the garden

All calculators live under Tools. A good pairing: the TDEE calculator handles your energy during the day, and the Wheel of Life shows whether sleep is currently your biggest lever. Planning a new evening routine? The habit calculator shows how long it takes to run on its own. And for the way into bed: the breathing exercise timer paces 4-7-8 exactly as the source doses it. How well it has been studied is in our guide. When the phone cuts into your sleep at night: the screen time calculator shows how many waking years your phone time takes, and what an hour less a day gives back. Sleep and body goals go together: the body fat calculator estimates your percentage and the time frame to your goal.

Wild Garden Editorial Team

Content and tools on Wild Garden are published by the Wild Garden Editorial Team. How we research, check and correct errors is set out in our editorial standards.

Read next