Methodology
How SleepTools calculators work.
Every formula on this site is attributed to a published source. This page lists what each calculator does, the science it's built on, and what it doesn't try to do.
Editorial review by the SleepTools Editorial Team. Last reviewed May 5, 2026.
Editorial principles
- Every calculator is built on peer-reviewed sleep research, or a consensus guideline from the NSF, AAP, AASM, or CDC.
- When the research gives a range (caffeine half-life is 5 to 9 hours, for example), the variable is exposed in the calculator so you can match it to your own metaboliser type.
- Calculators do not diagnose sleep disorders. Any page that gives timing guidance carries a "Not medical advice" footer.
- All calculations run in the browser. No data leaves your device, and no account is required.
Timing calculators
Sleep Cycle Calculator
Sleep cycle math uses the 90-minute cycle (Dement & Kleitman, 1957; Carskadon & Dement, 2011) plus a 14-minute average sleep-onset latency (Ohayon et al., 2004). The visualisation also models per-cycle stage progression: N3 deep sleep dominates cycles 1–2 (physical restoration, glymphatic clearance per Xie et al. 2013), while REM lengthens through cycles 4–6 (memory and emotional processing per Walker et al. 2002).
Formula
- T = clock time, in minutes since midnight
- n = number of complete sleep cycles. The visualizer accepts n ∈ {4, 5, 6}; values below 4 (under NSF adult minimum) are not surfaced in the UI.
- 90 min = mean cycle length (Dement & Kleitman, 1957; Carskadon & Dement, 2011). Individual cycles range 80–110 min.
- 14 min = mean sleep-onset latency (Ohayon et al., 2004)
- Per-cycle stage proportions (healthy adult, % of 90-min cycle):
- Cycle 1 — N1 5%, N2 30%, N3 55%, REM 10% (deep sleep dominant)
- Cycle 2 — N1 5%, N2 40%, N3 35%, REM 20%
- Cycle 3 — N1 5%, N2 45%, N3 20%, REM 30%
- Cycle 4 — N1 5%, N2 50%, N3 5%, REM 40%
- Cycle 5 — N1 5%, N2 50%, N3 0%, REM 45% (REM dominant)
- Cycle 6 — N1 5%, N2 50%, N3 0%, REM 45%
- Aggregate over a 5-cycle (7.5h) night: ≈ 50% N2, ≈ 22% N3, ≈ 18% REM, ≈ 5% N1 — consistent with the Carskadon & Rechtschaffen (2005) adult-architecture consensus.
- These proportions model a healthy ~30-year-old adult. N3 compresses with age (Ohayon et al., 2004; teens ~20–25%, 60+ ~5–10%); the visualizer does not yet expose age as an input — that adjustment is a planned follow-up.
Sources
- Dement & Kleitman, 1957: Cyclic variations in EEG during sleep and their relation to eye movements, body motility, and dreaming (the 90-minute sleep cycle)
- Aserinsky & Kleitman, 1953: Regularly occurring periods of eye motility (REM discovery)
- Carskadon & Dement, 2011: Normal human sleep, an overview (Principles and Practice of Sleep Medicine, 5th ed.)
- Carskadon & Rechtschaffen, 2005: Monitoring and staging human sleep
- Ohayon et al., 2004: Meta-analysis of quantitative sleep parameters from childhood to old age
- Walker et al., 2002: Practice with sleep makes perfect — sleep-dependent motor skill learning (REM and memory)
- Xie et al., 2013: Sleep drives metabolite clearance from the adult brain (glymphatic system in N3)
Bedtime Calculator
Bedtime targets are computed back from a desired wake time using the 90-minute cycle (Carskadon & Dement, 2011) and a 14-minute sleep-onset latency buffer (Ohayon et al., 2004), then cross-referenced with NSF 2015 age-based duration guidelines.
Formula
- T = clock time, in minutes since midnight
- n = number of complete cycles. Results are surfaced for n = 6, 5, 4 (9 h, 7.5 h, 6 h). The 3-cycle (4.5 h) option exists in the underlying lib but is filtered out of the UI as below NSF adult minimum.
- 90 min cycle (Carskadon & Dement, 2011), 14 min sleep-onset latency (Ohayon et al., 2004)
- 5 cycles (7.5 h) is rated 'best' as the median NSF 7–9 h adult target; 6 (9 h) and 4 (6 h) are rated 'good' — within range but not the prescriptive default.
Sources
- Carskadon & Dement, 2011: Normal human sleep, an overview (Principles and Practice of Sleep Medicine, 5th ed.)
- Ohayon et al., 2004: Meta-analysis of quantitative sleep parameters from childhood to old age
- National Sleep Foundation, 2015: age-based sleep duration consensus
Wake-Up Time Calculator
Wake-time targets are end-of-cycle markers based on the 90-minute cycle (Carskadon & Dement, 2011), so you wake from light NREM rather than mid-cycle deep sleep. That is the model behind reduced sleep inertia (Tassi & Muzet, 2000).
Formula
- T = clock time, in minutes since midnight
- n = number of complete cycles. Results are surfaced for n = 4, 5, 6 (6 h, 7.5 h, 9 h). The 3-cycle option is filtered out of the UI as below NSF adult minimum.
- Wake aligns with the end of cycle n (light NREM), reducing sleep inertia (Tassi & Muzet, 2000)
- 5 cycles (7.5 h) is rated 'best' as the median NSF 7–9 h adult target; 6 (9 h) and 4 (6 h) are rated 'good'.
Sources
- Carskadon & Dement, 2011: Normal human sleep, an overview (Principles and Practice of Sleep Medicine, 5th ed.)
- Ohayon et al., 2004: Meta-analysis of quantitative sleep parameters from childhood to old age
- Tassi & Muzet, 2000: sleep inertia review
Nap Calculator
Nap durations are tied to sleep-stage progression (Carskadon & Rechtschaffen, 2005): power naps end before N3 onset at ~20 minutes (Dinges, 1992; Lovato & Lack, 2010); 90-minute cycle naps complete a full cycle including REM (Mednick et al., 2002). The latest-safe-start cutoff uses a 6-hour-before-bed buffer to preserve evening sleep pressure (Monk, 2005).
Formula
- d_nap = recommended duration, selected by desired outcome (alert / memory / recovery)
- T_latest = latest safe nap start to preserve evening sleep pressure
- 6-hour buffer per Monk (2005) and Dinges (1992)
Sources
- Mednick et al., 2002: Nap stage composition and cognitive benefits
- Lovato & Lack, 2010: Sleep inertia and nap length
- Monk, 2005: Circadian post-lunch dip and nap timing
- Dinges, 1992: Power naps and alertness
- Carskadon & Rechtschaffen, 2005: Normal human sleep — stages reference
Caffeine Cutoff Calculator
Caffeine cutoff times are derived from caffeine's pharmacokinetic half-life: 5 to 7 hours in normal CYP1A2 metabolizers, extending to 9 or more hours in slow metabolizers (Nehlig et al., 1992). Drake et al. (2013) found that caffeine taken 6 hours before bed reduced sleep by about an hour.
Formula
- C(t) = caffeine remaining t hours after intake, in mg
- C₀ = peak dose, in mg
- t₁/₂ = elimination half-life: 5 h (fast), 7 h (normal), 9 h (slow / sensitive CYP1A2)
- Target: ≤ 25% of peak remaining at bedtime; this is reached at exactly 2·t₁/₂ hours after intake
Sources
- Drake et al., 2013: Caffeine effects on sleep taken 0, 3, or 6 h before going to bed
- Nehlig et al., 1992: Caffeine and the central nervous system (pharmacokinetics)
Health calculators
Sleep Debt Calculator
Sleep debt is the cumulative deficit between actual sleep and the age-appropriate target (NSF, 2015). Recovery uses the rule of about one extra hour per night above target until cleared (Banks & Dinges, 2007). Predicted attention loss follows a simplified linear approximation of Van Dongen et al. (2003).
Formula
- D = total sleep debt over the logged period, in hours; floored at 0 (surplus is not banked)
- T = nightly sleep target by age group: 9 h (teen), 8 h (adult), 7.5 h (older) — NSF (2015)
- N = number of nights logged; h_i = hours slept on night i
- R = recovery time in nights, assuming +1 h above target each night (Banks & Dinges, 2007)
- P = predicted sustained-attention reduction; simplified linear approximation of Van Dongen et al. (2003), capped at 50%
Sources
- National Sleep Foundation, 2015: sleep duration recommendations
- Banks & Dinges, 2007: Behavioral and physiological consequences of sleep restriction
- Van Dongen et al., 2003: Cumulative cost of additional wakefulness — dose-response of sleep loss on neurobehavioral functions
- Dinges, 1995: An overview of sleepiness and accidents (cumulative debt and performance)
How Much Sleep Do I Need
Age-band recommendations come from the NSF 2015 consensus statement (Hirshkowitz et al., 2015), cross-referenced with the CDC and the American Academy of Pediatrics. Lifestyle modifiers (active exercise, high stress) lean the recommendation toward the upper end of the band, per AASM practitioner guidance.
Formula
- H_age(a) = NSF 2015 midpoint for the age band a
- Age bands (hours/night): newborn 16, infant 14, toddler 12.5, preschool 11, school-age 10, teen 9, adult 8, older adult 7.5
- Δ_lifestyle = +0.5 h if active exercise + +0.5 h if high stress (max +1 h adjustment)
Sources
- Hirshkowitz et al. (NSF), 2015: National Sleep Foundation's sleep time duration recommendations
- Centers for Disease Control and Prevention: sleep duration by age
- American Academy of Pediatrics: pediatric sleep guidance
- American Academy of Sleep Medicine: clinical practice guidelines on adult sleep duration
Sleep Deprivation Cost Calculator
Productivity loss is modelled with the simplified linear approximation of Van Dongen et al. (2003): each 7 h of accumulated debt corresponds to roughly 25% reduction in sustained attention, capped at 50%. Job type adjusts the multiplier (cognitive 1.2x, physical 0.8x). BAC-equivalent framing comes from Williamson & Feyer (2000); the population-level cost context is Hafner et al. (RAND, 2017).
Formula
- D = sleep debt, in hours
- ρ = effective performance reduction (0–0.5); linear approximation of Van Dongen et al. (2003)
- m = job-type multiplier: 1.2 cognitive, 1.0 mixed, 0.8 physical
- H_lost = productive hours lost per 8-h workday
- w = hourly wage (optional input)
- BAC-equivalent framing: ~17 h awake ≈ 0.05% BAC, ~24 h ≈ 0.10% (Williamson & Feyer, 2000)
Sources
- Van Dongen et al., 2003: Cumulative cost of additional wakefulness — dose-response of sleep loss on neurobehavioral functions
- Williamson & Feyer, 2000: Moderate sleep deprivation produces impairments equivalent to alcohol intoxication
- Hafner et al., 2017 (RAND): Why sleep matters — the economic costs of insufficient sleep (population-level context)
Sleep Quality Score
The score is calibrated against the Pittsburgh Sleep Quality Index (Buysse et al., 1989), with the subdomain structure adapted from the NSF Sleep Health Index (2014) and the daytime-functioning domain informed by the Insomnia Severity Index (Morin et al., 2011). Eight Likert-style questions feed four subdomains: sleep efficiency (40%), timing and restedness (25%), daytime functioning (20%), and sleep hygiene (15%).
Formula
- S_d = subdomain score (0–100); d ∈ {efficiency, timing, daytime, hygiene}
- a_q ∈ {0, 1, 2, 3} = answer to question q on a Likert scale (0 = best, 3 = worst)
- |d| = number of questions in subdomain d (3, 2, 1, 2 respectively)
- w_d = subdomain weight: 0.40 efficiency, 0.25 timing, 0.20 daytime, 0.15 hygiene
- Calibration: S_total < 65 corresponds to PSQI > 5 (poor-sleeper threshold from Buysse et al., 1989)
Sources
- Buysse et al., 1989: The Pittsburgh Sleep Quality Index (PSQI)
- Morin et al., 2011: The Insomnia Severity Index — psychometric indicators
- National Sleep Foundation, 2014: Sleep Health Index methodology
Life-situation calculators
Baby Sleep Calculator
Wake windows, nap counts, and total sleep needs follow NSF 2015 (Hirshkowitz et al.) and AAP/AASM 2016 (Paruthi et al.) age-based guidance, with the 2-to-1 and 1-to-0 nap transitions framed by Jenni & O'Connor (2005). Sample schedules are built by alternating the midpoint wake window with the midpoint nap duration from each age band. Safe-sleep callouts (back-to-sleep, firm surface, room-sharing, no soft bedding) are surfaced for under-12-month inputs per the AAP Safe Sleep policy statement (Moon et al., 2022).
Formula
- T_wake = morning wake time (input); T_bed = recommended bedtime
- N_naps = age-band nap count (5 newborn → 0 by ~3 y); see BABY_SPECS table in lib
- W = age-band wake window midpoint (~45 min newborn → ~360 min preschool)
- d_n = age-band nap duration midpoint (~60 min newborn → 0 once napping ends)
- Schedule alternates: wake → nap → wake → nap → ... → wake → night sleep
- Total sleep ranges by age band: 0-3 mo 14-17h (NSF), 4-11 mo 12-16h (AAP/AASM), 1-2 y 11-14h, 3-5 y 10-13h.
- For ages 0 to about 3 months the 'night sleep' figure is the *aggregate* across multiple 2 to 4 hour stretches, not a single consolidated block. The calculator labels this as 'Total night sleep' and notes consolidation typically begins around 3 to 4 months.
- Spec age bands are non-overlapping [minMonths, maxMonths) so a baby at any month maps to exactly one age band.
Sources
- Hirshkowitz et al. (NSF), 2015: National Sleep Foundation sleep duration recommendations
- Paruthi et al. (AAP/AASM), 2016: Recommended amount of sleep for pediatric populations
- Moon et al. (AAP), 2022: Sleep-Related Infant Deaths. Updated 2022 Recommendations for Reducing Infant Deaths in the Sleep Environment
- Jenni & O'Connor, 2005: Children's sleep, an interplay between culture and biology (nap transitions)
- Huckleberry: published age-based wake-window data
Shift Work Sleep Calculator
Sleep is anchored 1 hour after shift end with a 7-hour window. Light timing follows Boivin & James (2002): avoid light 2 h before sleep onset, seek bright light at sleep offset. Rotating shifts use a gradual 7-day re-entrainment with daily ~2 h bedtime shifts; forward (clockwise) rotations are biologically easier than backward rotations (Smith et al., 1999), per AASM guidance (Sack et al., 2007). Full circadian re-entrainment to night work takes 5–7 days (Czeisler et al., 1990).
Formula
- Sleep onset 1 h after shift end (wind-down period)
- Sleep duration = 7 h (lib anchor; circadian misalignment may require longer in practice)
- Δ_day = nightly bedtime shift, distributed linearly over 7 days for rotating workers
- Light avoidance: 2 h before sleep onset (Boivin & James, 2002)
- Light seeking: at sleep offset on waking
- Forward rotation (day → evening → night) is easier than backward (Smith et al., 1999)
Sources
- Czeisler et al., 1990: Exposure to bright light and darkness to treat physiologic maladaptation to night work
- Smith et al., 1999: Forward vs backward shift rotation
- Boivin & James, 2002: Light treatment and circadian adaptation to shift work
- Sack et al., 2007 (AASM): Circadian rhythm sleep disorders — clinical practice guidelines
Jet Lag Calculator
Recovery uses the asymmetric adaptation rate from Eastman & Burgess (2009) and Waterhouse et al. (2007): ~1.0 day per time zone eastward (phase advance is biologically harder) and ~0.75 days per zone westward (phase delay matches the body clock's natural drift). Light-exposure timing follows the Cochrane review by Herxheimer & Petrie (2002) and the NEJM clinical review by Sack (2010).
Formula
- Δz = signed time-zone difference (positive = eastward); shorter route taken when |Δz| > 12
- R = recovery days (rounded); reflects direction asymmetry per Eastman & Burgess (2009)
- T_body = body clock's bedtime expressed in destination local time
- T_target = desired local bedtime at destination
- δ_day = recommended daily bedtime shift to gradually phase-shift body clock to local time
Sources
- Eastman & Burgess, 2009: How to travel the world without jet lag
- Sack, 2010: Jet lag (NEJM clinical review)
- Herxheimer & Petrie, 2002: Melatonin for the prevention and treatment of jet lag (Cochrane review)
- Waterhouse et al., 2007: Jet lag — trends and coping strategies
Circadian & chronotype calculators
Chronotype Calculator
Scoring uses a 7-question simplified Morningness-Eveningness Questionnaire (Horne & Östberg, 1976), with the four-type Lion / Bear / Wolf / Dolphin classification described in Breus (2016). Social jet lag is computed in the spirit of the Munich Chronotype Questionnaire (Roenneberg et al., 2003) as the difference between mid-sleep on free days and mid-sleep on workdays.
Formula
- a_i = answer to question i on a 5-point scale (0 = strong evening preference, 4 = strong morning)
- S_raw range: 0–28; S_norm normalised to 0–100
- Type cutoffs are calibrated to the Breus (2016) Lion/Bear/Wolf/Dolphin framework, not the original MEQ thresholds
- Social jet lag = |mid-sleep_free − mid-sleep_workday| (Roenneberg et al., 2003 MCTQ)
Sources
- Horne & Östberg, 1976: A self-assessment questionnaire to determine morningness-eveningness
- Roenneberg et al., 2003: Life between clocks — daily temporal patterns of human chronotypes (MCTQ)
- Breus, 2016: The Power of When (Lion/Bear/Wolf/Dolphin classification)
Sleep Schedule Fixer
Schedule shifts apply the gradual circadian advance/delay protocol from Czeisler et al. (1981), capped at the physiological maxima of ≈30 min/day for advances (the harder direction) and ≈60 min/day for delays. Low-dose melatonin can amplify advances when taken 5 hours before DLMO (Lewy et al., 1984; Mundey et al., 2005).
Formula
- ΔT = total bedtime shift required, in minutes
- r_user = user-selected daily shift rate (15, 30, or 60 min/day)
- r_max = physiological cap; advance is biologically harder than delay (Czeisler et al., 1981)
- N_days = nights to reach target at the effective rate
- For advances, morning bright light is the strongest signal; melatonin 5 h before DLMO amplifies the effect (Mundey et al., 2005)
- For delays, evening bright light reinforces the later schedule
Sources
- Czeisler et al., 1981: Bright light induction of strong (type 0) resetting of the human circadian pacemaker
- Lewy et al., 1984: Melatonin shifts human circadian rhythms according to a phase-response curve
- Mundey et al., 2005: Phase-dependent treatment of delayed sleep phase syndrome with melatonin
- American Academy of Sleep Medicine: circadian rhythm sleep–wake disorder guidelines
Melatonin Timing Calculator
Dim-light melatonin onset (DLMO) is estimated as habitual sleep onset minus 2 hours (Lewy et al., 1992 / 1998 / 2006). For phase advance, the evidence-backed protocol is 0.5 mg taken 5 hours before DLMO (Mundey et al., 2005). The standard 3–10 mg doses common at retail are pharmacological — they sedate but don't phase-shift well — per the Brzezinski et al. (2005) meta-analysis.
Formula
- T_DLMO ≈ habitual sleep onset − 120 min (Lewy et al., 1999/2006)
- Phase advance: take 5 h before DLMO at 0.5 mg low dose (Mundey et al., 2005)
- Standard 3–10 mg doses cause an exogenous melatonin spike that wears off quickly and can leave excess melatonin disrupting later sleep stages (Brzezinski et al., 2005)
- Westward jet lag responds modestly to melatonin; bright morning light at destination is the primary lever
Sources
- Lewy et al., 2006: The dim-light melatonin onset (DLMO) as a marker of circadian phase
- Lewy et al., 1992 / 1998: Melatonin phase-shifting and DLMO foundational research
- Mundey et al., 2005: Phase-dependent treatment of delayed sleep phase syndrome with melatonin
- Brzezinski et al., 2005: Effects of exogenous melatonin on sleep — a meta-analysis
Alcohol and Sleep Calculator
BAC is computed via the Widmark formula (1932), still the standard in forensic toxicology (Searle, 2015). REM suppression scales with bedtime BAC at ≈9.3 minutes per 0.01% (Colrain et al., 2014; Ebrahim et al., 2013), consistent with the sleep-architecture review by Roehrs & Roth (2001): SWS-heavy first half, fragmented second half.
Formula
- BAC(t) = blood alcohol concentration t hours after first drink, in percent w/v (Widmark, 1932)
- D = number of standard US drinks (14 g ethanol each)
- w = body weight in kg
- r = volume-of-distribution factor: 0.68 (male), 0.55 (female) — Widmark (1932)
- 0.015 %/h = mean ethanol elimination rate
- ΔREM = REM minutes lost, capped at one first-cycle's worth (~50 min); 9.3 min per 0.01% BAC (Colrain et al., 2014)
Sources
- Widmark, 1932: Formula for blood alcohol concentration estimation
- Searle, 2015: Alcohol calculations and their uncertainty (modern Widmark validation)
- Roehrs & Roth, 2001: Sleep, sleepiness, and alcohol use
- Ebrahim et al., 2013: Alcohol and sleep I — effects on normal sleep (meta-analysis)
- Colrain et al., 2014: Alcohol and the sleeping brain
Teen Sleep Calculator
Targets reflect the puberty-driven circadian phase delay documented by Carskadon et al. (1998, 2002): DLMO shifts 1.5–2.5 hours later in adolescents, making pre-11 p.m. sleep onset biologically difficult. Wolfson & Carskadon (1998) tied this directly to school-schedule sleep debt. The 8–10 hour recommendation for ages 13–17 comes from NSF (2015); the AAP (2014) policy statement recommends school start no earlier than 8:30 a.m.
Formula
- T_prep = morning prep + commute (default 60 min)
- T_bed,natural(age) = age-band natural sleep onset reflecting pubertal circadian delay (Carskadon et al., 1998/2002): ~22:00 ages 11–12, ~23:00 ages 14–15, ~23:30 ages 16–17
- S_min(age) = NSF 2015 minimum recommended hours: 9 h ages 11–12, 8 h ages 13–18
- D_nightly is floored at 0 (no negative debt), D_annual assumes a 180-day school year
- AAP (2014) policy: secondary schools should start no earlier than 8:30 a.m.
Sources
- Carskadon et al., 1998 / 2002: Adolescent circadian phase delay and pubertal sleep regulation
- Wolfson & Carskadon, 1998: Sleep schedules and daytime functioning in adolescents
- Hirshkowitz et al. (NSF), 2015: sleep duration recommendations
- American Academy of Pediatrics, 2014: School start times for adolescents (policy statement)
Sleep Banking Calculator
Banking schedules follow the Rupp et al. (2009) protocol: extending sleep by 1–2 hours per night for 5–7 nights before a planned sleep restriction provides meaningful protection during the subsequent restriction period. Each banked hour confers approximately 0.65 days of effective protection (conservative estimate calibrated to Rupp's 2009 trial). Mah et al. (2011) showed similar benefits in athletic-performance contexts; Belenky et al. (2003) provides the underlying dose-response model of restriction.
Formula
- B_total = total banked sleep hours
- n_bank = banking nights (typically 5–7); Δh = extra sleep per banking night (1.0–2.0 h, depending on purpose)
- D_projected = sleep debt the planned restriction will accrue, in hours
- N_eff = effective protection days; protection degrades after ~2–3 days of restriction (Rupp et al., 2009)
- Banking shows diminishing returns beyond ~7 nights and is preparation, not a substitute for adequate rest
Sources
- Rupp, Wesensten & Balkin, 2009: Banking sleep — realization of benefits during subsequent sleep restriction and recovery
- Mah et al., 2011: The effects of sleep extension on athletic performance
- Belenky et al., 2003: Patterns of performance degradation during sleep restriction (dose-response model)
Limitations
These tools model averaged sleep physiology for healthy adults, or for healthy children where applicable. Individual sleep cycles run 80 to 110 minutes. Caffeine half-life varies more than threefold by metaboliser type, age, hormonal contraceptive use, and pregnancy. Melatonin DLMO can shift by several hours depending on chronotype. The calculators expose these variables wherever they change the result enough to matter.
SleepTools does not diagnose insomnia, delayed sleep phase syndrome, shift work disorder, or any other sleep disorder. If you have persistent sleep difficulties, see a board-certified sleep medicine physician.
How this page is maintained
When a calculator's formula changes, the corresponding entry in lib/content/citations.ts is updated in the same commit. That single source feeds this page, the "Built on" footer on each calculator, and the /llms.txt file that AI search engines read.
These tools are for informational purposes only and are not a substitute for medical advice. For sleep disorders or persistent sleep difficulties, consult a healthcare provider.