13 Causes of Leg Cramps—and How To Treat Them

In This Article
View All
In This Article
Young woman hiking with numb tingling leg
Khmelevskyi A.V./Getty Images

Possible causes of leg cramps (charley horses) are too much or too little exercise, dehydration, low electrolyte levels, and certain conditions. Treatments include rehydrating, stretching, and massage.

A leg cramp is a sharp, sudden contraction or tightening of the muscle in the calf, which usually lasts a few seconds to a few minutes. It can feel debilitating whether you are lying in bed at night or running. Leg cramps can become even more irritating if they persist and knock you off your typical exercise or sleep routine.

1. Dehydration

One of the classic causes of leg cramps is dehydration. You may be more likely to develop leg cramps if you exercise outside during the summer months and do not drink enough water. You lose more fluid through sweat.

The reason dehydration causes cramping is largely theoretical. It may be that fluid depletion causes nerve endings to become sensitized. This "triggers contractions in the space around the nerve and increases pressure on motor nerve endings," Todd Sontag, DO, a family physician with Orlando Health Physician Associates, told Health.

2. Mineral Deficiency

It's not just water that you sweat out. Electrolytes are the essential minerals that affect muscle function and many other bodily functions. Lost electrolytes can also contribute to leg cramping. An imbalance can trigger cramping if you are low in certain minerals.

An imbalance in sodium, calcium, magnesium, or potassium may cause leg cramps. Sports drinks with these electrolytes can reduce symptoms.

Potassium-rich foods can also treat or prevent leg cramps. Examples include:

  • Bananas
  • Nuts
  • Spinach
  • Sweet potatoes
  • Yogurt

3. Pregnancy

Pregnancy increases the risk for leg cramps. "The odds of magnesium and potassium deficiency are higher during pregnancy," Mark Peterson, PhD, an assistant professor in physical medicine and rehabilitation at the University of Michigan Medical School, told Health.

Stay hydrated if you are pregnant and develop leg cramps. You may also talk to a healthcare provider about taking a magnesium supplement.

4. Overuse

Many people develop leg cramps due to overusing a muscle. Straining a muscle is actually the most common cause of muscle cramping.

You often wind up with an involuntary cramp when the nerves running from your brain and spinal cord down to the muscle get overexcited. Rest and stretching are important in these situations.

5. Exercise Intensity

Strenuous exercise is a key cause of leg cramps. Your muscles are not automatically used to new intensity and movement.

"Whenever cramps are induced by starting or restarting an exercise, that's usually an indication of 'too much, too soon,'" Gerardo Miranda-Comas, MD, an associate professor of rehabilitation and human performance at the Icahn School of Medicine at Mount Sinai, told Health. "Your muscles don't act and respond the same when you jog and sprint, for instance, so any increase in workout volume or intensity can trigger cramps."

6. Fatigue

You may be more prone to leg cramps when you are overtired. You might be more lax in your diet or forget to hydrate effectively. Your muscles might also already be in rough shape if your body has not had enough time to recover from a workout.

"Physiologically, when the muscle is fatigued, it's not as synchronized in using nutrients," said Dr. Miranda-Comas. A tired muscle loses more nutrients than it uses, so it's not functioning at its peak.

Nighttime (nocturnal) leg cramps are also common if you are overtired. There's no clear cause of nighttime leg cramps. Muscle fatigue and nerve dysfunction are the likely culprits. Research has shown that about 30% of adults reported nocturnal leg cramps at least five times a month.

7. Sitting or Standing

Muscles were made to move, contract, and rest. You might have some leg cramps if you are sitting or standing for long periods.

Standing for a prolonged time can contribute to muscle fatigue, which can cause leg cramps. Too much sitting is not necessarily better. Prolonged sitting "may predispose the muscles to malfunction," said Dr. Sontag.

You may get a cramp when the muscle is being used and cannot relax. Make sure to take a seat before your muscles feel too tired from standing. Try spending at least a couple of minutes walking around per hour you sit.

8. Medications

You might want to take a look at any medications you take if there's no obvious cause of your leg cramps. Diuretics, which lower blood pressure, may trigger cramps. They deplete your body of fluids and salts.

Talk to a healthcare provider if you started taking a new medication at the onset of your leg cramps. They may be able to prescribe an alternative.

9. Peripheral Artery Disease (PAD)

It's important to see a healthcare provider to rule out underlying concerns if your leg cramps are not spontaneous or exercise-related. Conditions that affect how the body moves electrolytes can cause leg cramps.

Others, like peripheral artery disease (PAD), can affect blood flow. PAD is when cholesterol clogs blood vessels in your legs. It can trigger cramps since there may not be enough blood getting to your legs.

10. Multiple Sclerosis (MS)

Leg cramps can also be a symptom of the nerve disorder multiple sclerosis (MS). Some people with MS have spasticity, which can include involuntary muscle spasms and twitches or leg cramps. Spasticity might feel like a mild tightness or tingling or more severe cramping and pain.

Spasticity can cause frozen or immobilized joints if it's untreated. Talk with a healthcare provider if you notice MS symptoms.

11. Osteoarthritis

Overexcited nerves can cause overuse-related leg cramps. Nerves malfunctioning for other reasons can also cause symptoms.

Osteoarthritis, or the most common type of arthritis, is usually categorized by stiff and achy joints. People with osteoarthritis may also have muscle spasms and leg pain. Leg cramps are usually linked to osteoarthritis of the spine. This condition can lead to pinched nerves or other nerve damage in severe cases.

12. Diabetic Peripheral Neuropathy

Too-high blood sugar levels in people with type 2 diabetes can lead to nerve damage in the legs, feet, arms, and hands. This condition is called diabetic peripheral neuropathy.

Nerve damage often leads to feelings of numbness or tingling. It can also produce muscle twitching and leg cramps when the nerves in the legs do not function properly.

Diabetes treatment can help prevent further nerve damage. A healthcare provider might recommend pain medication or anticonvulsant drugs to reduce leg cramps.

13. Hypothyroidism

Thyroid disorders may also contribute to leg cramps. Your thyroid is a gland that controls how your body uses energy.

People with hypothyroidism produce too little thyroid hormone. Some people with hypothyroidism will feel weakness or pain in their muscles. Others might experience leg cramps.

How To Treat Leg Cramps

You can ease leg cramps in the moment by stretching the muscle gently. Make sure you nourish your body and get enough rest to prevent symptoms.

Always check with a healthcare provider if you have unresolved leg cramps, especially with hydration and stretching. You might need to take a closer look at potential causes to find a long-term solution for leg cramps.

Rule out any underlying conditions that could cause leg cramps, such as PAD or thyroid disorders. See a healthcare provider when cramps prevent you from exercising or if they happen without cause.

A Quick Review

Leg cramps have several causes, from dehydration to overexercise. Pregnancy, older age, and certain conditions and medications can also make leg cramps more likely. Treatments like hydrating and stretching can also prevent leg cramps.

Contact a healthcare provider if you have frequent leg cramps. They can help you figure out the cause and recommend treatments. This is particularly important if you have a condition that could be causing leg cramps.

Was this page helpful?
14 Sources
Health.com uses only high-quality sources, including peer-reviewed studies, to support the facts within our articles. Read our editorial process to learn more about how we fact-check and keep our content accurate, reliable, and trustworthy.
  1. MedlinePlus. Charley horse.

  2. MedlinePlus. Muscle cramps.

  3. U.S. Department of Agriculture: Dietary Guidelines for Americans. Food sources of potassium.

  4. Bordoni B, Sugumar K, Varacallo MA. Muscle cramps. In: StatPearls. StatPearls Publishing; 2023.

  5. Grandner MA, Winkelman JW. Nocturnal leg cramps: Prevalence and associations with demographics, sleep disturbance symptoms, medical conditions, and cardiometabolic risk factorsPLoS One. 2017;12(6):e0178465. doi:10.1371/journal.pone.0178465

  6. Sawada Y, Kawaratani H, Kubo T, et al. Effect of furosemide on muscle cramps in patients with liver cirrhosisJ Gastroenterol Hepatol. 2020;35(1):76-81. doi:10.1111/jgh.14820

  7. American Heart Association. Symptoms of PAD.

  8. National Multiple Sclerosis Society. Spasticity.

  9. American Association of Neurological Surgeons. Osteoarthritis.

  10. Centers for Disease Control and Prevention. Osteoarthritis.

  11. National Institute of Diabetes and Digestive and Kidney Diseases. Diabetic neuropathy.

  12. Katzberg H, Kokokyi S, Halpern E, et al. Prevalence of muscle cramps in patients with diabetes. Diabetes Care. 2014;37(1):e17-e18. doi:10.2337/dc13-1163

  13.  National Institute of Diabetes and Digestive and Kidney Diseases. Hypothyroidism (underactive thyroid).

  14. MedlinePlus. Hypothyroid myopathy.

Shop Products We Recommend
If you click on the links provided in the table, Health may receive compensation.

Related Articles