Nighttime leg pain is extremely common, and it usually comes down to one of a handful of causes: muscle cramps, restless legs, poor circulation, or nerve irritation. The reason these problems flare up at night specifically is that lying still removes the distractions of the day, changes how blood flows through your legs, and puts certain muscles and nerves in positions that trigger discomfort. Understanding what type of pain you’re feeling is the fastest way to figure out what’s behind it.
Nocturnal Leg Cramps
The most common cause of nighttime leg pain is a sudden, involuntary muscle spasm, usually in the calf, foot, or thigh. It feels like the muscle has clenched into a hard knot and won’t release. These cramps can last anywhere from a few seconds to several minutes, and they often leave the muscle sore for hours afterward.
The triggers are surprisingly ordinary. Sitting for long stretches during the day, standing on hard floors, not drinking enough water, overworking your muscles, or simply not moving enough can all set the stage. Certain medications increase your risk too, particularly diuretics (which increase urine output and can deplete fluids), blood pressure drugs, cholesterol-lowering statins, and birth control pills. Pregnancy is another well-known trigger.
Underlying health conditions can also cause nocturnal cramps. Kidney disease, diabetes, thyroid disorders, anemia, and peripheral artery disease all appear on the list. If your cramps are frequent (more than a few times per week) or getting worse over time, that pattern is worth investigating rather than writing off as random.
The Magnesium Question
Many people reach for magnesium supplements to stop leg cramps, but the evidence is weak. In a randomized trial published in a major medical journal, 94 adults with frequent nighttime cramps took either a high dose of magnesium oxide or a placebo every night. The number of weekly cramps dropped at the same rate in both groups. That doesn’t mean magnesium is useless for every person, but it’s not the reliable fix it’s often marketed as.
Restless Legs Syndrome
Restless legs syndrome, or RLS, feels different from a cramp. Instead of a sharp muscle spasm, you feel an uncomfortable urge to move your legs. People describe it as crawling, tingling, pulling, or an itch deep inside the leg that you can’t scratch. The hallmark of RLS is that it gets worse when you’re lying still and temporarily improves when you get up and walk around, which is why it disrupts sleep so effectively.
Doctors diagnose RLS based on five criteria established by the International Restless Legs Syndrome Study Group: a strong urge to move the legs paired with uncomfortable sensations, symptoms that start or worsen during rest, temporary relief with movement, symptoms that are worse at night, and no other condition that fully explains them. If all five apply to you, RLS is the likely explanation. It can run in families or be triggered by iron deficiency, pregnancy, or kidney disease.
Circulation Problems
Two types of blood flow issues cause leg pain that worsens at night, and they work in opposite directions.
Chronic venous insufficiency (CVI) happens when the valves inside your leg veins become damaged and can’t push blood back up toward the heart efficiently. Blood pools in the lower legs, creating pressure that makes them feel heavy, achy, and tired. Cramping at night is a classic symptom. You may also notice swelling around the ankles that gets worse as the day goes on, or skin changes near the lower leg. Elevating your legs above heart level helps relieve the pressure, which is why propping your legs up on pillows at bedtime can make a noticeable difference.
Peripheral artery disease (PAD) is the opposite problem: not enough blood getting to the legs. Narrowed arteries reduce oxygen delivery to the muscles, and in mild cases this only causes pain during walking (a symptom called claudication). In more severe cases, the pain shows up even at rest or while lying down. PAD-related rest pain tends to feel like a deep ache or burning in the feet or calves and is a sign that blood flow is significantly compromised.
Nerve-Related Pain
Peripheral neuropathy, most commonly caused by diabetes, produces a distinct type of nighttime leg pain. Instead of cramping or aching, you feel burning, tingling, “pins and needles,” or sharp shooting pain, typically starting in the feet and moving upward. Numbness and weakness can accompany it. Symptoms are often worse at night, partly because there are fewer sensory distractions when you’re lying in bed, and partly because nerve damage can interfere with how your body regulates sensation during rest.
Spinal stenosis, a narrowing of the spinal canal, can also refer pain into the legs. This tends to feel like aching or heaviness that worsens with certain positions, particularly lying flat on your back, and improves when you bend forward or curl up.
What You Can Do Tonight
For cramps, the immediate fix is to stretch the affected muscle. If the cramp is in your calf, flex your foot upward (pulling your toes toward your shin) and hold it until the spasm releases. Standing and pressing the ball of your foot into the floor works too. Gently massaging the muscle afterward can reduce the lingering soreness.
For prevention, a few daily habits make a real difference:
- Stay hydrated throughout the day. Dehydration is one of the most common and fixable triggers for nocturnal cramps.
- Stretch your calves before bed. A simple wall stretch, leaning forward with one leg extended behind you, held for 30 seconds per side, can reduce cramp frequency.
- Move during the day. Prolonged sitting or standing without breaks primes muscles for nighttime spasms. Short walks or calf raises every hour help.
- Adjust your sleeping position. If you sleep on your back, heavy blankets can push your feet into a pointed position that shortens calf muscles and invites cramps. Loosening the covers or using a pillow to prop your feet can help. For venous insufficiency, elevating your legs on a pillow reduces pooling.
- Watch your posture during the day. Poor posture places extra strain on leg muscles that can show up hours later as nighttime pain.
Signs That Need Prompt Attention
Most nighttime leg pain is uncomfortable but not dangerous. A few patterns, however, signal something more serious. Pain or cramping in one leg only, combined with swelling, warmth, or a change in skin color (redness or a purplish hue), could indicate a deep vein thrombosis, a blood clot in a deep leg vein. This requires medical evaluation quickly, not because of the leg itself, but because a clot can break loose and travel to the lungs. If leg symptoms are accompanied by sudden shortness of breath, chest pain, dizziness, a rapid pulse, or coughing up blood, that combination is a medical emergency.
Persistent rest pain in your feet or calves that doesn’t respond to stretching or position changes, especially if you also have wounds on your feet that heal slowly, suggests significantly reduced blood flow from peripheral artery disease. Burning or tingling that progresses over weeks or months, particularly if you have diabetes or prediabetes, points to neuropathy that benefits from early treatment to slow its progression. Frequent cramps paired with muscle weakness, fluid retention, or electrolyte problems also warrant a closer look with blood work.