How Sleep Works: What Happens to Your Body When You Sleep?

We receive free products to review and participate in affiliate programs. See our disclosure page for more information.

There are so many things to consider when it comes to getting good sleep, from sticking to a regular bedtime and wakeup time to creating a relaxing sleep environment with a comfortable mattress. Another major factor in successful sleep? What happens to your body while you sleep.

Want to learn more about all things sleep science from what happens to your body when you sleep to if yawning is contagious? Keep reading to understand the ways in which sleep affects our lives!

Jump To

The Brain | Immune SystemHormones | Organs & Muscles | Sleep Cycles | Other Crazy Things That Happen | Bottom LineFAQs | Learn More about How Sleep Works

How Sleep Works

When falling asleep at night, it might feel like your brain and body are “shutting down” or switching off for a few hours. In fact, a variety of complicated things happen in your body when you’re asleep — both obvious and not-so-obvious. Yes, you’re dreaming (which you may or may not remember) and snoring lightly or… not so lightly. But you are also consolidating memories, repairing muscles and cells, and so much more.

While you sleep, your body moves through different sleep stages in two types of sleep: Non-REM sleep (NREM) and rapid eye movement sleep (REM). You spend roughly 75% of your sleeping time in NREM sleep, which is sometimes also called slow-wave sleep (SWS).

RELATED: The Complete Guide to Your Sleep Cycle

sleep stages play a role in our body's functions

The National Institute of Neurological Disorders and Stroke describes the different sleep stages as follows:

  • Stage 1 sleep is an extremely light stage, and it’s fairly easy to be woken up.
  • During Stage 2 sleep, body temperature drops, and breathing and heart rate become regular.
  • Stage 3 sleep is described as the “deepest and most restorative sleep.” During this stage, blood pressure drops, muscles relax, breathing slows down, and hormones are released.
  • Finally, you reach REM sleep, also known as Stage 4 sleep, which first happens about 90 minutes after falling asleep. This stage is characterized by your eyes moving back and forth — hence the name, rapid eye movement. During REM sleep, your breathing can speed up and become irregular, and dreaming can occur as your brain is extremely active. “Signals are sent to the brain’s cerebral cortex, which is responsible for learning, thinking, and organizing information,” the National Institutes of Health (NIH) explains. “Signals are also sent to the spinal cord to shut off movement, creating a temporary inability to move the muscles (‘paralysis’) in the arms and legs.”
  • After a period of REM sleep, one full sleep cycle is complete and Stage 1 sleep starts again.

In each of these stages, different things happen in your brain and muscles. Plus, your hormones and nervous system are active throughout the night. This piece will cover what’s going on in various parts of your body while you are sleeping, from brain activity to muscle repair, the functions of different organs, and more.

The Brain

As you can imagine, a lot is going on inside the brain during sleep — and not just when you are dreaming. According to the NIH, different sleep stages are associated with different brain wave activity. Your brain waves slow down through Stage 1 and Stage 2, reaching their slowest point in Stage 3 sleep. But when you reach REM sleep, your brain activity “becomes closer to that seen in wakefulness.” And some people do actually “act out” their REM dreams, physically moving their bodies around while they sleep.brain activity during sleep

“We do know that a small group of cells in the brain stem, called the subcoeruleus nucleus, controls REM sleep,” a Scientific American article explains. “When these cells become injured or diseased, people do not experience the muscle paralysis associated with REM sleep, which can lead to REM sleep behavior disorder—a serious condition in which the afflicted violently act out their dreams.”


Sleep is also linked to memory consolidation. Harvard Health’s Healthy Sleep website breaks down learning and memory into three steps: Acquisition (introducing new information to the brain), consolidation (making a memory stable) and recall (the ability to access the information or memory after it has been introduced and stabilized).

“Each of these steps is necessary for proper memory function,” the site explains. “Acquisition and recall occur only during wakefulness, but research suggests that memory consolidation takes place during sleep through the strengthening of the neural connections that form our memories. Although there is no consensus about how sleep makes this process possible, many researchers think that specific characteristics of brain waves during different stages of sleep are associated with the formation of particular types of memory.”

Plus, how well-rested you are can affect your acquisition and consolidation before learning, too. “We’ve learned that sleep before learning helps prepare your brain for the initial formation of memories,” Dr. Matthew Walker, a sleep scientist at the University of California, Berkeley, told the NIH’s News In Health. “And then, sleep after learning is essential to help save and cement that new information into the architecture of the brain, meaning that you’re less likely to forget it.”

Body Temperature Regulation

The brain also helps regulate body temperature during sleep, via a small portion of the brain called the hypothalamus. According to MedLine Plus, the hypothalamus helps regulate temperature along with appetite, sex drive, and the sleep-wake cycle. Your body temperature starts to lower in Stage 2 sleep, thanks to cues from your brain.

Research published in the journal Neuroscience Research in 2017 further explains the relationship between the hypothalamus and your sleep-wake cycle. The paper identifies two types of neurons in the hypothalamus, one type “a crucial component for maintenance of wakefulness” and the second “implicated in the regulation of sleep/wakefulness.”


And, of course, your brain is involved in dreaming. No one can say for sure exactly why we dream or what the purpose of dreaming is, but some research says that dreaming is linked to memory consolidation. According to LiveScience, analyzing brain waves can reveal whether or not someone is dreaming, as proven by research published in 2017. “The researchers found that, when the participants were dreaming, they showed a decrease in low-frequency brain waves, and an increase in high-frequency brain waves, in the posterior hot zone, compared with when they weren’t dreaming. They found this pattern regardless of whether the participants were dreaming during REM or non-REM sleep.”


One major hormone involved with sleep is melatonin. The University of Rochester Medical Center website explains that melatonin is a hormone made by the pineal gland, and melatonin secretion is controlled by light exposure. Research published in the British Journal of Pharmacology in 2018 on the relationship between melatonin and the circadian body clock says that the “light‐inhibited production of melatonin conveys the message of darkness to the clock and induces night‐state physiological functions, for example, sleep/wake blood pressure and metabolism.”
hormones and sleep are connected

The relationship between melatonin and light is the reasoning behind many common sleep hygiene recommendations. For example, have you ever been told to avoid looking at electronic screens that emit blue light for at least an hour before bed? That’s because that type of light can interfere with melatonin secretion, making it more difficult for you to fall asleep. Many devices now offer “night mode” to address this issue, but it’s still ideal to ditch your phone, tablet, or TV for a book or audiobook when you are winding down before bed.

Knowing about melatonin secretion and light can also help you tackle jet lag and daytime sleepiness. If you find yourself incredibly tired during the day, because of jet lag or for whatever other reason, a short walk in the sunshine helps remind your body that it’s daytime and keeps you awake. Similarly, when you do go to bed, keeping your room as dark as possible helps cue melatonin to help you drift off.

According to the Hormone Health Network, cortisol, a hormone released in response to stress, is linked to sleep as well. Research suggests that sleep deprivation is linked to higher cortisol levels — associating sleep deprivation with “immune compromise, cognitive impairment, and metabolic disruption,” the Dartmouth Undergraduate Journal of Science says.

Immune System

sleep deprivation negatively impacts the immune systemHave you ever heard that a lack of sleep can cause you to get sick? It turns out that it may not be a myth. “Studies show that people who don’t get quality sleep or enough sleep are more likely to get sick after being exposed to a virus, such as a common cold virus,” the Mayo Clinic says. “Lack of sleep can also affect how fast you recover if you do get sick.”

Harvard Healthy Sleep explains it like this: “Sleep deprivation increases the levels of many inflammatory mediators, and infections, in turn, affect the amount and patterns of sleep. While scientists are just beginning to understand these interactions, early work suggests that sleep deprivation may decrease the ability to resist infection.”

If you are immunocompromised or going through something that affects your immune system, such as chemotherapy, experts say you should try to prioritize sleep. “Getting an adequate amount of sleep is an essential requirement for good health,” the Immune Deficiency Foundation says. “Most scientists recommend a consistent number of hours of sleep per night and consistent bed times and waking times, as well.”

If you find yourself sick with a cold or stomach bug, sleep is essential to recovery. “Getting plenty of rest is arguably the most important strategy when it comes to bouncing back from an illness,” the American College of Healthcare Sciences says. “Aim to add at least an extra hour to your normal sleep time whenever you feel illness creeping in, either by going to bed earlier or sleeping in later (or ideally both). If possible, sneak in a few small naps during the day to give your body a break and provide it with additional opportunities for rejuvenation.”

Organs & Muscles

Have you ever been drifting into sleep, only to experience a whole-body jolt that shakes you awake? This is called a hypnagogic jerk or a “sleep start,” and it’s a type of muscle spasm. These are totally normal, though experts aren’t totally sure what causes them. “Persons with sleep myoclonus are rarely troubled by, or need treatment for, the condition,” the Baylor College of Medicine website explains. “However, myoclonus may be a symptom in more complex and disturbing sleep disorders, such as restless legs syndrome, and may require treatment by a doctor.”organs and muscles are still working during sleep

Sleep is important for muscle growth and muscle repair: You need sleep to recover from strength training and to build more muscle. Sleep is also crucial for athletic performance, reducing injury risks and improving speed, accuracy, and stamina.

The Cleveland Clinic explains that, during rapid eye movement (REM) sleep, your muscles are completely paralyzed: “The face, fingers, and legs might twitch. Intense dreaming occurs during REM sleep as a result of heightened cerebral activity, but paralysis occurs simultaneously in the major voluntary muscle groups.”

Even though your eyes are closed while you are asleep, your eyes do move around (behind your eyelids) during REM sleep. One theory is that each eye movement is associated with a new “vision” or physical scene in your dream. Plus, some people do actually sleep with their eyes open — the American Academy of Ophthalmology says this can be caused by eyelid problems or issues with the facial nerves: “In most cases, the lids will close most of the way but not completely. Even a small opening in the eyelids can dry out the eyes overnight.” If you wake up with eye dryness, red eyes, blurry vision, or feeling like something is stuck in your eye, you might be sleeping with your eyes partly open.

While sleeping, your major organs continue to function as they normally would:


Your heart rate can drop to quite a low level during deep sleep, the American Heart Association says, but it continues to pump blood around your body while you are resting. However, things can speed up during REM sleep. “Your blood pressure and heart rate can go up and down during this stage,” the UCLA Health website says. “If you have a nightmare that wakes you up, you may find that your heart is racing.” If you wear a smartwatch or heart monitoring device while you sleep, you may notice what heart rate patterns seem normal for you throughout the course of the night.


Your kidneys continue to filter your blood and create urine. “Kidney function is actually regulated by the sleep-wake cycle. It helps coordinate the kidneys’ workload over 24 hours,” Dr. Ciaran McMullan, M.D., told the National Kidney Foundation. “We also know that nocturnal patterns can affect chronic kidney disease and that people who sleep less usually have faster kidney function decline. What we’re doing now is looking at the specific hormones that may be behind these declines.”


Your lungs keep you breathing while you sleep in order to keep blood oxygen levels steady, but some people suffer from breathing conditions during sleep. One example is sleep apnea, explained a little bit more in the next section. Another is a chronic obstructive pulmonary disease (COPD). Cleveland Clinic says COPD is a term applied to a family of diseases that includes emphysema, chronic bronchitis, and emphysema due to alpha-1 antitrypsin deficiency. In an article for the Cleveland Clinic, Pulmonologist Dr. Amy Attaway was interviewed saying “many people living with chronic obstructive pulmonary disease, or COPD, are in a hypermetabolic state. Your body feels like it’s spending all of its energy on breathing.”

More Sleep Cycle Resources

Common Reasons People Wake Up In The Middle Of The Night

Common Reasons People Wake Up In The Middle Of The Night

Waking up in the middle of the night is pretty common—and very annoying. The National Sleep Foundation (NSF) explains that interrupted sleep can affect a person’s memory and cognitive abilities, not to mention cause all of us to be grumpy the next day. This situation can be frustrating, but it’s not likely to change unless sleepers can identify … Read more
Read More
Do The Moon’s Cycles Actually Influence Your Sleep?

Do The Moon’s Cycles Actually Influence Your Sleep?

Many myths and legends suggest the phase of the moon can affect behaviors. Folklore about werewolves even suggests it can have transformative powers. Though we may not change species according to the moon cycles, there is research to suggest they do affect us. This poses the question: Do lunar cycles affect how you sleep? To … Read more
Read More
What Is Biphasic Sleep?

What Is Biphasic Sleep?

What exactly is biphasic sleep? People may not be familiar with the specific term, but most probably recognize the concept. It refers to sleep patterns that involve sleeping in two segments each day. Biphasic translates to “two phases” and can also be referred to as segmented, divided, bimodal, or diphasic sleep, too. This is different from … Read more
Read More
What Is REM Sleep?

What Is REM Sleep?

You’ve heard the term “REM sleep” a lot, but what does it actually mean? As the National Institutes of Health (NIH) website explains, there are five stages of sleep: stage 1, stage 2, stage 3, stage 4, and then rapid eye movement (REM) sleep. According to the NIH, “REM sleep makes up about 25 percent … Read more
Read More

Other Crazy Things That Happen

A number of unexpected things can happen when you are sleeping, either due to a medical condition or a complete fluke of luck! These include:


snoring may be a sign of sleep apneaThe Mayo Clinic explains that snoring happens when “air flows past relaxed tissues in your throat, causing the tissues to vibrate as you breathe.” A few factors play into this, including the anatomy of your mouth and throat, alcohol consumption, your sleep position, and nasal passage issues. If you find that snoring is waking you up at night or disturbing your partner, you can try sleeping on your side or speaking with a doctor to see if the snoring is associated with obstructive sleep apnea.


Getting out of bed at night and moving around while completely asleep doesn’t just happen in cartoons. In fact, research suggests that sleepwalking in adults is less rare than you might think — it affects around 3.6% of Americans, which is more than 8.4 million adults. “It is thought that medication use and certain psychological and psychiatric conditions can trigger sleepwalking, but the exact causes are unknown,” a Harvard Health report on sleepwalking explained. If you are prone to sleepwalking or live with someone who sleepwalks, there are potential safety risks like falling or accidental injuries — speak with a doctor about how to treat sleepwalking or make your home a safer place for sleepwalkers.

Bottom Line

While you might feel like sleep is idle time, that’s actually far from the truth. During sleep, your body is working hard to move oxygen through your body, repair cells, grow and repair muscles, filter your blood, and more.

There are plenty of things happening during sleep that we still don’t totally understand, particularly when it comes to brain activity or dreaming. That said, If you are worried about anything that’s happening while you sleep, you can speak with your doctor about what might be happening and how best to address it. For example, if you consistently wake up experiencing physical discomforts like dry eyes or a sore throat, that may be worth chatting to a medical professional about.keep a sleep diary to help track your sleep

If you want to gather more information about your sleep habits, one good first step is to keep a sleep diary. This can be done in a notebook, using an app, or on a spreadsheet — whatever works best for you. For a few weeks, track what time you go to bed and what time you wake up, and how well you slept. Consider tracking other relevant information like what time you ate dinner, the latest point in the day you consumed caffeine, late-night snacks, whether you used electronics before bed, how stressed you felt that day, whether you took a nap at any point and anything else you can think of.

Once you have data from a few days or a few weeks, you can look for any patterns — do you toss and turn after eating a heavy meal, or get up to go to the bathroom multiple times per night after consuming alcohol? Knowing your personal patterns can help you decide what changes to make to improve your sleep quality.

As a first step for improving any sleep issues, most physicians will recommend adopting a rigorous sleep hygiene routine. Sleep hygiene is a set of habits that help you drift off quickly and make it more likely that you will routinely get high-quality sleep. Recommended sleep hygiene steps include:

  • Avoiding alcohol, caffeine, and heavy meals or heavy snacking close to bedtime
  • Avoiding blue light emitted by electronics like phones, tablets, TVs, or computers before at least one hour before bedtime
  • Going to bed at the same time every night
  • Waking up at the same time every morning — even on weekends
  • Establishing a bedtime routine that helps you relax and wind down, like listening to music, reading, stretching, or sipping a cup of herbal tea
  • Using your bed for sleep or sex only
  • Keeping your bedroom cool, dark, and as quiet as possible (using blackout shades, an eye mask, earplugs, white noise, or a fan as needed)
  • Getting regular exercise, ideally earlier in the day so you feel tired at night
  • Managing any sources of constant stress or anxiety, so you don’t lie awake worrying when you are trying to go to sleep
  • Getting out of bed to read or listen to music once you have laid in bed awake for 20 minutes, and returning to bed once you feel tired again

You can find more sleep hygiene recommendations online, or by speaking with a physician or a certified sleep coach.


Are You Sleeping Too Much?

The Centers for Disease Control and Prevention (CDC) recommends that young adults get 8 to 10 hours of sleep each night and adults get 7 hours or more per night. But what happens for people who regularly sleep a lot longer than that?

Learn more about what happens when you get too much sleep here!

Can You Catch Up on Sleep Over the Weekend?

Ever heard of “sleep debt?” Scientific American describes it as “the difference between the amount of sleep you should be getting and the amount you actually get. It’s a deficit that grows every time we skim some extra minutes off our nightly slumber.” And paying off that sleep debt isn’t as simple as sleeping extra hours on the weekend.

Learn more about sleep debt here!

Does Counting Sheep Really Help You Go to Sleep?

One thing’s for certain: The idea of counting sheep before bed has been around for a long time. But that doesn’t mean it’s a tried and true method for dozing off faster. In fact, research suggests that counting sheep isn’t actually an effective way to make yourself fall asleep.

Learn more about the science of sheep counting here!

How Does Lack of Sleep Affect Your Mood?

Sleep deprivation undoubtedly affects one’s mood. When people haven’t gotten enough sleep, they may well find themselves feeling grumpy, irritable, sluggish, and generally ill-tempered. Lack of sleep has also been linked to anxiety and even depression.

Learn more about how sleep affects your mood here!

What Are the Benefits of Getting More Sleep?

Here’s a tidbit for you: We spend almost one-third of our lives sleeping. This is a huge chunk of our lives, and it is a time when our body can rest, recharge, and recover. It is recommended that adults get between seven and eight hours per night. However, many people get less than six hours a night.

Learn more about the benefits of getting more sleep here!

What Would Happen if You Didn’t Sleep?

What happens if you don’t sleep? More precisely, what happens to our minds and our bodies when we decide not to sleep? Our research tells us that it’s far from healthy to deny our bodies much-needed sleep.

Learn more about what would happen if you didn’t sleep here!

Learn More about How Sleep Works

Early Birds vs Night Owls – Is One Better Than The Other?

Early Birds vs Night Owls – Is One Better Than The Other?

Some people wake up bright and early, ready to tackle the day. Others find their stride later in the evening. These are two common sleep chronotypes, or specific patterns of sleep, that we see play out in our daily lives. Many people know why these differences between individuals occur. When it comes to early birds … Read more
Read More
How Genetics Impact Our Sleep

How Genetics Impact Our Sleep

Sleep is something all humans need, and yet, so much about it remains a mystery. Scientists have established the basics—that there are multiple sleep stages, and that one stage, REM sleep, is associated with learning and storing memories. However, the exact mechanisms behind sleep and dreaming are still unclear. Research suggests that behavioral sleep habits … Read more
Read More
Why Are Yawns Contagious?

Why Are Yawns Contagious?

You likely know the feeling of a yawn coming on. Seemingly outside of your control, your mouth opens wide, your jaw drops, and you inhale deeply through your mouth and nose, followed by a shorter exhale. Maybe you stretch out your arms and legs and close your eyes tightly as your yawn peaks. You may … Read more
Read More
Sleep Survival Across America

Sleep Survival Across America

Feeling tired? Worn down?  Welcome to the club – an increasing number of Americans are getting less sleep than they need each night. The impact of poor sleep can impact our personal health and increase the chances of safety issues across all 50 states. Let’s take a look at why Americans are so tired and … Read more
Read More