← The Feelsy Journal
Sleep7 min read·October 10, 2026

Why Do We Have Nightmares? The Science of Bad Dreams

Nightmares are common, mostly normal, and surprisingly well studied. Why bad dreams happen, when they become a problem, and what research says helps.

By Kurt Woleret

Dark surreal clouds swirling slowly above an empty bed in moody aubergine night, threaded with faint lavender, rose and aqua glow.

Everyone has a nightmare they can still narrate years later. Mine involves missing a train that somehow contains my entire career; I'll spare you the details, but my subconscious apparently thinks the MTA controls my fate, which, living here, is not entirely wrong. Nightmares feel like malfunctions. You wake at 4 a.m., heart pounding, annoyed at your own brain for producing horror content you never subscribed to. But bad dreams are one of the better-studied corners of sleep science, and the picture that emerges is stranger and more reassuring than 'your brain is broken.' Mostly, your brain is doing a job. Occasionally the job gets stuck. Both parts are worth understanding.

What a nightmare technically is

Sleep researchers define a nightmare as a vivid, disturbing dream that wakes you up, usually with fear, anxiety, or dread you can remember clearly. That waking part matters: it separates nightmares from garden-variety bad dreams, which are unpleasant but don't eject you from sleep. Nightmares happen mostly during REM sleep, the stage when your brain is highly active and your body is paralyzed, and REM periods get longer toward morning. That's why the memorable ones so often strike between 4 a.m. and your alarm: you're spending more time in the theater where they play.

Why your brain makes horror films

Nobody has a final answer for why we dream at all, but the leading ideas about nightmares cluster around two functions. The first is emotional processing: REM sleep appears to help the brain digest the day's emotional residue, replaying charged material in new combinations, and a nightmare may be that process running on difficult content. The second is threat simulation: the theory that dreams evolved partly as a flight simulator for danger, letting you rehearse fear and escape in a consequence-free environment. A nightmare, in this view, is practice. Unpleasant practice, but practice. Neither theory is settled science, and I'll flag that honestly. What is settled: nightmares get more frequent under stress, after disturbing experiences, during big life transitions, and when sleep itself is disrupted. The genre of the film tracks the state of the studio.

A nightmare is your brain rehearsing danger in a theater where nothing can actually hurt you.

What makes them worse

A few reliable aggravators show up across the research. Sleep deprivation is the big one: when you finally crash after short nights, your brain rebounds with longer, more intense REM, and intense REM is nightmare territory. Irregular schedules do the same thing on a smaller scale. Alcohol is a classic offender; it suppresses REM early in the night, then REM comes roaring back in the small hours as the alcohol wears off. Stress and anxiety load the content pipeline, which is why deadline weeks and family holidays produce such reliable 4 a.m. screenings. And going to bed immediately after doomscrolling or a tense show hands your brain charged material right before the projector starts. None of this means a single nightmare needs explaining. Brains produce the occasional horror short for free.

When nightmares are a problem

Frequency and daytime fallout are the dividing lines. An occasional nightmare, even a memorable one, is normal human equipment. Nightmares most nights, nightmares that make you dread going to bed, or nightmares that leave you anxious and wrecked the next day are a different category; clinicians call it nightmare disorder, and recurring nightmares are also a core symptom of post-traumatic stress. The encouraging news is that this is treatable, and the best-studied treatment is almost suspiciously simple. It's called imagery rehearsal therapy: while awake, you write down the recurring nightmare, change the script, any change you like, usually toward a neutral or positive turn, and mentally rehearse the new version for a few minutes a day. In a randomized controlled trial with trauma survivors suffering chronic nightmares, this technique significantly reduced nightmare frequency and improved sleep quality, with effects lasting months (Krakow et al., 2001, JAMA). You rewrite the film; the projector eventually plays the new cut. If your nightmares are frequent or trauma-linked, that work is best done with a professional rather than from a blog post, mine included.

What you can do tonight

For ordinary, non-clinical nightmares, the levers are mostly the unglamorous sleep ones, because stable sleep means calmer REM. Keep your schedule consistent so REM isn't rebounding. Skip the nightcap; whatever it gives you at 11 p.m., it bills you at 4 a.m. Put a buffer between the day's stress and lights-out: the brain dreams about what you feed it last, so feed it something boring and calm. My own buffer on bad weeks is embarrassingly simple: lights low, phone dimmed, ten minutes of a slow dark texture in Feelsy with quiet rain sound, usually on autoplay so I'm not even making choices, then bed. Is a calm-down ritual going to delete nightmares? No. Does handing your brain thirty minutes of low-stakes input before sleep beat handing it a comment section? Every time. And if you do wake from one: lights dim, a few slow exhales, maybe a glance at something mundane to overwrite the imagery, and back down. The worst move is lying there replaying the director's cut.

The skeptic's bottom line

Nightmares are normal equipment, probably doing useful emotional work, and they get louder exactly when your sleep and stress are messiest, which makes them a decent dashboard light. The occasional one needs no fixing. Frequent ones respond to boring sleep hygiene and, when they're chronic or trauma-linked, to a well-studied rewriting technique that a professional can walk you through. Your brain isn't malfunctioning at 4 a.m. It's running an ancient program with this week's inputs. Give it better inputs, and the programming improves.

Feelsy is a wellness product, not medical advice. If stress, anxiety or sleep problems persist, please speak with a qualified professional.

References

  1. Krakow, B., Hollifield, M., Johnston, L., et al. (2001). Imagery rehearsal therapy for chronic nightmares in sexual assault survivors with posttraumatic stress disorder: A randomized controlled trial. JAMA, 286(5), 537-545.

Frequently Asked Questions

Why do we have nightmares?

The leading theories say nightmares are a byproduct of useful work. REM sleep helps the brain process the day's emotional residue, and dreams may also function as a kind of threat simulator, letting you rehearse fear and escape safely. Nightmares become more frequent under stress, after disturbing experiences, and when sleep is disrupted, so they often reflect the state of your days rather than a malfunction.

Why do nightmares happen in the early morning?

Nightmares occur mostly during REM sleep, and REM periods get longer as the night goes on. By the early morning hours you're spending the most time in REM, which is why vivid, memorable nightmares so often strike between 4 a.m. and your alarm.

What makes nightmares worse?

Sleep deprivation is the biggest aggravator, because your brain rebounds with longer, more intense REM when you finally catch up. Alcohol does something similar by suppressing REM early in the night and letting it surge back in the small hours. Stress, anxiety, irregular schedules, and consuming tense or upsetting content right before bed all reliably increase nightmare frequency.

When should I worry about nightmares?

An occasional nightmare is normal. It's worth seeking help when nightmares happen most nights, make you dread going to bed, or leave you anxious and exhausted during the day; clinicians call this nightmare disorder, and recurring nightmares are also a core symptom of post-traumatic stress. Both respond to treatment, so frequent nightmares are a reason to talk to a professional, not something to simply endure.

How do you stop recurring nightmares?

The best-studied approach is imagery rehearsal therapy: while awake, you write down the recurring nightmare, change the script toward a neutral or positive version, and mentally rehearse the new version a few minutes each day. A randomized trial found it significantly reduced nightmare frequency and improved sleep quality. For trauma-linked nightmares, it's best done with a professional's guidance.

Portrait of Kurt Woleret

About the author

Kurt Woleret

Contributing writer

Kurt is a New York based writer covering the practical science of stress, sleep and focus. He is the resident sceptic of the Journal: if a technique cannot survive a crowded subway commute and a deadline week, he is not interested in it.

Feel it for yourself.

Feelsy turns reading about calm into practising it. Two minutes of a slow texture is often the whole difference.

Download Feelsy on the App StoreGet Feelsy on Google Play

Related reading

An empty bed in a dark room with luminous ribbons of lavender, rose and aqua mist drifting above the pillow like dream currents against deep aubergine night.
Sleep

Why Do We Dream? What Your Brain Is Actually Up to at 3 A.M.

Science still argues about why we dream, but the leading theories agree on one thing: dreaming is work. Here's what your brain does all night, and why.

Kurt WoleretSep 10, 20267 min read
Pillow on a dark bed at dawn with faint lavender and aqua mist dissolving into the air above it.
Sleep

Why Can't I Remember My Dreams? The Science of Dream Recall

You dream every night whether you remember it or not. Here's what brain research says separates dream recallers from forgetters, and how to recall more.

Kurt WoleretSep 26, 20267 min read
Soft lavender and aqua particles drifting through deep aubergine darkness, like the edge of a dream.
Sleep

Sleep Paralysis: Why You Wake Up Frozen (and What's Actually Happening)

Why you wake up unable to move, where the shadowy figure comes from, and what actually helps: the science of sleep paralysis, minus the demons.

Kurt WoleretAug 23, 20267 min read
A vintage analog alarm clock with softly glowing lavender hands being turned back an hour on a dark nightstand, deep twilight blue window with a thin rose horizon behind it in a near-black aubergine room.
Sleep

Falling Back: A Survival Guide for the End of Daylight Saving Time

Clocks fall back this weekend, and the free hour is slightly fake. What the end of daylight saving time really does to your sleep, and how to land it well.

Kurt WoleretOct 31, 20267 min read
A small minimalist bedside alarm clock sending gentle concentric ripples of lavender and aqua light across a dark duvet in a near-black bedroom, with a faint rose glow of dawn at the window.
Sleep

The Best Alarm Sound to Wake Up To, According to Research

Harsh beeping may be making your mornings worse. What research says about the best alarm sound to wake up to, and how to choose one your brain won't fight.

Kurt WoleretOct 31, 20267 min read
A sleeping figure in a near-black bedroom with faint luminous particles and soft threads of lavender and aqua light drifting above the pillow, suggesting quiet activity in a resting mind.
Sleep

Can You Learn While You Sleep? What the Science Actually Says

Sleep learning is an old dream and mostly a myth, but not entirely. What research really shows about learning, memory and your sleeping brain.

Kurt WoleretOct 29, 20268 min read