CALCULATORCASTLE

Sleep Calculator

Find the optimal time to go to sleep or wake up based on sleep cycles.

About

Sleep Calculator

Sleep is a recurring state in which the body and mind are at rest, with reduced muscle activity, less interaction with the surroundings and a lowered ability to react to stimuli. That last part is one of the things that separates sleep from simply lying still.

Sleep cycles

A sleep cycle is the oscillation between non-REM and REM sleep. Timing is driven largely by hormonal signals from the circadian clock, which keeps a regular rhythm matched to outside cues such as daylight, and carries on running even when those cues disappear.

Jet lag is the obvious example. Rapid long-distance travel leaves the circadian rhythm out of step with local time, so the traveller feels it is earlier or later than their body expects, and sleep suffers until the two resynchronise.

Ideally sleep follows the circadian clock, but it is pushed around by light, social timing such as when other people are awake and when work starts, naps, genetics and more.

REM and non-REM sleep

The brain uses considerably less energy asleep than awake, particularly in non-REM sleep. REM sleep is named for the rapid eye movements that characterise it, along with near-total paralysis of the body and the occurrence of dreams. The two categories are very different states.

The body cycles between non-REM and REM over roughly 90 minutes on average, and this should happen 4 to 6 times across a good night. Non-REM comes first and deepens into slow-wave sleep. Body temperature and heart rate fall, the brain uses far less energy while restoring its supply of adenosine triphosphate, and growth hormone is secreted, which matters a great deal during development.

REM takes up a smaller share of the night and is when dreams and nightmares usually occur. Being deprived of it produces anxiety, irritability, hallucinations and difficulty concentrating. After deprivation the body makes more attempts to enter REM and spends longer there once it does, an effect called REM rebound, which is consistent with REM being necessary rather than optional. It is still not fully understood, and in some specific cases short-term REM deprivation has transient positive effects.

The two are not evenly spread. Slow-wave sleep is concentrated in the first two or three cycles of the night, while REM periods lengthen towards morning. A cycle at 2am and a cycle at 6am contain very different things, which is why cutting a night short costs mostly REM, and why a late night costs mostly deep sleep.

How the calculator works

Bedtime = wake time - (cycles x cycle length) - time to fall asleep

where:

  • cycles is the number of complete cycles you want, usually 5 or 6
  • cycle length defaults to 90 minutes and can be changed in the settings
  • time to fall asleep defaults to 15 minutes, the average sleep latency for a healthy adult

To wake at 6:00 AM with 90-minute cycles and 15 minutes to drop off, five cycles means going to bed at 10:15 PM and six means 8:45 PM. The point is to have the alarm land at the end of a cycle, in light sleep, rather than in the middle of slow-wave sleep, which is what produces that heavy, disoriented feeling on waking.

The second calculator does something simpler: it works out a bedtime or wake time for a set number of hours, without any cycle arithmetic. Note that it does not add time to fall asleep, so deduct that yourself.

Treat 90 minutes as an average rather than a fact about you. Real cycles run from about 70 to 120 minutes and vary within a single night, usually lengthening towards morning. If waking at these times leaves you groggy, adjust the cycle length in the settings by five or ten minutes and see whether it improves.

Sleep quality

Sleep quality can be measured by how hard it is to fall asleep and stay asleep, and how many times you wake in a night. It can also be judged subjectively, by how rested you feel on waking.

Poor quality disrupts the cycle and the transitions between stages. Good quality needs the drive to sleep balanced against the circadian element, and ideally the timing works out so that peak melatonin and minimum core body temperature both fall after the middle of the sleep episode and before you wake.

Sleep efficiency, the share of time in bed actually spent asleep, is the measure clinicians use. Above 85% is normal. Consistently below that, despite enough time in bed, is worth investigating.

How much sleep do I need?

Sleep is far from perfectly understood, and requirements vary by age and by individual. Someone getting enough should have no daytime sleepiness or dysfunction, which is a better test than any number.

Broadly, researchers have found 6 to 7 hours a night correlates with a range of positive health outcomes, though many other factors influence those outcomes too. People sleep less as they age, with newborns sleeping far longer than adults; the gap narrows through childhood and requirements resemble those of adults from around age 5.

Age groupRecommended hours per day
0 to 3 months14 to 17 hours
4 to 12 months12 to 16 hours per 24, including naps
1 to 2 years11 to 14 hours per 24, including naps
3 to 5 years10 to 13 hours per 24, including naps
6 to 12 years9 to 12 hours per 24
13 to 18 years8 to 10 hours per 24
18 to 60 years7 or more hours per night
61 to 64 years7 to 9 hours
65 years and older7 to 8 hours

Those are CDC figures. The band is wide on purpose, because the genuine requirement differs between people. A very small number carry a variant of the DEC2 gene and function normally on around six hours; almost everyone who believes they belong to that group does not, and is simply used to being tired.

Sleep debt and catching up

Losing an hour a night through the week leaves roughly five hours of deficit by Friday. Some of it can be recovered, and recovery sleep is disproportionately made up of slow-wave sleep as the body prioritises what it missed most. Reaction time and mood improve after a long lie-in.

Not everything recovers. Studies of chronic restriction find that measures of attention stay impaired even after recovery sleep, and people consistently rate themselves as less impaired than testing shows they are. That gap is what makes tired driving dangerous: the judgement needed to notice the problem is itself impaired.

Long weekend lie-ins also shift the circadian clock later, which makes Monday morning harder. A difference of more than about an hour between weekday and weekend wake times is sometimes called social jet lag, and holding wake time steady is the single most effective habit for a stable rhythm.

Practical timing

Wake time anchors everything. Light in the first hour after waking sets the clock for the following night, and it does more for sleep timing than anything done in the evening.

Caffeine has a half-life of around five hours, so a 3pm coffee still leaves roughly a quarter of the dose in your system at 1am. Alcohol shortens the time it takes to fall asleep and then suppresses REM in the second half of the night, which is why sleep after drinking feels unrefreshing.

Core body temperature has to fall for sleep to begin, which is why a cool bedroom, around 18°C, helps, and why a warm bath an hour or two before bed also helps: the blood vessels dilate afterwards and shed heat faster.

If you have not fallen asleep after about twenty minutes, get up and do something quiet in dim light rather than lying there. Staying in bed awake teaches the brain to associate the bed with wakefulness, which is the mechanism behind a good deal of persistent insomnia.

When to see a doctor

Persistent trouble falling or staying asleep for more than three months, loud snoring with pauses in breathing, falling asleep unintentionally during the day, or an irresistible urge to move the legs at night all warrant a proper assessment. Sleep apnoea in particular is common, frequently undiagnosed, and very treatable once identified.

Common questions

Frequently asked questions

About 90 minutes on average, though real cycles run from roughly 70 to 120 minutes and lengthen towards morning. The calculator uses 90 by default and lets you change it in the settings if that does not suit you.

Five to six complete cycles a night, which is 7.5 to 9 hours at 90 minutes each. Four is workable occasionally and anything below that leaves a deficit that accumulates across the week.

With 90-minute cycles and 15 minutes to fall asleep, 10:15 PM gives five cycles and 8:45 PM gives six. Both put the alarm at the end of a cycle rather than in the middle of deep sleep.

Usually because the alarm landed in the middle of slow-wave sleep rather than at the end of a cycle. Waking from deep sleep produces sleep inertia, that heavy disoriented feeling, which can last twenty to thirty minutes regardless of how long you slept.

No. It is a population average. Cycles vary between people and within a single night, generally getting longer towards morning. If the suggested times leave you groggy, adjust the cycle length by five or ten minutes and compare.

Deep sleep, or slow-wave sleep, is non-REM: temperature and heart rate fall, the brain uses little energy and growth hormone is released. REM involves rapid eye movements, near-total muscle paralysis and dreaming. Deep sleep dominates early cycles and REM dominates late ones.

The CDC says 7 or more hours a night for adults aged 18 to 60, 7 to 9 for 61 to 64, and 7 to 8 from 65. The better test is whether you have daytime sleepiness or dysfunction, which no number can answer for you.

Partly. Recovery sleep is disproportionately slow-wave, and reaction time and mood do improve. Studies of chronic restriction find attention stays impaired even after catching up, and long lie-ins shift your clock later, which makes Monday harder.

Around 15 minutes is typical for a healthy adult, which is the calculator default. Consistently under 5 minutes usually signals real sleep deprivation. Regularly over 30 is worth raising with a doctor.

It shortens the time to fall asleep and then damages the rest of the night, suppressing REM and fragmenting the second half. That is why sleep after drinking leaves you unrefreshed even when the hours look adequate.