Why Do My Legs Hurt So Bad at Night? Causes & Fixes

Nighttime leg pain is extremely common, affecting 50 to 60 percent of adults at some point. The reason your legs hurt more at night than during the day usually comes down to one of a handful of causes: muscle cramps, restless legs syndrome, poor circulation, or nerve pain. Each feels different, has different triggers, and responds to different fixes.

The good news is that most nighttime leg pain isn’t dangerous. But understanding which type you’re dealing with helps you address it effectively and recognize the rare situations that need medical attention.

Nocturnal Leg Cramps

The most common culprit is a sudden, involuntary tightening of the muscle, usually in the calf. These cramps strike without warning, often jolting you awake with intense pain that can last anywhere from a few seconds to several minutes. You can sometimes feel a hard knot in the muscle. Cramps happen more frequently as you age, and pregnant women are especially prone to them.

The exact mechanism isn’t fully understood, but several factors raise your risk significantly. Dehydration is a major one, especially if you’re not drinking enough water during the day or you sweat heavily. Muscle fatigue from overuse, or paradoxically, prolonged inactivity can both trigger cramps. Certain medications, including birth control pills, blood pressure drugs, and cholesterol-lowering statins, are known contributors. Underlying conditions like kidney disease, diabetes, thyroid disorders, and anemia also increase cramping frequency.

When a cramp hits, stretching the affected muscle provides the fastest relief. For a calf cramp, flex your foot upward (pulling your toes toward your shin) and hold the stretch. Standing up and putting your weight on the cramping leg also helps. Massaging the muscle can ease the spasm. Most cramps resolve on their own within minutes even if you do nothing, but stretching shortens the episode considerably.

What About Magnesium?

You’ve probably seen magnesium supplements marketed as a cramp cure. The evidence is underwhelming. A Cochrane review pooling data from multiple trials found that magnesium supplements reduced cramp frequency by less than 10 percent compared to placebo in older adults, a difference that wasn’t statistically significant. For pregnancy-related cramps, one small trial showed a larger benefit, but the data had inconsistencies that make it hard to draw firm conclusions. If you suspect you’re low in magnesium, supplementation is unlikely to cause harm, but don’t expect it to eliminate your cramps.

Restless Legs Syndrome

If your legs don’t cramp but instead feel deeply uncomfortable with an almost irresistible urge to move them, you may be dealing with restless legs syndrome (RLS). The sensation is hard to describe. People often call it crawling, tingling, pulling, or an aching deep inside the legs. The defining feature is that moving your legs or walking around temporarily relieves it, while sitting or lying still makes it worse.

RLS is diagnosed based on four criteria: you feel a strong urge to move your legs, the urge begins or worsens during rest, movement partially relieves it, and symptoms are worse at night. If all four apply, that’s your answer. RLS runs in families and is linked to iron deficiency, so your doctor may check your iron levels as a first step.

Circulation Problems

Two vascular conditions commonly cause leg pain that worsens at night, and they feel quite different from each other.

Peripheral Artery Disease

Peripheral artery disease (PAD) involves narrowed arteries that reduce blood flow to your legs. In its earlier stages, PAD causes leg pain mainly during walking. But as it progresses, you can develop rest pain, a burning or aching sensation in your legs, feet, or toes that shows up when you’re lying flat. This happens because gravity is no longer helping push blood down to your lower legs, and the narrowed arteries can’t deliver enough on their own. A telltale sign: dangling your legs over the edge of the bed relieves the pain. PAD is more common in smokers, people with diabetes, and those with high blood pressure or high cholesterol.

Chronic Venous Insufficiency

This condition works in the opposite direction. Valves inside your leg veins are supposed to push blood upward toward your heart, fighting gravity with each step you take. When those valves become damaged, blood flows backward and pools in your lower legs. The result is aching, heaviness, and swelling that typically builds throughout the day and peaks by evening. Your legs may feel their worst right when you climb into bed after a long day on your feet. Over time, the increased pressure in your leg veins can cause visible changes like varicose veins, skin discoloration, or even small ulcers near the ankles.

If your nighttime leg pain comes with noticeable swelling that improves after a night of sleep and worsens again by evening, venous insufficiency is a likely explanation. Elevating your legs above heart level, using a pillow under your calves while you sleep, helps blood drain back toward your heart and reduces that pooling pressure.

Nerve Pain (Neuropathy)

Nerve damage in the legs, most commonly from diabetes but also from alcohol use, vitamin deficiencies, or other conditions, tends to produce burning, tingling, or shooting pains that many people notice more at night. There are a few reasons for this pattern.

The most widely accepted explanation is called the gate control theory of pain. During the day, your brain receives a constant stream of sensory input from movement, touch, and activity. That input essentially competes with pain signals, keeping the “gates” in your spinal cord partially closed. At night, when you’re lying still in a quiet room, those competing signals drop away and pain signals travel to your brain more freely. It’s not that the nerve damage gets worse at night. It’s that your brain has less distraction from it.

Your body’s natural pain-suppressing chemicals also follow a daily rhythm, peaking during daytime hours and dipping at night. On top of that, cooler bedroom temperatures can worsen neuropathy pain directly. If nerve pain is disrupting your sleep, keeping your bedroom warm and wearing socks to bed are simple steps that sometimes make a noticeable difference.

Preventing Nighttime Leg Pain

The best prevention strategy depends on the underlying cause, but several approaches help across the board:

  • Stay hydrated throughout the day. Dehydration is one of the most preventable triggers for nighttime cramps. Don’t wait until evening to catch up on water intake.
  • Stretch your calves before bed. A simple wall stretch, leaning forward with your hands on the wall and one leg extended behind you, held for 30 seconds per side, can reduce cramp frequency.
  • Move during the day. Prolonged sitting or standing in one position contributes to both cramps and circulation-related pain. Regular walking keeps blood flowing and muscles conditioned.
  • Elevate your legs. Placing a pillow under your knees or calves while sleeping helps with both venous insufficiency and general swelling. Ideally, position your legs at or above heart level. Even partial elevation on a lower pillow helps.
  • Watch your sleep position. Heavy blankets tucked tightly at the foot of the bed can push your feet into a pointed position, shortening the calf muscle and making cramps more likely. Keep sheets loose around your feet.

Signs That Need Prompt Attention

Most nighttime leg pain is uncomfortable but not dangerous. However, certain patterns warrant quick medical evaluation. One-sided leg swelling, especially if the skin feels warm or looks red or purple, can indicate a blood clot (deep vein thrombosis). This is particularly concerning if the pain started suddenly, feels like a deep cramp that won’t release, and is accompanied by visible swelling in one leg but not the other.

Rest pain from peripheral artery disease, where your feet burn or ache while lying down and improve when you dangle them, signals advanced arterial narrowing that needs treatment to prevent tissue damage. And any leg pain combined with sudden shortness of breath, chest pain, or a rapid pulse requires emergency care, as these can indicate a clot has traveled to the lungs.

For leg pain that’s been waking you up regularly for more than a few weeks, especially if stretching and hydration haven’t helped, a medical evaluation can identify whether an underlying condition like neuropathy, PAD, or venous disease is driving it. Many of these conditions respond well to treatment when caught early.