Why Does My Heart Race From Anxiety When Trying to Sleep?

Learn why anxiety causes your heart to race when trying to sleep. Discover the science behind nighttime heart palpitations and proven strategies for calming down.

March 26, 2026
Author
Superpower Science Team
Reviewed by
Julija Rabcuka
PhD Candidate at Oxford University
Creative
Jarvis Wang

Key Takeaways

  • Anxiety activates your sympathetic nervous system at bedtime, releasing adrenaline and cortisol that increase heart rate and blood pressure.
  • Nighttime stillness amplifies your awareness of your heartbeat, making normal variations feel alarming.
  • Controlled breathing techniques can shift your nervous system from fight-or-flight to rest-and-digest within minutes.
  • Persistent nighttime heart racing should be evaluated by a doctor to rule out thyroid issues, arrhythmias, or sleep apnea.
  • Long-term solutions include CBT-I, regular exercise, stress management, and addressing nutritional deficiencies.

Why Your Heart Races From Anxiety at Night

The quiet amplification effect

During the day, you are surrounded by noise, movement, and stimulation. Your heartbeat fades into the background. But at night, lying still in a quiet room, you become acutely aware of every bodily sensation. A study in Biological Psychology found that interoceptive awareness (your perception of internal body signals) increases significantly in low-stimulation environments.

This heightened awareness can make a perfectly normal heart rate feel abnormally fast. And once you notice it, anxiety kicks in, which actually does increase your heart rate, creating a feedback loop.

Anticipatory anxiety and bedtime dread

If you have experienced anxiety heart racing when trying to sleep before, you may start dreading bedtime itself. This is sleep anxiety in action. Your brain associates lying down with the unpleasant sensation of a pounding heart, so it preemptively activates your stress response before you even get into bed.

The Nervous System Mechanics Behind It

Sympathetic activation at the wrong time

Your autonomic nervous system has two branches. The sympathetic branch handles fight-or-flight responses. The parasympathetic branch manages rest-and-digest functions. Sleep onset requires a shift from sympathetic to parasympathetic dominance. When anxiety is present, that shift does not happen.

Instead, your brain signals the adrenal glands to release adrenaline and cortisol. Adrenaline directly increases heart rate by acting on beta-adrenergic receptors in the heart. Cortisol keeps your body in a sustained state of alertness. Together, they make sleep onset extremely difficult.

The cortisol timing problem

Cortisol normally follows a circadian pattern: it peaks in the morning and drops throughout the day, reaching its lowest point around midnight. Research shows that chronic anxiety can flatten or reverse this pattern, keeping cortisol elevated at night. When cortisol is high at bedtime, your heart rate stays up, your muscles stay tense, and your brain stays vigilant.

Hypervigilance and the amygdala

Your amygdala processes threat signals. In people with anxiety, the amygdala is hyperreactive, interpreting ambiguous signals as dangerous. At night, the sensation of your own heartbeat can trigger this threat detection, leading to a cascade of anxiety that further elevates your heart rate. It is your brain treating your own body as a source of danger.

Is It Anxiety or Something Else?

When to consider other causes

Anxiety is the most common cause of heart racing at bedtime, but it is not the only one. Other conditions that can cause nighttime heart palpitations include:

  • Thyroid disorders (hyperthyroidism increases resting heart rate)
  • Sleep apnea (breathing interruptions trigger adrenaline surges)
  • Cardiac arrhythmias (irregular heart rhythms that may worsen when lying down)
  • Dehydration or electrolyte imbalances (low magnesium or potassium)
  • Nicotine or caffeine consumed too close to bedtime

How to tell the difference

Anxiety-driven heart racing typically comes with racing thoughts, muscle tension, and a sense of dread. It often starts before you lie down and responds to calming techniques. Cardiac causes may produce irregular rhythms (skipped beats, fluttering), occur without anxiety, or persist even when you feel calm. If you are unsure, see a doctor. A simple ECG and blood panel can clarify the picture.

How to Calm Anxiety Heart Racing When Trying to Sleep

Physiological sigh breathing

This technique, studied by Stanford researchers, involves a double inhale through the nose followed by a long exhale through the mouth. The double inhale maximally inflates the lung's air sacs, and the extended exhale activates the vagus nerve, which directly slows heart rate. Try 5 to 10 cycles.

4-7-8 breathing

Breathe in for 4 seconds, hold for 7 seconds, exhale for 8 seconds. The extended exhale phase stimulates your parasympathetic nervous system and shifts your body toward a rest state. This technique is particularly effective because it gives your mind a structured task, redirecting attention away from your heartbeat.

Progressive muscle relaxation

Starting from your toes and working upward, tense each muscle group for 5 seconds, then release for 30 seconds. This technique works by activating the relaxation response through the contrast between tension and release. Studies show it reduces heart rate, blood pressure, and subjective anxiety.

Cold exposure for the vagus nerve

Splashing cold water on your face or placing a cold washcloth on your forehead triggers the dive reflex, which rapidly activates the parasympathetic nervous system and slows heart rate. This is one of the fastest ways to interrupt an acute anxiety response at bedtime.

Cognitive defusion

Instead of fighting the thought "my heart is racing and something is wrong," acknowledge it without judgment: "I notice my heart is beating faster. This is my anxiety response. It will pass." This cognitive defusion technique from acceptance and commitment therapy reduces the emotional charge of anxious thoughts without trying to suppress them.

Lifestyle Changes That Reduce Nighttime Anxiety

Exercise timing matters

Regular exercise reduces baseline anxiety and improves sleep quality. But intense exercise within 2 to 3 hours of bedtime can elevate heart rate and cortisol at the wrong time. Aim for moderate to vigorous exercise earlier in the day. Gentle yoga or stretching in the evening can actually lower heart rate before bed.

Caffeine and stimulant awareness

Caffeine has a half-life of 5 to 6 hours, meaning half the caffeine from your 2 p.m. coffee is still circulating at 8 p.m. If you are experiencing anxiety when trying to sleep, move your caffeine cutoff to before noon. Also watch for hidden caffeine in chocolate, certain teas, and pre-workout supplements.

Evening routine structure

Create a consistent wind-down routine starting 60 to 90 minutes before bed. Dim the lights (bright light suppresses melatonin), avoid screens, and engage in low-stimulation activities. This signals to your nervous system that the threat level is dropping. Over time, this routine becomes a conditioned cue for relaxation.

Nutrition and supplementation

Magnesium supports GABA activity, the neurotransmitter that calms neural excitability. Low magnesium is associated with increased anxiety and elevated heart rate. Tart cherry juice contains natural melatonin precursors. Avoid heavy meals and alcohol close to bedtime, as both can increase heart rate during sleep.

When to See a Doctor

Red flags that need evaluation

See a healthcare provider if your nighttime heart racing is accompanied by chest pain, shortness of breath unrelated to anxiety, fainting or near-fainting, irregular heartbeat patterns, or persistent symptoms despite anxiety management techniques. Also get evaluated if you experience excessive daytime sleepiness, loud snoring, or gasping during sleep, as these may indicate sleep apnea.

What testing might look like

Your care team may order an ECG, Holter monitor (24-hour heart rhythm recording), thyroid panel, or a sleep study. Blood work can reveal thyroid imbalances, electrolyte deficiencies, or cortisol abnormalities that contribute to nighttime heart racing. Ruling out physical causes allows you to focus treatment on the anxiety component.

Building Long-Term Resilience

CBT-I for lasting change

Cognitive behavioral therapy for insomnia addresses both the cognitive patterns (catastrophic thinking about sleep) and the behavioral patterns (clock-watching, spending too much time in bed) that maintain anxiety when trying to sleep. Research consistently shows that CBT-I produces lasting improvements in sleep quality without medication dependence.

Vagal tone training

Your vagal tone determines how quickly your heart rate can recover from stress. Higher vagal tone means faster recovery. Regular practices like meditation, deep breathing, cold exposure, and aerobic exercise all improve vagal tone over time. Think of it as training your nervous system's brake pedal to be more responsive.

Your Heart Rate Tells a Story. So Does Your Blood.

Anxiety heart racing when trying to sleep is often driven by a combination of psychological patterns and physiological imbalances. Cortisol rhythms, magnesium levels, thyroid function, and other biomarkers all influence how your nervous system behaves at night.

Superpower's at-home blood panel tests over 100 biomarkers related to stress, sleep, and cardiovascular health. Your personalized results reveal whether your body's chemistry is working for or against you at bedtime.

Start your Superpower panel and uncover the data behind your nighttime anxiety.

Latest