Why Is My Heart Beating Fast at Night and I Can't Sleep?

Your heart beating fast at night can disrupt sleep. Learn what causes nighttime heart palpitations, when to worry, and how to calm your heart for better rest.

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

The room is dark, everything is quiet, and then you feel it, your heart hammering in your chest. Each thump seems louder than it should be, and the harder you try to ignore it, the worse it gets. Most nocturnal palpitations are harmless, but telling the difference matters.

Key Takeaways

  • Your heart beating fast at night often feels more intense simply because you're lying still and hyper-aware of your body.
  • Caffeine, alcohol, dehydration, and heavy meals close to bedtime are common triggers for nighttime palpitations.
  • Anxiety and stress activate your sympathetic nervous system, raising your resting heart rate right when it should be dropping.
  • Thyroid imbalances, low magnesium, and electrolyte shifts can cause palpitations that blood testing can help identify.
  • Most nighttime palpitations are benign, but chest pain, dizziness, or fainting alongside a racing heart warrants immediate medical attention.

Why Your Heart Beats Faster at Night

Your nervous system shifts gears

During the day, noise, movement, and mental activity mask subtle changes in your heart rate. At night, your parasympathetic nervous system (the "rest and digest" branch) is supposed to take over and slow everything down. When it doesn't fully engage, you feel each beat more intensely.

Body position matters

Lying on your left side can bring your heart closer to your chest wall, making each contraction feel stronger. A study in Clinical Autonomic Research showed that body position significantly influences heart rate variability during sleep. This doesn't mean something is wrong. It means your heart is simply easier to detect.

Heightened interoception at rest

When external stimulation drops, your brain turns its attention inward. This phenomenon, called interoception, means you become more aware of signals from your organs. If you're already anxious, this awareness can spiral into a feedback loop where noticing your heartbeat makes it beat faster.

Common Causes of a Racing Heart at Bedtime

Caffeine and stimulant lingering

Caffeine has a half-life of about five hours. That afternoon espresso at 3 p.m. still has half its stimulant power at 8 p.m. Research published in the Journal of Clinical Sleep Medicine found that caffeine consumed even six hours before bed significantly disrupted sleep quality. If your heart is beating fast at night and you can't sleep, your coffee habit is the first place to look.

Dehydration and electrolyte imbalances

When your blood volume drops from dehydration, your heart compensates by beating faster to maintain circulation. Low levels of magnesium, potassium, or calcium can also trigger palpitations. These minerals regulate the electrical impulses that keep your heart rhythm steady.

Thyroid overactivity

An overactive thyroid (hyperthyroidism) revs up your metabolism, including your heart rate. If nighttime palpitations come with unexplained weight loss, heat intolerance, or tremors, a thyroid function test can clarify what's happening.

Alcohol before bed

Alcohol might make you drowsy, but it raises your heart rate as your body metabolizes it. A study in JAMA Network Open confirmed that even moderate drinking elevated resting heart rate for several hours afterward.

When Nighttime Palpitations Signal Something Serious

Red flags to watch for

Most palpitations are harmless premature beats or sinus tachycardia. But certain symptoms alongside a racing heart demand prompt medical evaluation:

  • Chest pain or tightness that doesn't resolve within a few minutes
  • Dizziness, lightheadedness, or fainting
  • Shortness of breath at rest
  • A heart rate consistently above 100 bpm at rest without an obvious trigger
  • Episodes lasting longer than a few minutes or occurring frequently

Arrhythmias worth investigating

Atrial fibrillation (AFib) affects more than 12 million Americans, and episodes often strike at night. AFib feels like an irregular, fluttering heartbeat rather than a simple fast beat. If your palpitations feel chaotic rather than just fast, mention this to your care team. A Holter monitor or event recorder can capture what's happening electrically while you sleep.

How Anxiety and Stress Fuel Nighttime Heart Racing

The cortisol connection

Stress raises cortisol, and elevated cortisol keeps your sympathetic nervous system (the "fight or flight" branch) on high alert. When you finally lie down, your body may still be running on daytime stress hormones. Research in Psychoneuroendocrinology links elevated evening cortisol to poor sleep onset and increased heart rate variability disruption.

The anxiety-palpitation feedback loop

Noticing your heart beating fast at night can trigger sleep anxiety, which further raises your heart rate. This loop is why many people with health anxiety report worse palpitations. Cognitive behavioral therapy for insomnia (CBT-I) has shown strong results in breaking this cycle, according to research in Annals of Internal Medicine.

Hypervigilance at bedtime

If you've experienced a scary palpitation episode before, your brain may become hypervigilant at bedtime. You scan for the sensation, find it, and escalate. Recognizing this pattern is the first step toward calming it. Mindfulness-based stress reduction can help retrain your response to body sensations.

The Role of Diet and Stimulants

Heavy meals before bed

Eating a large meal within two hours of bedtime forces your cardiovascular system to work harder to support digestion. Blood flow redirects to your gut, and your heart rate increases to compensate. Sleeping right after eating can also worsen acid reflux, which itself mimics chest tightness and palpitations.

Sugar spikes and crashes

A high-sugar snack before bed can trigger a blood sugar spike followed by a reactive drop. That drop activates your adrenal glands, releasing adrenaline to bring glucose back up. The result? A racing heart at exactly the wrong time. Choosing a protein-rich evening snack, like peanut butter, can stabilize blood sugar through the night.

Nicotine and other stimulants

Nicotine is a stimulant that raises heart rate and blood pressure. Smoking or vaping close to bedtime puts your cardiovascular system into a state that's the opposite of sleep-ready. Even nicotine patches can cause nighttime palpitations if worn overnight.

How to Calm a Fast Heartbeat at Night

Vagal maneuvers

Stimulating your vagus nerve activates the parasympathetic nervous system and can slow your heart rate within seconds. Try these techniques when you feel your heart racing in bed:

  • Slow, deep breathing: inhale for 4 counts, hold for 4, exhale for 6
  • Bearing down gently (the Valsalva maneuver)
  • Splashing cold water on your face to trigger the dive reflex
  • Gentle carotid sinus massage (ask your care team to show you the proper technique first)

Progressive muscle relaxation

Tensing and releasing muscle groups from your toes to your scalp redirects your attention away from your heartbeat and signals your nervous system to stand down. A meta-analysis in BMC Psychiatry found progressive muscle relaxation significantly improved sleep quality and reduced anxiety symptoms.

Change your position

If you feel palpitations while lying on your left side, try shifting to your right side or propping yourself up slightly with an extra pillow. Elevating your upper body can also help if acid reflux is contributing to the sensation. Sometimes the simplest fix is the most effective.

Lifestyle Changes for Long-Term Relief

Set a caffeine curfew

Cut off caffeine by noon, or at least eight hours before your target bedtime. This includes coffee, energy drinks, pre-workout supplements, and dark chocolate. Track whether your nighttime heart rate drops over the following week.

Build a wind-down routine

Your nervous system needs a transition period between the stimulation of your day and the stillness of sleep. Spend 30 to 60 minutes before bed on low-stimulation activities: reading, gentle stretching, or listening to calming music. White noise machines can also mask the silence that amplifies your awareness of your heartbeat.

Stay hydrated and check your minerals

Drink water consistently throughout the day, not just at bedtime. If you exercise heavily or sweat a lot, consider an electrolyte supplement. Testing your magnesium, potassium, and calcium levels through a blood panel can reveal deficiencies you'd never guess from symptoms alone.

Move your body earlier in the day

Regular exercise strengthens your heart and lowers your resting heart rate over time. But intense workouts within two to three hours of bedtime can temporarily elevate your heart rate and cortisol. Aim to finish vigorous activity by early evening.

Take the Guesswork Out of Your Heart Health

Understanding why your heart is beating fast at night means looking beyond the symptom to the underlying drivers. Thyroid function, electrolyte balance, and stress hormones all play roles that you can't assess by feel alone.

Superpower's comprehensive blood panel measures over 100 biomarkers, including thyroid hormones, magnesium, potassium, and cortisol markers linked to nighttime palpitations. Paired with personalized protocols, you get a clear picture of what's driving your symptoms and what to do about it.

Start your Superpower membership today and turn those late-night questions into real answers.

Frequently Asked Questions

Is it normal for your heart to beat fast when you lie down?

A slight increase in heart rate awareness when lying down is normal because your body is still and your attention turns inward. However, a sustained resting heart rate above 100 bpm or palpitations accompanied by dizziness, chest pain, or shortness of breath should be evaluated by a doctor. Most people simply notice their heartbeat more when external distractions disappear.

Can lack of sleep cause heart palpitations?

Yes. Sleep deprivation raises cortisol and activates your sympathetic nervous system, which can increase your resting heart rate and trigger palpitations. A study in the European Heart Journal found that people sleeping fewer than six hours per night had a significantly higher risk of cardiovascular events. Prioritizing consistent sleep duration helps stabilize heart rhythm.

Why does my heart race from anxiety when trying to sleep?

Anxiety activates your fight-or-flight response, releasing adrenaline and cortisol that speed up your heart. At bedtime, without distractions to redirect your focus, you become hyper-aware of the sensation, which creates a feedback loop. Techniques like deep breathing, progressive muscle relaxation, and cognitive behavioral therapy can interrupt this cycle effectively.

Should I go to the ER for heart palpitations at night?

Seek emergency care if palpitations come with chest pain, fainting, severe dizziness, shortness of breath, or a heart rate that stays above 150 bpm. Isolated palpitations that last a few seconds and resolve on their own are usually benign. When in doubt, call your care team or a nurse hotline for guidance specific to your symptoms.

Can dehydration cause a fast heartbeat at night?

Absolutely. When you're dehydrated, your blood volume decreases and your heart pumps faster to maintain adequate circulation. This effect is more noticeable at night when you haven't been drinking water for several hours. Staying hydrated throughout the day, not just at bedtime, helps prevent this compensatory heart rate increase.

Does magnesium help with nighttime heart palpitations?

Magnesium plays a critical role in regulating heart rhythm by managing the electrical signals in your cardiac cells. Low magnesium levels are associated with palpitations, and supplementation may help if you're deficient. A blood test is the best way to confirm your levels before starting supplements, since too much magnesium can cause its own problems.

How do I know if my heart palpitations are caused by my thyroid?

Thyroid-related palpitations typically come with other symptoms like unexplained weight changes, heat or cold intolerance, tremors, or fatigue. A simple blood test measuring TSH, free T3, and free T4 can identify whether your thyroid is overactive or underactive. If your thyroid hormones are out of range, treating the thyroid issue usually resolves the palpitations.

What sleeping position is best to avoid heart palpitations?

Sleeping on your right side or on your back tends to reduce the sensation of palpitations. Lying on your left side brings your heart closer to the chest wall, making each beat feel more prominent. Elevating your head slightly with an extra pillow can also help, especially if acid reflux contributes to the sensation of chest tightness.