Why Does My Leg Hurt at Night? Causes and Relief

Nighttime leg pain is remarkably common, affecting 50 to 60 percent of adults at some point. The most frequent cause is nocturnal leg cramps, those sudden, involuntary muscle contractions that jolt you awake. But cramps aren’t the only explanation. Several other conditions cause or worsen leg pain specifically when you’re lying down, and telling them apart matters because the remedies are different.

Nocturnal Leg Cramps

The classic nighttime leg pain is a cramp, usually in the calf, that strikes without warning and lasts anywhere from a few seconds to several minutes. The muscle locks up hard, and you can often feel a visible knot under the skin. Even after the cramp releases, soreness can linger for hours.

No one fully understands why these cramps happen more at night. The leading theory involves how your muscles shorten while you sleep. When you lie with your feet pointed slightly downward (as most people naturally do), the calf muscles stay in a contracted position for long stretches. That sustained shortening may make the muscle more prone to firing involuntarily. Dehydration, electrolyte shifts, and simple muscle fatigue from the day’s activity all raise the odds.

Your risk goes up with age, during pregnancy, and if you spend long hours sitting or standing without much movement. Certain medications also contribute. Birth control pills, blood pressure drugs, cholesterol-lowering medications, and diuretics (which increase urine output and can deplete electrolytes) are all linked to more frequent cramps.

Restless Legs Syndrome

Restless legs syndrome (RLS) is often confused with cramps, but it feels quite different. Instead of a sudden, painful contraction, RLS produces a deep, uncomfortable urge to move your legs. People describe it as crawling, tingling, pulling, or an itch that lives inside the muscle rather than on the skin. The sensation starts or intensifies when you’re resting, particularly when lying down at night, and moving your legs temporarily relieves it.

The key distinctions: RLS is usually not painful in the sharp, cramping sense. It lasts much longer than a cramp, sometimes persisting for hours. And the hallmark is the irresistible need to move. If you find yourself kicking, shifting, or getting up to pace around the bedroom, RLS is more likely than cramps. The condition is worse at night by definition; worsening symptoms in the evening is one of the core diagnostic criteria.

Poor Circulation and Artery Disease

Peripheral artery disease (PAD) happens when the arteries supplying your legs narrow, reducing blood flow. Early on, PAD causes pain during walking that fades with rest. But as it progresses, the pain can appear even when you’re lying still. This is sometimes called ischemic rest pain, a burning or aching sensation in your feet, toes, or lower legs that shows up when you’re flat in bed.

There’s a telling clue with PAD: dangling your legs over the edge of the bed often eases the pain. Gravity helps blood flow downward into the legs, partially compensating for the narrowed arteries. If you notice that sitting up or hanging your feet off the bed brings relief, that’s worth mentioning to your doctor. PAD is more common in smokers, people with diabetes, and those with high blood pressure or high cholesterol.

Venous Insufficiency

While artery disease involves blood struggling to reach your legs, venous insufficiency is the opposite problem: blood struggling to get back up to your heart. Your leg veins contain one-way valves that push blood upward against gravity. When those valves weaken or fail, blood flows backward and pools in the lower legs. This is called venous reflux.

The result is a heavy, full, aching feeling in the legs that typically worsens as the day goes on. By evening, your legs may be noticeably swollen around the ankles. Lying down can actually help venous insufficiency (since gravity is no longer working against the veins), but many people feel the cumulative effects most at bedtime after hours of standing or sitting. Visible varicose veins, skin discoloration around the ankles, and swelling that improves overnight are all common signs.

Nerve-Related Causes

Peripheral neuropathy, or damage to the nerves in your legs and feet, often produces burning, tingling, or shooting pain that gets worse at night. This happens partly because daytime distractions fade when you’re lying in a quiet room, making nerve signals more noticeable. But there’s also a physiological component: some nerve pain follows a circadian pattern and genuinely intensifies in the evening.

Diabetes is the most common cause of peripheral neuropathy, but it can also result from alcohol use, kidney disease, thyroid disorders, and certain medications including chemotherapy drugs. Spinal stenosis, a narrowing of the spinal canal that compresses nerves, can produce similar symptoms. The pain from spinal stenosis often radiates down one or both legs and may be worse when lying flat because of how the spine’s position changes.

Other Contributing Conditions

Several metabolic and hormonal conditions can trigger or worsen nighttime leg pain. Thyroid disorders (both overactive and underactive), anemia, low blood sugar, kidney disease, and liver cirrhosis all appear on the list of conditions associated with nocturnal cramps. If your leg pain is frequent and unexplained, it can sometimes be the first clue to one of these underlying issues.

What Actually Helps

For cramps, the most reliable preventive measure is stretching your calves before bed. Stand facing a wall, place one foot behind you with the heel flat on the floor, and lean forward until you feel a stretch in the back calf. Hold for 30 seconds on each side. Doing this nightly can reduce both the frequency and intensity of cramps over time. Staying well-hydrated throughout the day (not just at bedtime) and getting regular, moderate exercise also help.

Magnesium supplements are one of the most popular home remedies for leg cramps, but the evidence is underwhelming. A large review of 11 clinical trials found no meaningful reduction in cramps from magnesium supplementation in the short term. One trial did show benefit after 60 days of daily use, with cramp frequency dropping from about 5.4 episodes per week to 1.9. But for courses shorter than two months, magnesium performed no better than a placebo. If you want to try it, know that results, if they come, take time.

For cramps that are already happening, flexing your foot upward (pulling your toes toward your shin) can help override the contraction. Massaging the muscle and applying heat afterward can ease the lingering soreness.

For RLS, the approach is different. Movement is the immediate relief, but long-term management often involves addressing iron levels (low iron is a common trigger), reducing caffeine and alcohol, and in some cases, prescription treatment.

Signs That Need Medical Attention

Most nighttime leg pain is benign, if annoying. But certain patterns suggest something more serious. Leg pain that comes with visible swelling, redness, or warmth in one leg could indicate a blood clot. Pain that only improves when you dangle your legs over the bed points to possible artery disease. Cramps accompanied by progressive muscle weakness or loss of muscle mass warrant evaluation. And if cramps are severe enough to regularly disrupt your sleep, leaving you exhausted during the day, that alone is reason enough to get checked out.