Tools · Sleep

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.

First, a health check

Tick everything that applies to you. Your answers are not sent anywhere.

Sleep diary

Enter your last 5–7 nights. Rough numbers are fine.

NightInto bedOut of bedTo fall asleep, minAwake in the night and morning, min
1
2
3
4
5
6
7

Defaults to the most common time in your diary. It does not change from day to day.

Looking for clock times based on ~90-minute sleep cycles? That is a different tool: it does not fit time in bed, it only counts hours. Sleep cycle calculator.

In the first 1–2 weeks daytime sleepiness usually rises. Do not drive, cycle in traffic or operate machinery when drowsy: stop, rest or let someone else take over. If you doze off in the day without meaning to, widen the window by 15–30 minutes and tell your doctor.

Nothing is stored or sent: everything runs in your browser, even offline after the first visit.

Sources checkedNot yet reviewed by a clinicianHow we review

How this was made: drafted with AI (Claude); we check every number and link against its source. Review by a clinician is in progress. When a reviewer signs a page, their name appears above. How we review

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

  1. Spielman AJ, Saskin P, Thorpy MJ. Treatment of chronic insomnia by restriction of time in bed. Sleep 1987;10(1):45–56
  2. 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
  3. 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

If things are hard right now

Resteady is not an emergency service. If you are in danger or thinking about harming yourself, call a crisis line or emergency services now. It is free and confidential.

Numbers can change. If a line does not answer, call 112 or your local emergency number.

Open SOSAll lines by country

  • EU / EEA112Emergency number
  • Ukraine7333Lifeline Ukraine
  • United States988Suicide & Crisis Lifeline
  • United Kingdom116 123Samaritans
  • Ireland116 123Samaritans
  • Germany0800 111 0 111TelefonSeelsorge
  • Spain024Línea 024
  • Poland116 123Telefon zaufania dla osób dorosłych w kryzysie
  • France3114Numéro national de prévention du suicide

Other countries: findahelpline.com — Free, confidential lines for every country.