How it works.
Three simple formulas. Real research.
Sleep
bedtime = wake − 14 min − cycles × 90 min
Sleep runs in roughly 90-minute cycles. Waking between them, in light sleep, feels easier. Five cycles (7½ h) clears the 7-hour adult minimum.
Nap
alarm = now + 5 min + nap length
10–20 minutes stays in light sleep. 30–60 reaches deep sleep and leaves you groggy. 90 completes a full cycle.
Caffeine
cutoff = bedtime − 6 h
Caffeine's half-life averages about 5 hours. Even 6 hours before bed, it measurably cuts sleep.
Limits
Cycles vary from about 70 to 120 minutes, so treat results as estimates. Total sleep and a steady schedule matter more than any boundary. Not for shift work, children, or sleep disorders. Not medical advice.
For developers & AI
Free JSON API, no key: /api/sleep?wake=07:00 or ?bedtime=23:00. Summary at /llms.txt.
Sources
NREM–REM cycles average roughly 90 minutes (range ~70–120) and repeat 4–6 times per night; REM periods lengthen toward morning.
Patel AK, Reddy V, Shumway KR, Araujo JF. Physiology, Sleep Stages. StatPearls, 2024.Adults should sleep 7 or more hours per night on a regular basis.
Watson NF et al. Recommended Amount of Sleep for a Healthy Adult: A Joint Consensus Statement of the AASM and SRS. Sleep, 2015.Healthy adults typically take about 10–20 minutes to fall asleep (sleep-onset latency).
Ohayon MM et al. Meta-analysis of quantitative sleep parameters from childhood to old age. Sleep, 2004.400 mg of caffeine taken even 6 hours before bed reduced total sleep by more than 1 hour.
Drake C et al. Caffeine effects on sleep taken 0, 3, or 6 hours before going to bed. J Clin Sleep Med, 2013.Caffeine's half-life in healthy adults averages about 5 hours, ranging roughly 1.5–9.5 hours between people.
Institute of Medicine. Caffeine for the Sustainment of Mental Task Performance, 2001.A ~10-minute nap gave immediate benefits; 20–30 minute naps helped later; longer naps caused initial grogginess (sleep inertia).
Brooks A, Lack L. A brief afternoon nap following nocturnal sleep restriction: which nap duration is most recuperative? Sleep, 2006.Caffeine taken just before a short nap produced better post-nap alertness than the nap alone.
Hayashi M, Masuda A, Hori T. The alerting effects of caffeine, bright light and face washing after a short daytime nap. Clin Neurophysiol, 2003.
Reviewed 2026-11-02.