Sleep Cycle and Hypnogram Visualizer
Set a bedtime and an alarm and watch the night’s sleep cycles drawn as a hypnogram: deep sleep early, REM late, and the windows where waking is easiest.
Visualiser
Drag the moon or the sun to move your bedtime or alarm, or drag across the night to read any moment. Arrow keys step through it. Space plays and pauses.
Bedtimes to wake at 07:00 as a cycle ends
Alarms at a cycle end, in bed at 23:00
Plain 90-minute calculators say 21:45, 23:15, 00:45, missing the shorter first cycle. Every time is an average that can drift ±22 minutes by the fifth cycle, as the shaded windows show.
Hypnogram from 23:00 to 07:00. Asleep at 23:15, 5 complete cycles, the last ending at 06:35. Deep sleep by cycle: 42.5, 26.5, 13.5, 4.5, 0 minutes. REM by cycle: 9, 15.5, 22.5, 29.5, 33.5 minutes. At the alarm: N2, light sleep. Below it, an illustrative, synthetic polysomnography panel shows ten seconds of EEG, EOG and chin EMG for the epoch under the cursor.
- N1 3%
- N2 54%
- N3 19%
- REM 24%
- Awake 5 min
- Complete cycles Cycles that end before the alarm. The last one ends at 06:35 on average, 25 min before it.
- 5
- Total sleep Asleep from 23:15 to 07:00, 7 h 45 min, less 5 min awake in the brief arousals between cycles. Sleep efficiency 96 percent.
- 7 h 40 min
- Deep sleep, N3 Slow-wave sleep, the stage hardest to wake from. Young adults spend 13 to 23 percent of their sleep in it (Carskadon and Dement), almost all of it in the first cycles.
- 87 min, 19%
- REM sleep Rapid eye movement sleep, 20 to 25 percent of a young adult’s sleep. Each REM period is longer than the last.
- 110 min, 24%
- Stage at the alarm The stage of the last 30 seconds before the alarm in the average night drawn above.
- N2 light sleep
- N3 at the alarm How many of 256 nights with varied cycle lengths are in N3 at the alarm. Waking from N3 brings the most grogginess, sleep inertia.
- 0% of nights
Sleep pressure, Process S, through the day before and the night
- Sleep pressure, Process S
- Start of each cycle
- Floor below which there is no N3
- Bedtime, 23:00
A demonstration, not a diagnosis. This draws a model of an average healthy adult’s night and knows nothing about yours. Persistent poor sleep, loud snoring with pauses in breathing, or sleepiness in the day are reasons to see a clinician.
Citing this tool
Last updated . Add the date you accessed it as well, which a citation of a page that can change asks for. If a specific result matters, cite the permalink from the tool’s share row instead of this page: it reproduces the exact parameters.
On the syllabus: MCAT, 6B: Making sense of the environment.
The equation
Borbély (1982), two-process model, with time constants from Daan, Beersma and Borbély (1984)
What are the stages of a human sleep cycle?
Human sleep architecture recurs in ultradian cycles of about 70 to 120 minutes alternating between NREM sleep (Stage N1 light sleep, Stage N2 sleep spindles and K-complexes, Stage N3 deep slow-wave delta sleep) and REM sleep (rapid eye movement sleep, characterised by a low-voltage desynchronised EEG, vivid dreaming and skeletal muscle atonia).
A night’s sleep is not one long dive but a run of cycles. Each starts in N1, the light doze of dropping off, sinks through N2 into N3, deep or slow-wave sleep, climbs back to N2 and ends in REM sleep, the stage of rapid eye movements and most vivid dreams. Sleep laboratories score the night in 30-second epochs under the rules of the American Academy of Sleep Medicine, and a brief arousal between one cycle and the next is normal and usually forgotten. Carskadon and Dement give 70 to 120 minutes for a healthy adult’s cycle, with the first usually the shortest, so this tool makes the first cycle 10 minutes shorter than the average you set.
Set a bedtime and an alarm, or the time you need to wake, and the tool draws the night that follows as a hypnogram, works out the stages it adds up to, and lists the bedtimes and alarms that land at the end of a cycle. Press Play to sweep through the night an hour every 1.5 seconds, drag across the hypnogram to stop at any moment, or drag the moon and the sun along the top line to move the bedtime and the alarm.
How to read the hypnogram
Time runs left to right, and each row is a stage: wake at the top, then REM, N1, N2 and N3. REM sits just under wake, as clinical hypnograms draw it, so depth runs down the page and every dive and climb is one cycle. Colour carries depth too: N3 in solid blue, N2 in a paler blue, N1 in grey, REM in violet and wake in amber, the colours of the moon and the sun that set the bedtime and the alarm. The pale amber columns are the wake windows, each cycle’s average end give or take one standard deviation, and the N3 row is shaded blue wherever deep sleep is likely across 256 nights whose cycles vary in length. The dashed curve is sleep pressure, and the dotted line under it the level below which the model gives no deep sleep. The legend under the panel switches each of the three on and off.
The panel underneath shows ten seconds of what a scorer would see for the epoch under the cursor, on three channels: the EEG, the eye movements of the EOG and the muscle tone of the chin. It is illustrative and synthetic, never a recording, built to the features the AASM manual scores each stage by: alpha waves of 8 to 13 Hz in relaxed wake; theta of 4 to 7 Hz, a vertex sharp wave and slow rolling eye movements in N1; K complexes and sleep spindles of 11 to 16 Hz, lasting at least half a second, in N2; slow waves of 0.5 to 2 Hz and over 75 µV, filling at least 20 percent of the epoch, in N3; and in REM, low-voltage mixed frequencies with sawtooth waves, rapid eye movements and the lowest chin tone of the night. Each EEG band is a range of frequency components, the same idea the Fourier series visualiser builds a wave from.
Worked example: the default night
Bed at 23:00, alarm at 07:00, 15 minutes to fall asleep and 90-minute cycles, for a 25-year-old who has been awake 16 hours. Sleep begins at 23:15. The first cycle runs 80 minutes to 00:35 and each later one 90 minutes, so the cycles end at 02:05, 03:35, 05:05 and 06:35: five complete cycles, and the alarm comes 25 minutes into the sixth, in N2, light sleep.
| Cycle | From | To | Sleep pressure at its start | N3 (min) | REM (min) |
|---|---|---|---|---|---|
| 1 | 23:15 | 00:35 | 0.623 | 42.5 | 9 |
| 2 | 00:35 | 02:05 | 0.454 | 26.5 | 15.5 |
| 3 | 02:05 | 03:35 | 0.318 | 13.5 | 22.5 |
| 4 | 03:35 | 05:05 | 0.222 | 4.5 | 29.5 |
| 5 | 05:05 | 06:35 | 0.155 | 0 | 33.5 |
From 23:15 to 07:00 is 7 h 45 min, and five one-minute arousals between cycles leave 7 h 40 min, or 460 minutes, of sleep, a sleep efficiency of 96 percent. Of those, 87 minutes are N3, 19 percent; 110 are REM, 24 percent; 15 are N1, 3 percent; and 248 are N2, 54 percent. Every one sits inside the ranges Carskadon and Dement give for young adults: N1 2 to 5 percent, N2 45 to 55, N3 13 to 23 and REM 20 to 25. The first REM begins at 00:26, 71 minutes after sleep onset, and the best alarm within half an hour of 07:00 is 06:35, the end of the fifth cycle.
Why deep sleep comes early and REM late
Two processes run the night, as Borbély proposed in his two-process model of 1982. Process S is sleep
pressure, which builds while you are awake and drains while you sleep. With the time constants Daan,
Beersma and Borbély fitted in 1984, it rises as S = 1 − (1 − S_wake) e^(−t / 18.2 h) from its
value on waking, and falls as S = S₀ e^(−t / 4.2 h) from its value S₀ at sleep onset, so
asleep it halves every 4.2 × ln 2 = 2.9 hours. In
the model’s steady state of 16 hours awake and 8 asleep, S is 0.093 on waking; after 16 hours awake,
up at 07:15 and asleep at 23:15, it has reached 0.623. By the starts of cycles 2 to 5 it has fallen to
0.454, 0.318, 0.222 and 0.155.
Deep sleep follows that pressure. The minutes of N3 in a cycle are 94 × (S − 0.173), with S
at the cycle’s start, so the first cycle gets 94 × (0.623 − 0.173) = 42.3 minutes, 42.5 to the nearest
epoch, and once S is below 0.173 there is none: the fifth cycle starts at 0.155 and has no deep sleep.
The constants 94 and 0.173 are a calibration, chosen so the default night’s deep sleep lands inside
the young-adult range, not a measurement. Stay up longer and the pressure builds further: after 24
hours awake S starts the night at 0.757, the first cycle gets 55 minutes of N3, and deep sleep fills
26 percent of the night’s sleep, the rebound that follows a sleepless night.
REM follows the body clock as well as falling pressure. Its drive in each cycle mixes how far pressure has fallen since sleep began with a circadian REM propensity that peaks near the minimum of core body temperature, about two hours before habitual waking (Czeisler and colleagues, 1980; Dijk and Czeisler, 1995); the model takes your alarm as that habitual time, so for 07:00 the peak is at 05:00. Both rise through the night, so REM lengthens from 9 minutes in the first cycle to 33.5 in the fifth. A short night keeps its deep sleep and gives up light sleep and REM, as a study that cut young adults’ sleep to 4 hours found (Brunner and colleagues, 1990). Go to bed at 01:00 after 18 hours awake, keeping the 07:00 alarm, and the night holds 82.5 minutes of REM instead of 110 and 152 of N2 instead of 248, but 96.5 minutes of N3 instead of 87, because the longer day built more pressure and deep sleep comes first.
How age changes the night
Ohayon and colleagues’ meta-analysis of 65 studies, covering 3,577 people aged 5 to 102, found that in adults the shares of slow-wave sleep and REM fall with age while those of stage 1 and stage 2 rise, that waking after sleep onset increases, and that past 60 only sleep efficiency keeps changing. In the paper’s summary figure of minutes in each stage, slow-wave sleep falls from about 18 percent of sleep in the 25-year-old group to about 14 percent in the 65-year-old group, REM from about 23 to 19 percent, and waking after sleep onset rises from about 19 to 58 minutes, roughly 10 minutes a decade.
The model follows those trends from 18 to 60 and then holds the night as it is. Set the age to 60 and the default night keeps its five cycles, but its arousals grow longer and more frequent, with 39.5 minutes awake after sleep onset instead of 5, and its sleep efficiency falls to 89 percent. N3 drops from 19 to 15 percent of sleep, REM from 24 to 20 percent, and N2 rises from 54 to 61 percent. N1 keeps its 15 minutes, as stage 1 kept its minutes between the paper’s two groups, so its share rises only because there is less sleep. The meta-analysis did find that falling asleep takes longer with age, but in its summary figure the 25 and 65-year-old groups took about the same time, so the time to fall asleep stays your own setting.
Bedtimes, alarms, and why every calculator is an estimate
The planner answers the question both ways round. It lists the bedtimes whose fourth, fifth or sixth cycle ends at your wake-up time, which is the wake time, less the time to fall asleep, less n × 90 − 10 minutes, and the alarms at which the fourth, fifth and sixth cycles end after your bedtime, 05:05, 06:35 and 08:05 after 23:00. For 07:00 with 15 minutes to fall asleep that is 00:55, 23:25 and 21:55. Most sleep calculators count whole 90-minute cycles from sleep onset and say 00:45, 23:15 and 21:45, ten minutes earlier, because they ignore the shorter first cycle. With 100-minute cycles the bedtimes move to 00:15, 22:35 and 20:55.
Any of those times is an average. Real cycles vary from night to night and cycle to cycle, which the model treats as a standard deviation of 10 minutes on each cycle’s length, its stated choice. The end of the n-th cycle is a sum of n of them, so its spread grows as 10√n minutes: 10 minutes for the first cycle, 14.1 for the second, 17.3 for the third, 20 for the fourth and 22.4 for the fifth. That is why the shaded windows widen through the night, and why the tool shows windows rather than a single best minute. Aiming for the end of a cycle helps mostly by keeping the alarm out of deep sleep: waking from slow-wave sleep brings the most grogginess, known as sleep inertia, waking from REM less, and waking from N1 or N2 the least (Tassi and Muzet, 2000). So the aim matters most after a short night, when the alarm can fall in a cycle that still has deep sleep. By the last cycles of a full night deep sleep has almost gone, and the exact minute matters much less.
Which parts of the brain run the cycle
The timing comes from the hypothalamus. Its suprachiasmatic nucleus is the body clock, set each day by light reaching the eyes, and it signals the pineal gland to release melatonin in the evening. Sleep itself is switched on by the ventrolateral preoptic nucleus, also in the hypothalamus, whose neurons inhibit the brain’s arousal systems, while orexin neurons in the lateral hypothalamus keep waking and sleeping stable, so that the switch between them is quick and clean (Saper, Scammell and Lu, 2005). Within sleep, networks in the pons switch REM sleep on, together with the paralysis of the body’s muscles that keeps dreams from being acted out. Each link opens the 3D brain with that structure selected.
What the model leaves out
- Naps, jet lag, shift work and early alarms. The body clock is set by the alarm and the pressure by one day awake, so a nap, a new time zone or a night shift is not modelled, and neither is a change of daylight saving time. An alarm earlier than usual is taken as your usual waking time too, so the model moves the REM peak earlier with it; a real early alarm leaves the body clock where it was and cuts off the end of the night, where the longest REM periods are.
- Alcohol, caffeine and medicines. Each can shorten or suppress stages. Caffeine and most medicines leave the body at the rate their half-lives set, which the pharmacokinetics simulator shows for repeated doses, but alcohol is cleared at a roughly steady rate, because the liver’s enzyme for it is saturated after a drink or two.
- Sleep disorders. Insomnia, sleep apnoea, narcolepsy and the rest change the night in ways a model of healthy sleep cannot show.
- Dreams, and individual differences. Two healthy people of the same age differ more than this model’s settings can express, and nothing here describes what anybody dreams.
A demonstration, not a diagnosis
Everything on this page is a model of an average healthy adult’s night, drawn to teach how sleep is built. It cannot measure your sleep, and a wrist tracker’s hypnogram is an estimate too, made from movement and heart rate rather than the EEG that stages are scored from. Persistent poor sleep, loud snoring with pauses in breathing, or sleepiness in the day are reasons to see a clinician.
Common mistakes
- Treating 90 minutes as a rule. It is an average. Healthy cycles run 70 to 120 minutes, the first is usually shorter, and with the model’s 10 minutes of spread on each cycle the end of the fifth is uncertain by about 22 minutes either way.
- Thinking REM only comes at the end. Every cycle ends in REM. The default night’s first REM begins at 00:26, 71 minutes after sleep onset; REM periods simply grow longer towards morning.
- Thinking deep sleep is spread evenly. In the default night, 69 of its 87 minutes of N3 come in the first two cycles, and the fifth cycle has none.
- Blaming every groggy morning on the alarm’s timing. Waking from N3 feels worst, which is sleep inertia, but by morning deep sleep has almost gone: at 07:00 in the default night none of the 256 varied nights is in N3.
Common questions
What are the stages of a sleep cycle?
A sleep cycle runs through the three stages of non-REM sleep, N1, N2 and N3, and then REM sleep, scored in 30-second epochs under the American Academy of Sleep Medicine’s rules. N1 is the light doze of falling asleep, N2 brings sleep spindles and K complexes, and N3 is deep, slow-wave sleep; a cycle goes N1, N2, N3, back to N2 and then REM. In the default night here, bed at 23:00 and alarm at 07:00, five complete cycles end at 00:35, 02:05, 03:35, 05:05 and 06:35. A brief arousal between cycles is normal and usually forgotten.
How long is a sleep cycle?
About 90 minutes on average, but healthy adults run anywhere from 70 to 120 minutes, and the first cycle is usually the shortest (Carskadon and Dement). This tool makes the first cycle 10 minutes shorter than the average, so with 90-minute cycles and sleep from 23:15 the fifth cycle ends at 06:35, 440 minutes in. Cycles also vary from night to night: with a standard deviation of 10 minutes on each one, the end of the fifth cycle is uncertain by about 22 minutes either way, which is why the tool’s wake windows widen through the night.
How much deep sleep and REM sleep is normal?
In young adults N1 takes 2 to 5 percent of sleep, N2 45 to 55 percent, N3 13 to 23 percent and REM 20 to 25 percent (Carskadon and Dement). The default night here, a 25-year-old asleep from 23:15 to 07:00, has 87 minutes of N3, 19 percent, and 110 minutes of REM, 24 percent. Both fall with age: by 60 the same night has 15 percent N3 and 20 percent REM, following the trends in Ohayon and colleagues’ meta-analysis of 65 studies. These are averages for healthy adults, not targets, and one night says little about anybody’s sleep.
Why does deep sleep come early in the night and REM late?
Because they follow different processes. Deep sleep follows sleep pressure, Borbély’s Process S, which builds while you are awake and drains during sleep with a time constant of 4.2 hours: in the default night it falls from 0.62 at sleep onset to 0.16 by the start of the fifth cycle, and the model gives no N3 once it is below 0.17. REM follows the body clock as well as falling pressure, and is most likely near the minimum of core body temperature, a couple of hours before habitual waking. So the first cycle has 42.5 minutes of N3 and 9 of REM, and the fifth has no N3 and 33.5 minutes of REM.
Which part of the brain controls the sleep cycle?
Several parts, working together. The suprachiasmatic nucleus of the hypothalamus is the body clock that times sleep across the day, the ventrolateral preoptic nucleus switches sleep on by inhibiting the brain’s arousal systems, and orexin neurons in the lateral hypothalamus keep waking and sleeping stable (Saper, Scammell and Lu, 2005). Within sleep, networks in the pons switch REM sleep on, together with the muscle paralysis that comes with it. The pineal gland adds melatonin in the evening, on the body clock’s signal.
Does a sleep cycle calculator really work?
Only as an estimate. A calculator assumes every cycle is the same length, but real cycles vary, and with 10 minutes of spread on each cycle the end of the fifth is uncertain by about 22 minutes either way, so a single “best” minute is false precision. Most calculators also ignore that the first cycle is shorter, so for a 07:00 alarm with 15 minutes to fall asleep they suggest 21:45, 23:15 or 00:45 where this model gives 21:55, 23:25 or 00:55. Aiming for the end of a cycle helps mostly by keeping the alarm out of deep sleep, the stage that brings the most grogginess on waking, called sleep inertia. That matters most after a short night, because by the end of a full one deep sleep has almost gone.
What is a hypnogram?
A hypnogram is a graph of sleep stage against time through the night, the summary a sleep study draws from polysomnography. Clinical hypnograms put wake at the top, then REM, N1, N2 and N3, so the deepest sleep is lowest and each dive and climb is one cycle. This one draws the default night from 23:00 to 07:00 in 30-second epochs, with most of its deep sleep in the first two cycles and its longest REM periods in the last two. It is a model of an average healthy night, not a recording, and it diagnoses nothing.