What Is a Nightmare and Why Do We Have Them?

A nightmare is a vivid, disturbing dream that wakes you up and leaves you feeling scared, anxious, or upset. Unlike a forgettable bad dream, a nightmare pulls you fully out of sleep, and you can typically remember it in detail afterward. Most people experience nightmares occasionally, but between 4% and 10% of the population has them frequently enough to affect daily life.

When Nightmares Happen During Sleep

Nightmares occur during REM sleep, the stage where most vivid dreaming takes place. Your brain cycles through REM periods several times per night, with each one lasting longer than the last. Because the longest and most intense REM periods happen in the final hours of sleep, nightmares are most common in the early morning hours. This is why you often wake up from a nightmare close to your alarm rather than shortly after falling asleep.

When you wake from a nightmare, you become alert and oriented quickly. You know where you are, you recognize the dream wasn’t real, and you can usually describe it clearly. This rapid return to awareness is one of the defining features that separates nightmares from other sleep disturbances.

How Nightmares Differ From Night Terrors

People often confuse nightmares with night terrors, but they’re fundamentally different experiences. Night terrors happen during deep non-REM sleep, typically in the first few hours of the night. A person having a night terror may scream, thrash, sit up wide-eyed, sweat heavily, and have a racing pulse, yet they remain asleep through the whole episode. They’re extremely difficult to wake, and if you do manage to rouse them, they’ll be confused and disoriented.

The biggest difference is memory. You remember a nightmare. A person who has a night terror, especially a child, usually has no recollection of it the next morning. Adults may recall a fragment of a dream connected to the episode, but nothing close to the detailed narrative you get from a nightmare. Night terrors are also far more common in children and tend to be outgrown, while nightmares can persist throughout life.

What Causes Nightmares

There’s no single cause. Nightmares arise from a combination of stress, sleep habits, mental health conditions, and sometimes medications. Anxiety, depression, and daily psychological stress are among the most common triggers. Your brain uses dreaming partly to process emotions, and when those emotions are intense or unresolved, the dreams can turn threatening.

Trauma is one of the strongest drivers of chronic nightmares. Over 70% of people with post-traumatic stress disorder experience nightmares, often ones that replay the traumatic event directly. These trauma-related nightmares are thought to begin as the brain’s attempt to emotionally process what happened, but over time they can become a learned pattern, repeating through a kind of conditioning. Persistent feelings of helplessness, hyperarousal, and disrupted REM sleep all contribute to keeping those nightmares locked in place.

Sleep deprivation itself can intensify nightmares through a process called REM rebound. When you lose sleep, your brain compensates by spending more time in REM during recovery sleep, and that REM is more intense than usual. The severity scales with how much sleep you’ve missed: a few hours of lost sleep mainly increases deep non-REM sleep, but 12 to 24 hours of deprivation boosts both non-REM and REM. After extreme sleep loss (around 96 hours), the body prioritizes REM almost exclusively, producing vivid and often disturbing dreams.

Medications and Withdrawal

Certain medications can trigger nightmares, particularly ones that disrupt sleep continuity. Some antidepressants increase dream vividness and nightmare recall. The likely mechanism involves how well you stay asleep: drugs that cause more brief awakenings during the night give your brain more opportunities to encode dreams into memory, making nightmares more noticeable. Stopping certain medications abruptly can also provoke a wave of nightmares. When drugs that suppress REM sleep are suddenly discontinued, the brain rebounds with unusually intense REM periods, producing vivid and often unpleasant dreams. Alcohol withdrawal works through a similar mechanism.

Who Gets Nightmares Most Often

Nightmares follow a distinct age pattern. They’re common in childhood and adolescence, peak during the twenties, and decline with age. College students report nightmares at a rate of about 19.5%, compared to just 4.3% of older adults. Roughly 5% of college students meet the criteria for nightmare disorder, meaning their nightmares are frequent and disruptive enough to qualify as a clinical condition.

The clinical threshold for nightmare disorder isn’t defined by a specific number of episodes. Instead, it’s based on impact: the nightmares happen repeatedly, cause significant daytime distress (anxiety, fatigue, difficulty concentrating), and can’t be explained by medication or another medical condition. For practical purposes, one nightmare per month is a commonly accepted minimum, while severity ranges from mild (less than once per week) to severe (nightly).

Why Nightmares May Exist at All

One leading explanation is the threat simulation theory, which frames nightmares as a biological defense mechanism shaped by evolution. The idea is that dreaming about threats allowed our ancestors to rehearse the mental processes needed for recognizing and avoiding danger, all without any real risk. By repeatedly simulating threatening scenarios during sleep, the brain essentially practiced survival skills. Research on traumatized children supports this: kids who’ve faced real threats tend to have more frequent and more realistic threat-based dreams, consistent with the idea that the system ramps up when danger has actually been encountered.

How Chronic Nightmares Are Treated

The most effective treatment for recurring nightmares is imagery rehearsal therapy, a technique with strong clinical evidence behind it. The process has three core steps: learning how sleep and dreaming work, writing down a recurring nightmare and then changing it (altering the ending, shifting a detail, or transforming the threat into something neutral), and then mentally rehearsing the new version of the dream each day. Some versions of the therapy also include direct exposure, where you write out the original nightmare in full and read it aloud to a therapist.

A meta-analysis of imagery rehearsal studies found large improvements in nightmare frequency, sleep quality, and PTSD symptoms, and those benefits held up over time. Long-term follow-up showed the reduction in nightmare frequency was just as strong months later, and PTSD symptom improvement actually grew larger. The treatment typically takes only a few sessions, making it one of the more practical interventions in sleep medicine.

For people whose nightmares are tied to sleep deprivation or poor sleep habits, improving sleep consistency can help on its own. Getting enough sleep reduces the pressure for REM rebound, which in turn lowers the intensity of dreams. Reducing alcohol and managing stress are also straightforward ways to quiet nightmare activity without any formal treatment.