Why Do I Get Anxiety When I Try to Sleep?

Bedtime anxiety happens because the transition from wakefulness to sleep strips away the distractions that kept anxious thoughts at bay during the day. Your body is supposed to quiet down as you lie in the dark, but for many people the opposite occurs: heart rate climbs, thoughts accelerate, and a vague dread settles in. The phenomenon has a name in sleep research, hyperarousal, and it involves a tangle of cognitive, physiological, and sometimes conditioned factors that can be surprisingly hard to tease apart.

The Quiet Unmasks What Daytime Noise Covered Up

During the day your brain juggles tasks, conversations, and sensory input. That constant processing acts like background music, drowning out the low hum of worry. When you climb into bed and the lights go off, the competition for your attention vanishes. Whatever you were pushing aside, a conflict at work, a health concern, a vague sense that something is wrong, now has the floor to itself.

Research on insomnia draws a useful distinction between two flavors of nighttime thinking. Worry tends to be forward-looking (“What if I can’t pay rent next month?”), while rumination dwells on the past (“I shouldn’t have said that”). A study of over 240 people diagnosed with insomnia found that high ruminators had measurably worse sleep efficiency and more time lying awake after falling asleep, even after accounting for worry levels. Worry, by contrast, did not independently predict those same sleep outcomes.1Europe PMC. Distinguishing rumination from worry in clinical insomnia That doesn’t mean worry is harmless at bedtime; it means the mental replaying of past events seems to be the stickier problem when it comes to actually staying asleep. If you’ve noticed that your bedtime anxiety is less about specific future threats and more about looping over things that already happened, you’re experiencing the pattern the data highlights.

Your Bedroom Can Become a Learned Trigger

One of the stranger aspects of bedtime anxiety is that it often gets worse the harder you try to fix it. You lie awake anxious one night, then the next night you approach your pillow already expecting the same thing. Over weeks and months, the bedroom itself can become a cue for alertness rather than rest. Sleep scientists call this conditioned arousal, and it’s a core piece of the hyperarousal model of insomnia.

A study comparing people with primary sleep-onset insomnia to normal sleepers found that the insomnia group was significantly more cognitively aroused and significantly less sleepy specifically within the bedroom environment.2PubMed. Prospective comparison of subjective arousal during the pre-sleep period in primary sleep-onset insomnia and normal sleepers The effect wasn’t just about being an anxious person in general; it was tied to the place itself. This helps explain why some people sleep fine on vacation or on a friend’s couch but dread their own bed. The bed has become paired with wakefulness.

The broader hyperarousal model frames chronic insomnia as the result of a genetic predisposition toward imbalanced arousal, combined with stressors, dysfunctional sleep habits, and these kinds of learned associations.3PubMed. The hyperarousal model of insomnia: a review of the concept and its evidence In other words, the conditioning doesn’t happen in a vacuum. It builds on a nervous system that was already running a bit hot.

A Nervous System That Won’t Downshift

Healthy sleep requires your autonomic nervous system to tip the balance from its “fight or flight” branch toward its “rest and digest” branch. In people with anxiety, that handoff often stalls. Heart rate stays elevated, muscles stay tense, and the body remains on alert even though you’re lying perfectly still in a safe room.

A systematic review examining heart rate variability during sleep found that this kind of sympathetic dominance, where the arousal branch of the nervous system stays active instead of yielding to the calming branch, is a common thread linking poor sleep to both depression and anxiety.4PubMed Central. Associations between sleep-related heart rate variability and both sleep and symptoms of depression and anxiety: A systematic review The relationship goes both ways: poor sleep worsens anxiety, and anxiety worsens sleep, creating the kind of feedback loop that can feel impossible to escape from the inside.

Sleep debt makes the whole situation worse. Even a few nights of insufficient sleep weakens the connection between the amygdala, the brain’s alarm center, and the prefrontal regions that help regulate emotional reactions. One study showed that accumulating sleep debt reduced the ability of the anterior cingulate cortex to suppress amygdala responses to negative stimuli.5PLOS ONE. Sleep Debt Elicits Negative Emotional Reaction through Diminished Amygdala-Anterior Cingulate Functional Connectivity The practical meaning: the more anxious nights you string together, the more emotionally reactive your brain becomes, which makes the next night even harder.

Nocturnal Panic Attacks

Some people don’t just feel anxious before falling asleep; they wake up already in the grip of a full panic attack, heart pounding, gasping, flooded with terror, sometimes with no identifiable trigger. These nocturnal panic attacks are more common than most people realize. Among those with panic disorder, somewhere between 44% and 71% report at least one episode of waking from sleep in a state of panic.6PubMed. Assessment and treatment of nocturnal panic attacks

What makes nocturnal panic unsettling is that it doesn’t come from nightmares. It arises during non-REM sleep, often during a transition from lighter sleep stages toward deeper sleep.7JAMA Psychiatry. Electroencephalographic Sleep in Panic Disorder: A Focus on Sleep-Related Panic Attacks That’s worth knowing because people who experience it sometimes assume they must have had a bad dream they can’t remember. In reality, the brain isn’t dreaming at all. The attacks tend to cluster in the first third of the night, which is when the deepest non-REM sleep occurs.8PubMed Central. Is nocturnal panic a distinct disease category? Comparison of clinical characteristics among patients with primary nocturnal panic, daytime panic, and coexistence of nocturnal and daytime panic

If you’ve woken up panicking, the experience can itself feed a fear of going to sleep, which loops back into the conditioned-arousal problem described earlier. People start to dread bedtime not because of what they’re thinking about, but because they’ve learned that sleep is where the panic lives.

When Something Physical Is Driving the Anxiety

Not all bedtime anxiety is purely psychological. Several physical conditions can produce symptoms that mimic or amplify anxiety at night, and they’re worth ruling out before assuming the problem is “just stress.”

Obstructive sleep apnea causes repeated brief interruptions in breathing. Each interruption can trigger a surge of adrenaline and a jolt of wakefulness that the person may experience as sudden panic. A survey of over 300 sleep apnea patients found that the condition can cause symptoms indistinguishable from nocturnal panic attacks.9PubMed. Sleep apnea and panic attacks If you wake up gasping or with a racing heart, and especially if you snore or feel unrested no matter how long you sleep, a breathing disorder is worth investigating before attributing everything to anxiety.

Restless legs syndrome is another physical condition that flares at bedtime. It produces an uncomfortable, sometimes unbearable urge to move your legs that intensifies during rest, particularly at night. People with the condition frequently develop anxiety and depression secondary to the chronic sleep disruption it causes.10PubMed Central. Associations of anxiety and depression with restless leg syndrome: a systematic review and meta-analysis The anxiety doesn’t originate in your thoughts; it originates in your legs, and treating the underlying condition can resolve it.

Racing Thoughts, ADHD, and Hormonal Shifts

For some people, the mental acceleration at bedtime isn’t garden-variety worry. Adults with ADHD are prone to what clinicians call racing thoughts, a rapid, hard-to-control stream of ideas that can feel exhilarating during the day but becomes a problem when the goal is to fall asleep. One study found that ADHD patients scored dramatically higher on a racing-thoughts scale compared to both healthy controls and even patients in manic episodes. The racing thoughts were reported as most severe in the evening and at bedtime, and they correlated positively with insomnia severity.11IRIS. Racing thoughts in adults with ADHD: a neglected symptom associated with mood instability and insomnia If bedtime feels like your brain suddenly has twenty browser tabs open at once and you also struggle with focus during the day, ADHD-related racing thoughts may be part of the picture.

Hormonal changes can also shift the baseline. Sleep disturbances tied to the luteal phase of the menstrual cycle, the roughly two weeks before a period, have been linked to fluctuations in hormones that affect melatonin secretion.12PubMed Central. Sleep and Premenstrual Syndrome If your bedtime anxiety worsens predictably on a monthly cycle, it may not be purely psychological. Tracking symptoms alongside your cycle for a couple of months can clarify whether the pattern holds.

Trauma and the Fear of Letting Your Guard Down

For people with a trauma history, the problem at bedtime can be even more primal than worry or rumination. Sleep requires you to surrender awareness, and for someone whose nervous system was shaped by danger, that surrender feels threatening. Research on first responders found that fear of sleep often reflects an underlying fear of losing vigilance, of not being able to monitor the environment for threats.13PubMed Central. Fear of sleep in first responders: associations with trauma types, psychopathology, and sleep disturbances Participants described trying to stay alert to strange noises even while lying down to sleep.

This pattern extends well beyond first responders. Anyone who grew up in an environment where nighttime was unpredictable, where waking up suddenly was necessary for safety, can develop a deep resistance to the vulnerability of sleep. The anxiety may not present as identifiable thoughts at all; it might just be a body that refuses to relax, a jaw that clenches, a startle response at every small sound. Trauma-related sleep fear is qualitatively different from insomnia driven by daytime stress, and it often requires trauma-focused treatment rather than standard sleep-hygiene advice.

What You Do in the Hours Before Bed Matters More Than You Think

Two common pre-sleep habits deserve specific mention because they’re widespread and their effects are often misunderstood.

Alcohol is the first. Many people use a drink or two to “take the edge off” before bed, and it genuinely does promote drowsiness in the short term. But as the body metabolizes alcohol, it triggers a rebound effect: neurotransmitter systems that were suppressed by the alcohol swing back in the other direction, producing something like a mini withdrawal. This rebound can precipitate anxiety and mood symptoms in the second half of the night.14PubMed. A review of the effects of moderate alcohol intake on psychiatric and sleep disorders You fall asleep faster but wake up at 3 a.m. with your heart racing and a sense of dread, and you may not connect that feeling to the glass of wine four hours earlier.

The second is late-night scrolling. Engaging with negative or emotionally charged content on your phone right before bed does more than just expose you to blue light. Doomscrolling, the compulsive consumption of distressing news and social media content, was found to have a significant positive correlation with sleep disturbance in young adults.15Social Science Review Archives. Nighttime Doomscrolling and Sleep Disturbance in Young Adults The mechanism isn’t complicated: you’re priming your brain with threat-related content at the exact moment you need it to wind down. The emotional activation carries over into the pre-sleep period, giving your cognitive arousal system fresh material to chew on.

Light at Night and Your Internal Clock

Beyond screens, light exposure at the wrong time can affect the brain structures involved in emotional regulation. Animal research has shown that chronic light exposure during the biological night disrupts circadian rhythms and increases anxiety-like behavior, with measurable changes in brain regions that process emotions, including the hippocampus, amygdala, and prefrontal cortex.16PubMed Central. Chronic Light Exposure in the Middle of the Night Disturbs the Circadian System and Emotional Regulation While animal findings don’t map directly onto humans, they align with what clinicians observe in people with circadian misalignment.

People with delayed sleep-wake phase disorder, who naturally feel alert late at night and struggle to wake in the morning, tend to report higher levels of neuroticism and anxiety, which can compound their insomnia symptoms.17Europe PMC. Delayed sleep-wake phase disorder and its related sleep behaviors in the young generation If you feel wired at midnight and anxious when you finally force yourself into bed at a “normal” hour, part of the problem may be a mismatch between your internal clock and the schedule you’re trying to keep. The anxiety in that case isn’t free-floating; it’s partly the friction of fighting your own biology.

Breaking the Cycle

The feedback loops that sustain bedtime anxiety, conditioned arousal reinforcing worry reinforcing poor sleep reinforcing emotional reactivity, are stubborn but breakable. Cognitive behavioral therapy for insomnia (CBT-I) is the first-line treatment recommended by most sleep medicine guidelines, and it works in part by dismantling the learned association between bed and wakefulness. Core techniques include stimulus control (only using the bed for sleep, leaving the bedroom if you can’t sleep within about 20 minutes) and sleep restriction (temporarily limiting your time in bed so the hours you spend there are filled with actual sleep rather than anxious wakefulness).

One specific technique that has shown promise targets the worry component directly. “Constructive worry” is a structured exercise done earlier in the evening where you write down your concerns and a concrete next step for each one, effectively giving your brain permission to set them aside later. A randomized trial comparing standard behavioral therapy for insomnia to the same therapy combined with constructive worry found that the combination produced larger reductions in worry, with moderate-to-large effect sizes at multiple time points.18PubMed. Don’t worry, be constructive: a randomized controlled feasibility study comparing behaviour therapy singly and combined with constructive worry for insomnia The idea isn’t to suppress your thoughts. It’s to give them a designated time and place so they don’t ambush you at midnight.

For people whose bedtime anxiety is driven by trauma, standard CBT-I may need to be supplemented with trauma-focused approaches. And for those whose symptoms are linked to a physical condition like sleep apnea or restless legs, treating the underlying cause is usually more effective than any psychological intervention aimed at managing the anxiety itself.

An Evolutionary Lens on Sleep Anxiety

There may be a reason bedtime anxiety is so common and so hard to shake: from an evolutionary standpoint, sleep is dangerous. Humans are essentially unconscious for hours, unable to monitor for threats. Researchers have proposed that a number of human sleep characteristics, including light sleeping, frequent brief awakenings, and heightened startle responses during the transition into sleep, may have evolved to reduce vulnerability during this period.19Evolutionary Psychological Science. Adaptive Solutions to the Problem of Vulnerability During Sleep In a modern bedroom with locked doors, those responses are unnecessary. But the nervous system that produces them was calibrated for a world where falling asleep in the wrong place could be fatal. Bedtime vigilance, in this framework, isn’t a malfunction. It’s an old survival program running in an environment it wasn’t designed for.