{{ thresholdStageLabel }} Low Hold High {{ thresholdLatestLabel }}
Sleep window adjustment inputs
Enter hours from 4.0 to 9.0, such as 6.0.
h
{{ windowLabel(startWindowMinutes) }}
Use HH:MM, for example 07:00.
Paste 0-100 values separated by lines, commas, spaces, or semicolons.
Enter 70-95%; keep below the high threshold.
%
{{ formatPercent(lowThresholdValue) }}
Enter 75-99%; planner keeps it above the low threshold.
%
{{ formatPercent(highThresholdValue) }}
Choose 1 for responsive changes, 2-3 for smoother decisions.
Choose 10, 15, 20, or 30 minutes.
min
Enter 4.0-8.0 h; use clinical guidance for very short windows.
h
{{ windowLabel(minWindowMinutes) }}
Enter 5.0-10.0 h and keep it above the minimum.
h
{{ windowLabel(maxWindowMinutes) }}
Choose cautious, standard, or fast follow-up wording.
Week Observed SE Action Decision basis Δ min Window Bedtime Wake Copy
{{ row.week_label }} {{ row.observed_label }} {{ row.action_label }} {{ row.decision_basis }} {{ formatFixed(row.change_minutes, 0) }} {{ row.window_label }} {{ row.bedtime }} {{ wake_target }}
Priority Action Why now Timing Track Copy
{{ row.priority }} {{ row.action }} {{ row.reason }} {{ row.timing }} {{ row.track }}
No adjustment guidance available.

                
Customize
Advanced
:

Introduction:

Sleep-window planning starts with a simple but easy-to-misread idea: the time allowed for sleep is not the same thing as sleep itself. People with insomnia often spend long stretches in bed while awake, tense, or checking the clock. More time in bed can then make nights feel less predictable because the bed becomes linked with effort instead of sleep.

A planned sleep window narrows that sleep opportunity around a steady wake time, then changes it only when diary data supports a move. The approach is usually discussed within cognitive behavioral therapy for insomnia (CBT-I), especially sleep restriction or sleep compression work. It relies on sleep efficiency, which compares estimated time asleep with planned time in bed. A low efficiency value usually points to too much awake time inside the window. A high value can suggest that the window may be ready to grow.

Core terms for sleep-window adjustment planning
Term Plain meaning Planning consequence
Time in bed The scheduled sleep opportunity from bedtime to wake time. Changing this span moves bedtime when wake time stays fixed.
Total sleep time The sleep estimated from a diary or weekly review. It is divided by time in bed to produce sleep efficiency.
Sleep efficiency The percentage of the sleep window spent asleep. Thresholds use this value to decide compress, hold, or expand.
Fixed wake time The morning anchor that stays the same through window changes. Expansion moves bedtime earlier; compression moves bedtime later.

The fixed wake anchor is what keeps the calculation practical. A 6-hour window ending at 07:00 starts at 01:00. Expanding to 6h 15m moves bedtime to 00:45, while compressing to 5h 45m moves bedtime to 01:15. The wake time does not move, so each adjustment is a bedtime change rather than a drifting schedule.

Sleep-window threshold rule showing compression, hold, and expansion around sleep efficiency.

Thresholds are useful because they slow down the urge to react to one unusually bad or good week. Many sleep-restriction examples use a lower boundary near 85% and an expansion boundary near 90%, with small 15-minute changes. Real plans may use different limits, longer confirmation, or more cautious steps when daytime sleepiness, safety, or medical complexity is present.

The result should stay in the category of planning support. Sleep-window restriction can increase daytime sleepiness and may be inappropriate without clinical guidance for suspected sleep apnea, seizure risk, bipolar or mania risk, parasomnias, severe daytime impairment, safety-sensitive work, unstable shift schedules, medication changes, or other complex health factors.

How to Use This Tool:

Use the planner after weekly sleep-efficiency percentages have already been calculated from a consistent sleep diary. Enter weeks from oldest to newest so each row starts from the prior row's sleep window.

  1. Set Start sleep window to the current planned time in bed. The baseline row records that value after the minimum and maximum window bounds are applied.
  2. Choose a valid Fixed wake time, such as 07:00. Bedtime is calculated by counting backward from that wake anchor.
    If the wake time is blank or malformed, the planner reports Wake time must be a valid HH:MM value. and hides the result tabs until the time is fixed.
  3. Paste Weekly sleep efficiency values as 0 to 100 percentages separated by spaces, lines, commas, or semicolons. Non-numeric tokens trigger an Invalid efficiency value(s) message, and the first 26 valid weekly values are used.
  4. Set Low threshold and High threshold. Values below the low threshold build a compression streak, values at or above the high threshold build an expansion streak, and values between the two cutoffs hold the window.
  5. Open Advanced when the default rule is too reactive or too slow. Confirmation weeks controls how many qualifying weeks in a row are needed, Adjustment step sets the minute change, and the minimum and maximum window fields stop moves outside the selected range.
  6. Review Weekly Adjustment Plan before using any bedtime. Check Decision basis for each row, then use Adjustment Guidance and Adjustment Trajectory Chart to see whether the plan is stable or repeatedly moving.

A result is ready when the weekly table shows a row for each accepted value and Adjustment Outcome shows the final window, final bedtime, wake time, action counts, and confidence band.

Interpreting Results:

Adjustment Outcome is a compact summary of the rule run. It reports the final sleep window, final bedtime, wake time, number of planned weeks, action counts, adjustment step, follow-up cadence, and confidence band. Treat it as a consistency check for the entered data, not as proof that the schedule is clinically safe.

The weekly table is the audit trail. Observed SE is tested against the thresholds, Action says start, hold, expand, or compress, and Decision basis explains whether the row changed because a streak was confirmed or held because the value stayed inside the hold zone.

  • High confidence means the rule changed less often and stayed closer to the starting window. It does not mean the window is safe for every person.
  • Moderate confidence calls for a diary check, especially when values near a cutoff alternate from week to week.
  • Low confidence means the rule moved often or far from baseline. Recheck diary math, daytime alertness, drowsy-driving risk, and the selected window bounds before following another change.

Technical Details:

Sleep efficiency is a ratio, not a direct measure of sleep quality. It rises when the same amount of sleep occurs inside a shorter sleep opportunity and falls when more of the planned window is spent awake. That is why weekly diary consistency matters: changing the diary method can move the percentage even when sleep has not truly changed.

The adjustment rule is sequential. Week 2 starts from the window left by Week 1, not from the original baseline. A fixed wake time converts every window length into a bedtime, while selected minimum and maximum bounds prevent the rule from crossing practical safety limits.

Formula Core:

The core ratio and window update can be written as three linked calculations. SE is sleep efficiency, W is the sleep window in minutes, and Δ is the selected adjustment step.

SE = total sleep timetime in bed×100 Wnext = clamp(Wcurrent+Δ,Wmin,Wmax) bedtime = wake time-Wnext

For example, a 6-hour window ending at 07:00 has a 01:00 bedtime. If an expansion rule adds 15 minutes, the next window is 375 minutes and bedtime becomes 00:45. If a compression rule subtracts 15 minutes, the next window is 345 minutes and bedtime becomes 01:15.

Rule Core:

Sleep window threshold rule boundaries
Observed weekly SE Streak effect Confirmed action Boundary note
SE >= high threshold High streak increases and low streak resets. Expand by the selected adjustment step. The row still holds if expansion would exceed the maximum window.
SE < low threshold Low streak increases and high streak resets. Compress by the selected adjustment step. The row still holds if compression would go below the minimum window.
low threshold <= SE < high threshold Both streaks reset. Hold the current window. A hold-zone week cancels an unconfirmed high or low streak.

The stability score behind the confidence band penalizes both volatility and net movement. Frequent expand or compress rows lower the score, and a large final shift from the starting window lowers it further.

stability = clamp ( 100 - expand count+compress countweeks × 45 - |net shift minutes| × 0.35 , 0 , 100 )
Sleep window planner input limits and output bands
Item Accepted or displayed range Effect on the result
Weekly SE values 0 to 100%, first 26 valid values used Invalid tokens stop the plan until corrected.
Low threshold 70 to 95% Values below this cutoff count toward compression.
High threshold 75 to 99%, kept at least 1 point above the low threshold Values at or above this cutoff count toward expansion.
Confirmation weeks 1, 2, or 3 consecutive qualifying weeks Higher confirmation reduces reaction to one-week noise.
Confidence band High at 75+, Moderate from 50 to 74.9, Low below 50 Labels rule stability, not clinical success.

Limitations and Privacy:

The planner is an informational diary-review aid. It does not diagnose insomnia, calculate sleep efficiency from nightly diary fields, screen for other sleep disorders, or decide whether sleep restriction is appropriate for a particular person.

  • Use the same diary method across weeks before comparing sleep efficiency values.
  • Do not compress the window when daytime sleepiness, drowsy driving, hazardous work, caregiving duties, or fall risk makes reduced sleep opportunity unsafe.
  • Discuss suspected sleep apnea, seizure disorder, bipolar or mania risk, parasomnias, severe anxiety, medication changes, pain, or unstable shift work with a clinician before using window changes.
  • The calculation runs in the browser and does not need a remote sleep-data lookup. Treat entered diary values, downloaded files, copied JSON, and shared URLs as sensitive.

Worked Examples:

Default weekly sequence

With a 6h Start sleep window, 07:00 Fixed wake time, 85% low threshold, 90% high threshold, 1 confirmation week, and a 15-minute step, the sequence 82, 87, 91, 88, 84, 90 compresses in Week 1, holds in Week 2, expands in Week 3, holds in Week 4, compresses in Week 5, and expands in Week 6. The final window returns to 6h with a 01:00 bedtime, while the confidence band reflects the four non-hold moves.

Two-week confirmation

If Confirmation weeks is set to 2, a single 91% week does not expand the window. A second qualifying week such as 92% confirms the high streak and moves a 6h window to 6h 15m, changing bedtime from 01:00 to 00:45 for a 07:00 wake time. A hold-zone value between the two high weeks resets the streak.

Pasted value error

A pasted list such as 82, ninety, 88 does not produce a weekly plan because ninety is not a valid percentage. Replace it with 90 or remove it, then check Weekly Adjustment Plan before using any bedtime change.

Advanced Tips:

  • Use 2 or 3 Confirmation weeks when weekly sleep efficiency is noisy or when one bad week would otherwise trigger an unsafe compression.
  • Keep Low threshold and High threshold stable while testing a plan; changing cutoffs after seeing results can make old and new weeks hard to compare.
  • Choose a smaller Adjustment step when daytime alertness is a concern, and check the Decision basis column before assuming a hold is an error.
  • Use Adjustment Trajectory Chart to look for repeated back-and-forth movement. A jagged trajectory usually deserves diary review before another threshold change.
  • Set Follow-up cadence to cautious when compression rows appear more than once, because the guidance priorities will put safety review ahead of progression.

FAQ:

Does the planner calculate sleep efficiency from a diary?

No. Enter weekly sleep-efficiency percentages that were already calculated from diary data. The planner uses those percentages to decide hold, expand, or compress actions.

Why did a high-efficiency week still hold?

The high streak may not have reached the selected Confirmation weeks, or expansion may be blocked by Maximum window. Check Decision basis for that row.

Why keep the wake time fixed?

A fixed wake time keeps the morning anchor stable while the window changes. Expansion moves bedtime earlier, compression moves bedtime later, and the wake time stays the same.

What does Low confidence mean?

Low confidence means the rule changed the window often or moved far from the start window. It is a stability warning, not a diagnosis or a statement that the schedule is unsafe by itself.

Does follow-up cadence change the weekly math?

No. Follow-up cadence changes guidance timing and priority wording. The weekly table still uses the same thresholds, confirmation weeks, step size, and window bounds.

Glossary:

Sleep efficiency
Total sleep time divided by time in bed, expressed as a percentage.
Time in bed
The scheduled sleep opportunity from bedtime to the fixed wake time.
Fixed wake time
The morning anchor that stays unchanged while bedtime moves earlier or later.
Hold zone
The range from the low threshold up to, but not including, the high threshold.
Confirmation weeks
The number of consecutive qualifying weeks required before an expand or compress rule changes the window.
Net shift
The final difference between the starting sleep window and the last calculated window.