Why Is My Leg Aching at Night: Causes and Relief

Nighttime leg aching is remarkably common. About 30% of adults experience leg cramps or pain at night at least five times per month, and roughly 6% deal with moderate to severe episodes. The causes range from simple muscle fatigue and dehydration to circulatory problems and nerve issues, and the specific pattern of your pain, where exactly it hits, and what makes it better or worse can help narrow down what’s going on.

Muscle Cramps: The Most Common Culprit

Nocturnal leg cramps are the single most frequent reason for nighttime leg pain. They hit suddenly, usually in the calf, and produce a hard, knotted feeling that can last from a few seconds to several minutes. The soreness left behind can linger for hours. These cramps tend to increase with age and are more common during pregnancy.

Why they happen at night specifically isn’t fully understood, but the leading theories involve how muscles behave at rest. During the day, regular movement keeps blood flowing and muscles engaged. When you’re lying still in bed, subtle shortening of the calf muscles (especially if you sleep with your feet pointed downward) can trigger involuntary contractions. Dehydration and electrolyte shifts overnight may also play a role, since you go hours without drinking water.

Several medications are known to cause leg cramps as a side effect. These include diuretics (water pills), statins used for cholesterol, certain antidepressants, sleep medications, estrogen-based drugs like birth control pills, and some pain relievers. Chemotherapy drugs can also cause nerve damage that leads to cramping. If your nighttime leg pain started around the same time as a new prescription, that connection is worth exploring.

Restless Legs Syndrome

If your legs don’t cramp but instead feel deeply uncomfortable with an irresistible urge to move them, restless legs syndrome (RLS) is a likely explanation. The sensation is often described as crawling, pulling, throbbing, or just an unbearable restlessness deep inside the legs. It’s distinct from a cramp because movement actually helps. Walking, stretching, or even just shifting position temporarily eases the discomfort.

RLS follows a specific pattern. Symptoms start or worsen when you’re resting, particularly when lying down. They’re consistently worse in the evening and at night. And they can’t be explained by another condition like positional discomfort or a muscle injury. If all four of those criteria fit your experience, RLS is the most likely diagnosis. It’s linked to iron deficiency, kidney disease, and pregnancy, though many people have it without any identifiable underlying cause.

Poor Circulation in the Veins

Chronic venous insufficiency (CVI) happens when the valves inside your leg veins stop working properly. Healthy valves push blood upward toward the heart against gravity. When they fail, blood pools in the lower legs, building up pressure in the veins. This produces an achy, heavy, tired feeling that typically worsens through the day and carries into the night.

CVI has some telltale visual signs: swelling in the lower legs and ankles (especially after standing), visible varicose veins, and sometimes a reddish-brown discoloration of the skin near the ankles. Nighttime cramping is a common symptom. Left untreated, the pressure in the veins can become high enough to burst tiny capillaries near the skin’s surface, making the skin fragile and prone to slow-healing sores. If your nighttime aching comes with any of these visible changes, circulation is a strong suspect.

Reduced Blood Flow From Artery Disease

Peripheral artery disease (PAD) is a different circulation problem. Instead of blood pooling in the veins, the arteries that deliver fresh blood to the legs become narrowed by plaque buildup. In its earlier stages, PAD causes cramping and fatigue in the calves during walking that goes away within about 10 minutes of rest. This is called intermittent claudication.

In more advanced cases, PAD causes what’s known as ischemic rest pain, a burning or numb sensation in the foot or forefoot that typically wakes you up shortly after falling asleep. People often find relief by dangling the affected leg over the side of the bed, which uses gravity to push more blood into the foot. This is a serious warning sign. Rest pain that lasts more than two weeks signals that blood flow to the leg is critically low and needs medical attention to prevent tissue damage.

Nerve Compression and Spinal Issues

Problems in the lower spine can send pain radiating down into one or both legs. Spinal stenosis, a narrowing of the spinal canal in the lower back, causes pain and cramping in the legs that worsens with standing and walking but improves when you sit or bend forward. Lying flat in bed can sometimes compress the same nerves, producing aching or shooting pain down the leg.

Sciatica, caused by a herniated disc pressing on the sciatic nerve, follows a similar pattern. The pain typically runs from the lower back through the buttock and down the back of one leg. Certain sleeping positions, particularly lying flat on your back, can increase pressure on the affected nerve. If your nighttime leg pain follows a line from your back or hip down to your foot and worsens in certain positions, spinal nerve compression is worth investigating.

Does Magnesium Actually Help?

Magnesium supplements are one of the most popular home remedies for nighttime leg cramps, but the evidence is disappointing. In a controlled trial of 94 adults who averaged nearly eight nocturnal cramps per week, those who took magnesium oxide for four weeks saw their cramps drop by about 3.4 per week, while those taking a placebo saw a nearly identical drop of 3.0 per week. The difference was not statistically significant, and there was no improvement in cramp severity, duration, or sleep quality compared to placebo.

A broader systematic review reached the same conclusion: magnesium supplementation is unlikely to provide meaningful cramp prevention in adults. That doesn’t mean your magnesium levels don’t matter. True deficiency can contribute to muscle problems. But taking extra magnesium on top of adequate levels probably won’t fix nighttime leg pain.

What You Can Do Tonight

For simple muscle cramps, stretching the calf before bed is the most consistently recommended prevention strategy. Stand facing a wall with one foot back, keeping the back heel on the ground, and lean forward until you feel a stretch in the calf. Hold for 30 seconds on each side. Doing this nightly can reduce cramp frequency. When a cramp strikes, flexing your foot upward (pulling your toes toward your shin) forces the cramping calf muscle to relax. A warm towel or heating pad on the muscle afterward can ease residual soreness.

Staying hydrated throughout the day matters more than drinking a large amount right before bed. Keeping sheets and blankets loose at the foot of the bed prevents your feet from being pushed into a pointed position, which can trigger calf cramps. If you tend to sleep on your back, a pillow under your knees takes pressure off the lower spine and may help if nerve compression is contributing to your pain.

Signs That Need Medical Attention

Most nighttime leg aching is benign, but certain patterns signal something more serious. Swelling, redness, or warmth concentrated in one leg could indicate a blood clot. Burning pain in the foot that wakes you from sleep and has persisted for more than two weeks suggests critically reduced blood flow. Skin color changes near the ankles, particularly reddish-brown discoloration or skin that breaks open easily, point to advancing venous disease. Leg pain paired with fever, unexplained weight loss, or night sweats warrants prompt evaluation, as these can signal infection or other systemic conditions. And if your leg pain is severe enough that you can’t bear weight or it came on after an injury, that needs same-day assessment.