Leg cramps are sudden, involuntary muscle contractions that most often strike the calf, foot, or thigh. They result from a glitch in how your nervous system controls muscle contraction and relaxation, and a wide range of triggers can set that glitch off, from simple muscle fatigue to chronic disease. Up to 33% of adults over 50 experience them regularly at night, but they can happen to anyone at any age.
How a Cramp Actually Happens
Your muscles rely on a balancing act between two signals: one that tells muscle fibers to contract and one that tells them to relax. The contraction signal comes from sensors inside the muscle itself (muscle spindles), while the relaxation signal comes from sensors in the tendon (called Golgi tendon organs). When something disrupts that balance, pushing the “contract” signal too high or the “relax” signal too low, the muscle locks into a sustained, painful contraction.
This is why stretching works as an immediate remedy. Pulling the muscle lengthens the tendon, which activates those tendon sensors and sends a strong “relax” signal back to the nerve controlling the muscle. It’s essentially resetting the system.
Muscle Fatigue and Overuse
The strongest evidence points to muscle fatigue as the single most common trigger. When a muscle is worked to the point of exhaustion, the excitatory signals from muscle spindles ramp up while the inhibitory signals from tendon organs drop off. The result is a localized cramp in the overworked muscle. This explains why cramps tend to hit near the end of a long run, during the final set of heavy exercise, or after hours of standing or walking, rather than at the beginning of activity.
You don’t need to be an athlete for this to apply. Spending an unusually long day on your feet, doing yard work you’re not conditioned for, or even holding an awkward position for too long can fatigue a muscle enough to cramp.
Nighttime Cramps and Aging
Nocturnal leg cramps are the most common type, typically hitting the calf or the sole of the foot. They last anywhere from a few seconds to about 10 minutes, and soreness in the muscle can linger after the cramp releases. Sleep disruption and distress are hallmarks of the condition, especially in older adults who experience them repeatedly.
Aging itself is a major risk factor. As people become less physically active, their muscles gradually shorten over time. Shortened muscles are more prone to involuntary contraction, particularly when the foot naturally points downward during sleep (a position that already shortens the calf). This shortened resting length is thought to be one reason cramps become so much more frequent after age 50. Varicose veins, which are also more common with age, have been linked to nighttime cramps as well.
Dehydration and Mineral Deficiencies
Dehydration is a commonly cited cause of cramps, and there is an association, though the mechanism is less clear-cut than the fatigue theory. When you’re dehydrated, the fluid balance around your muscle and nerve cells shifts, which can make nerves more excitable and more likely to fire inappropriately.
Deficiencies in magnesium and calcium have also been linked to increased cramp frequency. Both minerals play direct roles in muscle contraction and nerve signaling. Low levels can lower the threshold at which a nerve fires, making spontaneous contraction more likely. That said, supplementing magnesium in people who aren’t actually deficient doesn’t appear to help. A meta-analysis found magnesium supplementation is not effective for reducing cramps in the general population. The benefit is limited to people with a genuine deficiency.
Medications That Trigger Cramps
Several common drug classes are known to cause leg cramps as a side effect:
- Cholesterol-lowering statins are among the most frequent culprits. Muscle cramping, soreness, fatigue, and weakness are the most commonly reported side effects, and they’re dose-dependent, meaning higher doses carry more risk. This applies to all widely used statins. The risk increases further when statins are combined with other cholesterol drugs called fibrates, or with certain antifungal medications and calcium channel blockers.
- Diuretics (water pills) used for blood pressure or heart failure can deplete potassium, magnesium, and sodium, all of which affect how muscles and nerves function.
- Beta-blockers, another class of blood pressure medication, can reduce blood flow to the extremities and contribute to cramping during activity.
If you started a new medication and noticed an increase in cramps, the timing is worth mentioning to whoever prescribed it. Dose adjustments or switching to a different drug in the same class can sometimes resolve the problem.
Poor Circulation and Peripheral Artery Disease
When arteries supplying the legs become narrowed by plaque buildup, muscles don’t get enough blood flow during activity. This condition, peripheral artery disease, causes cramping or aching in the calves, thighs, or hips that comes on with walking and goes away with rest. It’s sometimes called intermittent claudication.
Diabetes significantly accelerates this process. Chronically high blood sugar damages the inner lining of blood vessels, triggers inflammation, reduces the production of a key molecule that keeps arteries relaxed and open, and promotes the growth of plaques that progressively block blood flow. Over time, the growing obstruction starves leg muscles of oxygen, which leads to cramping during even moderate exertion. People with diabetes are also prone to nerve damage in the legs, which can independently cause cramping by disrupting the normal signals between nerves and muscles.
Chronic kidney failure is another condition strongly associated with leg cramps, particularly during dialysis, when rapid fluid and electrolyte shifts affect muscle function.
Spinal and Nerve Problems
Spinal stenosis, a narrowing of the spinal canal in the lower back, can compress the nerves that control your leg muscles. This causes pain or cramping in one or both legs that typically worsens with standing or walking and improves when you sit down or lean forward. The forward-leaning position opens up space in the spinal canal, relieving pressure on the nerves.
Other forms of nerve compression, such as a herniated disc pressing on a nerve root, can produce similar cramping in whichever muscle that nerve supplies. The key distinction from ordinary cramps is that nerve-related cramping tends to follow a pattern tied to body position and often comes with other symptoms like numbness, tingling, or weakness in the same leg.
Pregnancy
Leg cramps are common in the second and third trimesters of pregnancy. Several factors converge to make them more likely. The growing uterus increases pressure inside the abdomen, which slows the return of blood from the legs. Progesterone, which rises dramatically during pregnancy, relaxes the walls of veins, further reducing blood flow efficiency. And the growing fetus draws heavily on the mother’s calcium and magnesium stores.
The reduced blood return allows lactic acid and other metabolic byproducts to accumulate in leg muscles, which triggers involuntary contraction. Cramps during pregnancy most often strike at night and are concentrated in the calves.
What Actually Helps
For an acute cramp, stretching the affected muscle is the most reliable immediate treatment. It works by activating the tendon sensors that send a relaxation signal to the cramping muscle. Pulling your toes toward your shin during a calf cramp, for example, directly targets this mechanism.
For people with recurring cramps, a clinical trial found that a regular nightly stretching routine reduced cramp frequency by about 1.2 cramps per night and reduced severity by about 1.3 points on a 10-point pain scale compared to doing nothing. Interestingly, the same trial found that meditation produced a similar reduction in severity, suggesting that nervous system relaxation in general may play a role.
Despite its popularity, magnesium supplementation has not held up in clinical testing for people without a true deficiency. Quinine, an older remedy, does reduce cramp frequency by roughly 2 to 3 cramps over a two-week period, but it carries serious side effects including heart rhythm problems, so it’s rarely recommended today. Taurine, an amino acid, showed promise in a small trial, reducing cramps by about 7 over two weeks with a noticeable drop in pain intensity, though the evidence is still limited.
For cramps tied to an identifiable cause, like a medication side effect, poor circulation, or spinal compression, addressing the underlying issue is the most effective long-term strategy. Staying hydrated, maintaining regular physical activity to prevent muscle shortening, and correcting any mineral deficiencies through diet are the practical foundations that apply to nearly everyone.

