Tools

Sleep Calculator with a Caffeine Check

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.

Dieses Tool auf Deutsch: Schlafrechner

This sleep calculator answers two questions that belong together: when should you go to bed so your alarm lands at the end of a sleep cycle instead of the middle of one, 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 cycles matter more than hours

Sleep runs in cycles of light sleep, deep sleep and REM that together last roughly 90 to 110 minutes. Waking at the end of a cycle usually feels easier than being pulled out of deep sleep by an alarm, even with nominally more sleep on the clock. That is why this tool counts cycles: 6 cycles is about 9 hours, 5 is 7.5, 4 is 6.

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 shift them until getting up feels easy.

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 getting up feels: if it stays heavy, shift your bedtime by half a cycle.

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).

Changelog

September 29, 2026: Clarified: for 100 mg taken 4 hours before bed, this page said the effect on sleep was not measurable. The 2025 trial reports no significant effect, and the page now says so.

September 29, 2026: Clarified: when more than 200 mg is taken at once within 12 hours of bedtime, the result now shows only the 2025 trial's finding, no longer also the comparison of what is left with 100 mg, as the method section describes.

September 29, 2026: Corrected: the FAQ said slow metabolizers can double these times, a figure none of our sources gives; it now says what EFSA's range supports: at an 8-hour half-life the times double. It also said EFSA advises pregnant women to stay below 200 mg a day; EFSA's opinion says intakes up to 200 mg a day raise no safety concerns for the fetus. The note at the end of the page now separates clearance from effect.

September 29, 2026: With version 1.2.0, the caffeine check no longer gives an all-clear based on what is left when more than 200 mg is taken at once within 12 hours of bedtime; it shows the finding of a 2025 trial in which 400 mg still disturbed sleep 12 hours before bed. Removed: the tip for sensitive people, which named a time later than the reader's own intake; the latest time for less than 100 mg is now exact to the minute. Tea and cola follow the BfR table (45 mg per 200 ml, 35 mg per 330 ml), and decaf follows the FDA (2 to 15 mg per cup instead of 'usually under 5 mg'). New: a note at the slider on half-lives above 8 hours, and a chart that no longer presents 100 mg as a limit for what is left.

September 29, 2026: Corrected: this page said the half-life slider covers pregnancy, hormonal contraception and medication, and gave its range as 3 to 8 hours. It runs from 2 to 8 hours; in pregnancy EFSA reports 6 to 16 hours, where the check shows too little caffeine.

Version 1.1.0, August 26, 2026: half-life slider widened to 2 to 8 hours to match the range we state; provenance of the 100 mg reference clarified (an ingested single dose per EFSA, which we apply strictly to the remaining amount). Version 1.0.1, August 24, 2026: half-life range refined per EFSA (2 to 8 hours), body instead of blood wording. Version 1.0.0, same day: first release, sources retrieved. Verification runs documented in the verification record.

Published August 24, 2026 · Last updated September 29, 2026 · Wild Garden Editorial Team · Last verified September 29, 2026 · Calculation tested against an independent reference implementation (469,152 test cases, 0 mismatches) · 29 of 29 source citations confirmed against the primary sources; all runs in the verification record. Our editorial standards · Spotted an error? redaktion@wildgarden.io

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.

Wild Garden Editorial Team

Who is behind the content

Content and tools on Wild Garden are published by the Wild Garden Editorial Team.

Our editorial standards

For the tools on Wild Garden: every tool page names the date of the recorded verification run it relies on. All tools can be used in full without sign-up or paywall, and their calculations run in your browser. The tools are not medical, legal or financial advice; where a result can only be a rough guide, the tool page says so. Errors or questions: redaktion@wildgarden.io

Verification record

Recorded runs of published tools are listed with date, scope and result in the verification record (in German), failed ones included. Questions about the method: redaktion@wildgarden.io

Read next