Nighttime leg aches are extremely common, affecting roughly 30% of adults at least five times a month. The percentage climbs even higher with age, with 37% to 50% of older adults reporting frequent episodes. The causes range from ordinary muscle cramps and fatigue to circulatory problems and medication side effects, and figuring out which one applies to you depends on the specific type of pain you’re feeling.
Nocturnal Leg Cramps: The Most Common Cause
The single most frequent reason legs hurt at night is nocturnal leg cramps. These are sudden, involuntary contractions, usually in the calf, that strike when you’re lying in bed. They can last from a few seconds to several minutes and leave the muscle sore afterward. The exact mechanism isn’t fully understood, but current evidence points to muscle fatigue and nerve dysfunction rather than the dehydration or electrolyte imbalances many people assume.
That last point surprises a lot of people. Studies have found that neither exercise-related cramps nor nocturnal cramps are consistently associated with low levels of potassium, sodium, magnesium, or calcium. There’s no strong evidence supporting routine use of potassium or calcium supplements for prevention, and magnesium has shown only mixed results in non-pregnant adults (though it may help during pregnancy). The popular belief that a banana before bed will fix the problem doesn’t hold up well in clinical research.
What does seem to matter is prolonged sitting or standing during the day, awkward leg positions during sleep, and age-related shortening of tendons. If you spend long hours on your feet or had an unusually active day, your calf muscles are more likely to fire involuntarily at night.
Restless Legs Syndrome Is Different
Restless legs syndrome (RLS) gets confused with leg cramps constantly, but the two feel quite different. RLS creates an uncomfortable urge to move your legs, typically as you’re trying to fall asleep. People describe it as a crawling, tingling, or pulling sensation deep in the legs. The key distinction: RLS is usually not painful in the way a cramp is, and the discomfort lasts much longer. Moving your legs temporarily relieves the sensation, while a cramp locks the muscle in place.
RLS is linked to how the brain handles dopamine and is more common in people with iron deficiency. If your legs feel restless and uncomfortable rather than seized up, that’s a different condition with different management.
Circulatory Problems That Worsen at Night
Two vascular conditions can make legs ache specifically when you lie down, and they work in opposite ways.
Venous Insufficiency
Chronic venous insufficiency happens when the valves in your leg veins become damaged and can no longer push blood efficiently back up to the heart. Gravity takes over, blood flows backward (called venous reflux), and fluid pools in your lower legs. This raises pressure inside the veins, causes swelling, and over time can even burst tiny capillaries. You’ll typically notice the aching worsens after long periods of standing and improves when you elevate your legs above heart level. Visible varicose veins, skin discoloration around the ankles, and persistent swelling are telltale signs.
Peripheral Artery Disease
Peripheral artery disease (PAD) involves narrowed arteries that reduce blood flow to the legs. In its earlier stages, PAD causes pain during walking that goes away with rest. But in more severe cases, the reduced blood supply triggers what’s called “rest pain,” a deep ache that occurs while lying down and can wake you from sleep. This happens because lying flat eliminates the small assist gravity gives to blood flowing downward into your legs. PAD rest pain is a sign of significantly reduced circulation and needs medical attention.
Medications That Cause Night Leg Pain
A surprisingly long list of common medications can trigger leg cramps as a side effect. The major categories include:
- Statins (cholesterol-lowering drugs)
- Diuretics (water pills used for blood pressure)
- Certain antidepressants, including fluoxetine and sertraline
- Hormone therapies, including conjugated estrogens
- Some sleep and nerve pain medications, including gabapentin, pregabalin, and zolpidem
Chemotherapy treatments can also cause nerve damage that leads to leg cramps. If your nighttime leg pain started or worsened after beginning a new medication, that connection is worth exploring with whoever prescribed it.
Why Night Makes Everything Worse
Several things about nighttime and sleep conspire to amplify leg discomfort. When you’re lying still, you lose the muscle-pump action that helps push blood and fluid through your legs during the day. Fluid that accumulated in your lower legs while you were upright redistributes, and damaged veins or valves can’t handle the shift. Your body temperature drops slightly during sleep, which may increase susceptibility to cramps. And you’re simply more aware of sensations when everything else is quiet, so aches that your brain filtered out during a busy day become impossible to ignore.
Sleeping with your feet pointed downward (a natural position when lying on your back or stomach) shortens the calf muscles for hours, which may prime them for cramping. Keeping a loose blanket so your feet aren’t pushed into a pointed position can help.
What to Do During an Active Cramp
When a cramp hits, your instinct to stretch is correct. Flex your foot upward, pulling your toes toward your shin to lengthen the cramping calf muscle. If the cramp is in the front of your thigh, bend your knee and pull your foot toward your buttock. Gentle massage and walking around for a minute or two can help the muscle release. A warm towel or heating pad on the cramped muscle afterward can ease the residual soreness.
For prevention, a brief stretching routine before bed, focused on calf stretches held for 30 seconds each, may reduce how often cramps occur. Staying generally active during the day also helps, though overexertion can have the opposite effect.
A Note on Quinine
Quinine, found in tonic water and sometimes prescribed off-label, has a longstanding reputation as a leg cramp remedy. The FDA has explicitly warned against this. Quinine is approved only for treating malaria and carries serious risks when used for leg cramps, including dangerous drops in platelet counts, severe allergic reactions, and heart rhythm problems. Fatalities and kidney failure requiring dialysis have been reported. The FDA has added a boxed warning to quinine products about these risks. Drinking small amounts of tonic water is unlikely to cause harm, but taking quinine tablets for leg cramps is not considered safe.
Signs That Need Prompt Attention
Most nighttime leg aches are harmless, but certain patterns point to something more serious. Swelling, pain, and warmth concentrated in one leg, especially with reddish or purplish skin discoloration, can indicate a deep vein thrombosis (blood clot). This is particularly concerning if the pain started suddenly or if you’ve recently been immobile for long periods, such as after surgery or a long flight. A clot that breaks loose and travels to the lungs causes sudden shortness of breath, chest pain, rapid pulse, or coughing up blood, all of which require emergency care.
PAD rest pain that wakes you regularly, leg wounds that heal very slowly, or progressive swelling that doesn’t improve with elevation are also signals that the aching isn’t just a cramp and that circulation in your legs may need evaluation.

