Sleep window calculator: sleep efficiency and time in bed from your diary
A sleep window is time in bed that matches how much you actually sleep. The calculator takes a 5–7 night diary, works out your average sleep and efficiency (sleep ÷ time in bed) and suggests a window: average sleep + 30 minutes, never less than 5 hours 30 minutes, anchored to a fixed rise time. Health check first: reducing time in bed is not for everyone.
Nothing is stored or sent: everything runs in your browser, even offline after the first visit.
What to do tonight
- If you can't sleep for about 15–20 minutes, get up, go to dim light and come back when you feel sleepy.
- Do not watch the clock: put the phone away and turn the clock face round.
- In the morning, note when you went to bed, when you got up and roughly how long you were awake.
What not to do
- Do not go to bed early to “catch up” or lie in — it dilutes sleep pressure.
- Do not nap in the day while you are setting up the window.
- Do not cut time in bed below 5 h 30 min.
- Do not drive drowsy.
- Do not change sleeping pills on your own.
Afterwards: week by week
- Keep the diary going — two minutes every morning.
- Recalculate efficiency once a week and change the window only by the rule, never at night.
- Keep the same rise time after a bad night and at weekends.
When to see a doctor
- Loud snoring with pauses in breathing, morning headaches, dozing off in the day without meaning to.
- Poor sleep has lasted more than three months and is not shifting.
- Along with poor sleep — low mood, hopelessness or thoughts of harming yourself.
- Anything from the health check above.
How it works
If you spend nine hours in bed and sleep six, the brain learns that bed is a place for being awake. A sleep window brings time in bed close to your real sleep for a while: sleep pressure builds, and within a week or two most people fall asleep faster, wake less and sleep more solidly. Then the window is widened gradually — 15 minutes at a time.
The arithmetic: time in bed = from “into bed” to “out of bed”; sleep = time in bed minus minutes to fall asleep and minutes awake; efficiency = average sleep ÷ average time in bed × 100%. Window = average sleep + 30 minutes, rounded to 15 minutes, never less than 5 h 30 min. Counting back the window from your fixed rise time gives the earliest bedtime.
This is a shortened version of one step of the sleep programme. The sleep window is part of the cognitive-behavioural approach to insomnia (CBT-I), recommended by clinical guidelines. The first weeks are hard — which is why there is a health check and a driving rule here.
Sources
- Spielman AJ, Saskin P, Thorpy MJ. Treatment of chronic insomnia by restriction of time in bed. Sleep 1987;10(1):45–56
- Edinger JD, Arnedt JT, Bertisch SM, et al. Behavioral and psychological treatments for chronic insomnia disorder in adults: an American Academy of Sleep Medicine clinical practice guideline. J Clin Sleep Med 2021;17(2):255–262
- Kyle SD, Miller CB, Rogers Z, Siriwardena AN, MacMahon KM, Espie CA. Sleep restriction therapy for insomnia is associated with reduced objective total sleep time, increased daytime somnolence, and objectively impaired vigilance. Sleep 2014;37(2):229–237