Why Do My Legs Ache at Night? Causes & Relief

Nighttime leg aching usually comes down to one of a handful of causes: muscle cramps, restless legs syndrome, poor circulation, nerve issues, or low levels of key minerals like magnesium or iron. The reason so many leg problems flare up at night specifically is that your body produces fewer pain-suppressing chemicals while you sleep, and the lack of movement and distraction removes a natural buffer that keeps pain signals from reaching your brain during the day.

How Your Body Amplifies Pain at Night

During the day, movement and sensory input act like a gate that blocks some pain signals from traveling through your spinal nerves to your brain. When you’re lying still in bed, that gate opens, letting more signals through. This is known as the gate control theory of pain, and it helps explain why conditions that barely bother you during the day can become impossible to ignore at night.

Your body also follows a natural rhythm of pain-suppressing hormones and chemicals that peak during waking hours and drop off at night, effectively lowering your pain threshold while you sleep. Cooler bedroom temperatures can compound the problem, since cold tends to worsen muscle and nerve pain. These factors don’t cause leg pain on their own, but they amplify whatever underlying issue is driving it.

Nocturnal Leg Cramps

The most common culprit is a sudden, painful contraction, usually in the calf, that strikes without warning. These nocturnal leg cramps can last anywhere from a few seconds to several minutes, and the muscle can feel sore for hours afterward. They’re distinct from the dull, restless aching of other conditions because they involve a hard, visible knot in the muscle that you can often feel with your hand.

Several medications are known to trigger or worsen night cramps. Diuretics (water pills), statins used for cholesterol, oral contraceptives, and drugs with stimulant effects (including caffeine and pseudoephedrine) all appear on the list. Withdrawal from alcohol, benzodiazepines, or sedatives can also cause cramping. If your leg cramps started or worsened after beginning a new medication, that connection is worth exploring.

Restless Legs Syndrome

Restless legs syndrome (RLS) feels very different from a cramp. Instead of a sharp contraction, you feel an uncomfortable urge to move your legs, often described as crawling, tingling, or pulling sensations deep inside the limb. It happens specifically at rest and in the evening or nighttime hours, and moving your legs temporarily relieves it. The key distinction: cramps lock your muscle in place, while RLS makes it nearly impossible to keep your legs still.

One of the most overlooked treatments for RLS is iron. Research from Harvard Health shows that when your ferritin level (a measure of stored iron) falls to 50 micrograms per liter or below, iron supplementation can significantly improve symptoms. Many people with RLS have ferritin levels that are technically “normal” by standard lab ranges but still low enough to drive the condition. A simple blood test can reveal whether this applies to you.

Mineral Deficiencies

Low magnesium is a well-documented cause of muscle spasms, cramps, and numbness in the hands and feet. Normal magnesium levels fall between 1.46 and 2.68 milligrams per deciliter, and even mild drops below that range can trigger symptoms. Magnesium is lost through sweat, certain medications (especially diuretics), and diets low in leafy greens, nuts, and whole grains. Mild deficiency is typically treated with oral magnesium tablets.

Potassium and calcium play similar roles in muscle function. Pregnant women are particularly susceptible to leg cramps during the second and third trimesters, and some research points to lower blood calcium levels during pregnancy as a contributing factor. These cramps tend to strike at night and usually resolve after delivery.

Circulation Problems

Two vascular conditions commonly cause nighttime leg pain, and they work in opposite ways.

Chronic Venous Insufficiency

In chronic venous insufficiency (CVI), the valves inside your leg veins stop closing properly. Blood that should flow upward toward your heart falls backward under gravity, pooling in your lower legs. This causes achy, tired-feeling legs, nighttime cramping, and swelling that worsens after standing or by the end of the day. Elevating your legs above heart level helps relieve the pressure, and compression stockings during the day can prevent blood from pooling in the first place.

Peripheral Artery Disease

Peripheral artery disease (PAD) is a narrowing of the arteries that supply blood to your legs. In earlier stages, it causes pain only during walking. As it progresses, you may feel a burning or aching pain in your legs, feet, or toes even while lying flat. This is called rest pain, and it’s a sign that your tissues aren’t getting enough blood flow. A telling clue: dangling your legs over the edge of the bed often relieves the pain, because gravity helps push blood downward into the narrowed arteries. If you notice this pattern, it warrants medical evaluation, since rest pain indicates a more advanced stage of the disease.

Nerve Pain and Neuropathy

Damage to the peripheral nerves, most commonly from diabetes, can cause burning, tingling, or deep aching in the legs and feet that intensifies at night. This happens because of that gate control mechanism: during the day, normal sensory input from walking and touching things competes with pain signals and partially drowns them out. At night, with no competing input, the nerve pain has a clear path to your brain. Cooler bedroom temperatures make it worse, since cold aggravates most types of neuropathy pain.

Neuropathy pain tends to start in the feet and gradually work upward. It often feels like burning, electric shocks, or a “pins and needles” sensation rather than the deep muscular ache of cramps or circulation problems. If you have diabetes or prediabetes and notice these patterns, your blood sugar management is directly connected to how much nerve damage progresses over time.

Simple Stretches That Help

For calf cramps specifically, a wall stretch done before bed can reduce how often they occur. Stand about three feet from a wall, lean forward with your arms outstretched and palms flat against the wall, and keep your feet flat on the floor. Hold for a count of five, then release. Repeat this for at least five minutes, three times per day. The stretch targets the calf muscles that are most prone to nocturnal cramping.

Other practical steps that can reduce nighttime leg aching regardless of the cause: keep your bedroom warm enough to prevent cold-related pain flares, stay hydrated throughout the day (dehydration contributes to cramping), and avoid caffeine and stimulants in the evening, since both are linked to increased cramp frequency.

Signs That Need Prompt Attention

Most nighttime leg aching is uncomfortable but not dangerous. A few specific patterns, however, signal something more serious. Swelling in one leg (not both), a change in skin color to red or purple, and warmth in the affected area are hallmarks of a deep vein thrombosis, a blood clot that can become life-threatening if it travels to the lungs. If leg pain is accompanied by sudden shortness of breath, chest pain that worsens with breathing, a rapid pulse, or coughing up blood, that combination suggests a pulmonary embolism and requires emergency care.

Burning or aching that only improves when you dangle your legs off the bed, as described with PAD, also deserves medical evaluation since it indicates significantly reduced blood flow. And leg aching that started after a new medication is worth bringing up with your prescriber, since the fix may be as simple as adjusting the dose or switching to an alternative.