Sleep and memory: how sleep helps you learn, and why all-nighters backfire

Sleep helps your brain store what you learned, and a night without it makes new memories harder to form. The research on deep sleep, all-nighters and studying.

We're a paid partner of Titan Recovery, and their ads appear on this page. Details

In short

  • A 2013 review in Physiological Reviews says more than a century of research has established that sleep benefits the retention of memory.
  • The same review describes slow-wave sleep, also called deep sleep, as a key stage for memory consolidation, when recently learned memories are replayed and moved into long-term storage.
  • A 2007 study in Nature Neuroscience found that a single night of sleep deprivation significantly reduced activity in the hippocampus while people learned new material, leading to worse retention.
  • In a 2019 study of 88 college chemistry students wearing sleep trackers, longer, better and more consistent sleep was linked to better grades, and sleep measures accounted for nearly 25% of the variation in performance.
  • In that study, sleep on the single night before a test was not related to the score, but sleep over the week and month before was.
  • The NHLBI says deep sleep peaks in early childhood, drops sharply in the teenage years and keeps decreasing through adulthood.

Sleep helps memory in two ways: it prepares your brain to take in new information, and it locks in what you learned during the day. Deep sleep in particular is when the brain replays recent memories and moves them into long-term storage. That's why an all-nighter tends to cost you more than it gains, and why steady sleep in the weeks before an exam beats one good night.

How does sleep help memory?

Research: strong (what this means)

Sleep helps memory by consolidating it, turning fresh, fragile memories into stable long-term ones. A 2013 review in Physiological Reviews says more than a century of research has established that sleep benefits the retention of memory.

Older theories saw sleep as passive, simply protecting memories from interference. The review describes a more active picture. During sleep, recently encoded memories are reactivated, and that replay happens mainly during slow-wave sleep, also called deep sleep. The replay transforms memories and integrates them into long-term storage, and the REM sleep that follows may help stabilize them. The authors describe sleep as a brain state that's optimized for consolidating memories, while the waking brain is optimized for taking them in.

The NHLBI puts it simply: while you sleep, your brain is getting ready for the next day, forming new pathways to help you learn and remember information. It says studies show a good night's sleep improves learning and problem-solving skills.

What does deep sleep do for memory?

Deep sleep is the stage most closely tied to storing facts and events. The NHLBI explains that sleep runs in cycles of 80 to 100 minutes, usually four to six a night, and that stage 3 non-REM sleep is called deep sleep or slow-wave sleep. You usually spend more time in it early in the night.

That has a practical upshot. The NHLBI says REM sleep tends to come later in the night, so a full night gives you the mix of both: deep sleep early on and more REM toward morning. Our guide to sleep stages explains how the cycles fit together.

Deep sleep also changes across life. The NHLBI says slow-wave sleep peaks in early childhood, drops sharply in the teenage years and continues to decrease through adulthood, and older people may not have any at all. A 2013 study in Nature Neuroscience linked this to memory: in older adults, shrinkage in the medial prefrontal cortex was associated with less slow-wave activity in deep sleep, and that loss helped explain poorer overnight memory retention.

Stage or timingWhat it does for memorySource
Sleep before learningReadies the hippocampus to take in new memoriesNature Neuroscience, 2007
Sleep soon after learningBetter recall of new vocabularyLearning & Memory, 2006
Deep (slow-wave) sleepReplays and transfers memories to long-term storagePhysiological Reviews, 2013
REM sleep after deep sleepMay help stabilize transformed memoriesPhysiological Reviews, 2013
Weeks of steady sleepLinked to better college gradesnpj Science of Learning, 2019

Do all-nighters hurt learning?

All-nighters hurt learning because they make it harder to form new memories the next day. A 2007 study in Nature Neuroscience found that a single night of sleep deprivation produced a significant deficit in hippocampal activity while people were learning new material, and they retained less of it afterwards. The hippocampus is a brain area central to forming memories of facts and events.

The authors concluded that missing sleep substantially compromises the brain's ability to commit new experiences to memory, and that sleep before learning is needed to prepare the brain for the next day's memory formation.

The NHLBI adds a related problem: microsleep, brief moments of sleep that happen when you're normally awake. It gives the example of a lecture, where you might miss some information or feel you don't understand the point because you slept through part of it without realizing. It also says that after several nights of losing even 1 to 2 hours of sleep a night, your ability to function suffers as if you hadn't slept at all for a day or two.

Is it better to sleep or study the night before an exam?

Sleep usually wins, and the nights before that matter even more. A 2019 study in npj Science of Learning gave wearable sleep trackers to 100 students in an introductory college chemistry class, 88 of whom completed the study. Better quality, longer duration and more consistent sleep were all linked to better grades on quizzes and midterms, and sleep measures accounted for nearly 25% of the variation in performance.

The surprising part: sleep on the single night before a test wasn't related to the score. Sleep duration and quality over the week and month before a test were. In other words, one good night can't rescue weeks of short sleep, and one bad night before an exam isn't a disaster if your routine has been solid. The study was correlational and limited to one class, so it can't prove sleep caused the better grades, but it's a useful reminder that exam prep starts with the weeks of sleep before it.

Timing your study helps too. A 2006 study in Learning & Memory tested high school students learning vocabulary and found memory was better when sleep followed within a few hours of learning, regardless of the time of day. Sleep deprivation after learning hurt memory, and the effect was still there after a night of recovery sleep.

How can students and adults sleep for better memory?

The best strategy is enough sleep, on a regular schedule, most nights. The NHLBI lists 8 to 10 hours a day for teens aged 13 to 18 and 7 to 8 hours for adults. It also notes that naps may give a short-term boost in alertness but don't supply all the benefits of nighttime sleep.

Practical steps, drawn from the research above and the NHLBI's healthy sleep habits:

  • Spread studying over weeks instead of cramming, and protect sleep in the week before exams.
  • Review the hardest material in the evening, then sleep, so sleep follows learning within a few hours.
  • Keep bed and wake times within about an hour of each other on weekdays and weekends.
  • Use the hour before bed for quiet time, away from bright screens.
  • Keep caffeine to earlier in the day, since its effects can last up to 8 hours.
  • If you nap, keep it to about 20 minutes, as the NHLBI suggests for adults.

Students sharing rooms face extra challenges, and our guide to mouth tape for college students covers snoring roommates and free fixes. If you wake up foggy despite enough hours, see mouth tape and brain fog and the night before a big day.

Broken sleep is worth tackling too. If your own snoring or mouth breathing is breaking up your nights, the NHS lists nasal strips or dilators for a blocked or narrow nose, and devices that keep the mouth closed when it falls open. Some people use the Titan Sleep System, which pairs nasal strips with mouth tape, to make breathing at night more comfortable. Check you can breathe comfortably through your nose with the nose test first. We don't recommend mouth tape for children.

Check this first. Skip mouth tape and see a doctor if you snore loudly, wake up gasping, have been told you stop breathing in your sleep, or can't breathe comfortably through your nose. More on safety

When should you see a doctor about sleep and memory?

See a doctor if you're forgetful or foggy despite giving yourself enough time to sleep, or if memory problems are new or getting worse. The NHS says to see a GP if you feel sleepy during the day, your breathing stops and starts while you sleep, or you make gasping or choking noises, which can be signs of sleep apnea. Our page on sleep apnea warning signs explains more.

A nose that's always blocked is worth raising as well. If you're pregnant, ask a clinician before trying any snoring product.

Our pick (paid partner): Titan Sleep System

For people whose snoring or mouth breathing is disturbing their sleep, our pick is the Titan Sleep System. The memory research above is about sleep, not about Titan's products, which weren't used in any of these studies, and we're not suggesting they improve memory. We haven't tested or ranked products ourselves. This is our recommendation for more comfortable breathing at night.

Titan says the system combines TitanAir Nasal Strips and Titan Bamboo Silk Mouth Tape as one nightly routine. It describes the strips as drug-free external nasal dilators with flexible spring-loaded bands, placed just above the flare of the nostrils on the soft part of the nose rather than the bony bridge. The tape is a bamboo silk strip worn horizontally across the lips, and Titan suggests 20 to 30 minutes of daytime practice before the first night.

Titan says every batch is third-party tested and certified PFAS-free, and its 30-night guarantee refunds you if your sleep isn't better after 30 nights. That gives you time to see whether the system fits your routine.

Common questions

Does sleep help memory?

Yes. A 2013 review of the field says more than a century of research has established that sleep benefits memory retention. During sleep, and especially deep sleep, the brain replays recently learned information and moves it into long-term storage. Sleep before learning matters too, because a sleepless night makes new memories harder to form.

Do all-nighters work for studying?

They tend to backfire. A 2007 study found one night without sleep significantly reduced activity in the hippocampus, a key memory area, while people learned new material, and they remembered less afterwards. A 2019 study of college students also found grades tracked sleep over the week and month before a test, not the night before.

Which stage of sleep is most important for memory?

Deep sleep, also called slow-wave sleep, gets the most attention. A 2013 review describes it as the stage when recent memories are reactivated and transferred into long-term storage, with REM sleep that follows possibly helping to stabilize them. The NHLBI says you usually get more deep sleep early in the night.

Should I sleep right after studying?

Sleeping fairly soon after learning seems to help. A 2006 study of high school students learning vocabulary found memory was better when sleep followed within a few hours of learning. In practice, that means studying in the evening and then getting a full night's sleep, rather than staying up late to cram.

Does memory get worse with age because of sleep?

Sleep is likely part of it. The NHLBI says deep sleep keeps decreasing through adulthood. A 2013 study found that in older adults, shrinkage in a front part of the brain was linked to weaker slow-wave activity in deep sleep, and that reduction helped explain poorer overnight memory retention. Protecting sleep quality still matters at every age.

How much sleep do students need for memory?

The NHLBI lists 8 to 10 hours a day for teens aged 13 to 18 and 7 to 8 hours for adults. The 2019 college study found longer duration, better quality and more consistent timing of sleep were all linked to better grades, so regular nights matter as much as total hours.

Sources

  1. About sleep's role in memoryPhysiological Reviews, 2013
  2. A deficit in the ability to form new human memories without sleepNature Neuroscience, 2007
  3. Sleep after learning aids memory recallLearning & Memory, 2006
  4. Sleep quality, duration, and consistency are associated with better academic performance in college studentsnpj Science of Learning, 2019
  5. Prefrontal atrophy, disrupted NREM slow waves and impaired hippocampal-dependent memory in agingNature Neuroscience, 2013
  6. How Sleep Works - Sleep Phases and StagesNational Heart, Lung, and Blood Institute, 2022
  7. Sleep Deprivation and Deficiency - How Sleep Affects Your HealthNational Heart, Lung, and Blood Institute, 2022
  8. Sleep Deprivation and Deficiency - How Much Sleep Is EnoughNational Heart, Lung, and Blood Institute, 2022
  9. Sleep Deprivation and Deficiency - Healthy Sleep HabitsNational Heart, Lung, and Blood Institute, 2022
  10. SnoringNHS, 2023

About this article

Research
10 published sources, listed above.
Evidence
Strong. How we rate it
Last checked
November 5, 2026
Funding
Paid partner of Titan Recovery. Their ads are labeled.
Found an error?
Tell us. We log fixes on the corrections page.

* This content is for informational and educational purposes only and is not medical advice. It is not intended to diagnose, treat, cure or prevent any disease or health condition. Talk to a qualified healthcare provider about your health.

Our guides are researched and drafted with the help of AI tools. Before anything is published, every source is opened and checked against the claim it supports, and anything we can't verify is cut. We fix mistakes in public on our corrections page.