How to Treat and Prevent Leg Cramps

Get Relief From Painful Muscle Spasms

A leg cramp is a sudden, uncontrolled contraction of a muscle. This can occur elsewhere in the body, but is most commonly experienced in the lower extremities. Leg cramps or spasms are unpredictable in that they may vary in terms of intensity and duration, and come on suddenly, but they do have predictable causes that can lead prevention efforts.

Muscles that cross two joints seem to be the most common to cramp up. These include the calf (crossing the ankle and knee), the hamstring (crossing the knee and hip), and the quadriceps (also crossing the knee and hip).

A leg cramp may also be referred to as a "charley horse."

Tips for treating leg cramps
Verywell / JR Bee

Symptoms

Leg cramps usually last less than a minute but may endure for several before the contractions finally subside. Typical symptoms include:

  • Sudden, sharp pain, most often in the back of the leg
  • Uncontrollable contraction of the muscle
  • A quivering sensation in the muscle
  • Ongoing aching and fatigue following muscle relaxation

In some people, the spasms occur primarily at night and can awaken the patient from sleep. More severe leg cramps can cause pain that lasts several days after the cramp occurs.

When to See a Healthcare Provider

While leg cramps tend to resolve on their own without treatment, see your healthcare provider if they are severe, recurrent, have no known cause, or are accompanied by swelling, changes in skin color, or muscle weakness.

Causes

The exact cause of leg cramps is not well understood, but there are some risk factors that are thought to contribute:

  • Age: Leg cramps are more common in young (adolescent age) and older (over 65) patients.
  • Muscle fatigue: Overexertion due to heavy exercising or being active in an unusual way may be to blame.
  • Dehydration: This includes electrolyte imbalances (potassium, magnesium, sodium, and calcium in particular.)
  • Being overweight
  • Early pregnancy: This could be linked to calcium changes or muscle fatigue from carrying extra weight.
  • Medical conditions: People with thyroid or nerve conditions are known to experience leg cramping.
  • Medication use: Some medications can cause muscle spasms as a side effect, including statin drugs and corticosteroids like prednisone.

Treatment

Usually, instinct takes over when a leg cramp strikes and you massage and stretch the sore muscle. This often solves the problem.

You may also find relief by:

  • Cooling the skin with cold, moist cloth
  • Drinking more fluids

A healthcare provider may also prescribe muscle-relaxing drugs if cramping is severe. One drug, Robax, combines methocarbamol (a muscle relaxant) with ibuprofen (nonsteroidal anti-inflammatory drug, NSAID). Patients generally take it every four to six hours for no longer than five days.

Robax should not be taken with alcohol or other NSAIDs, and it may cause suicidal thoughts if overused. Call your healthcare provider immediately if you have trouble urinating or experience vomiting, rash, slowed heart rate, or jaundice when on this drug.

The vast majority of people who sustain a leg cramp from athletic participation require no specific tests to direct treatment. And for the vast majority of athletes, medications should not be used to treat isolated episodes of muscle cramps.

One warning sign of dangerous muscle damage is dark urine, particularly in the hours that follow an episode of severe cramping or muscle injury. This is a symptom of rhabdomyolysis, a rare condition where injured muscle tissue dies and enters the bloodstream, eventually damaging the kidneys.

Anyone who experiences severe muscle cramping followed by a darkening of the urine should immediately seek medical attention.

Prevention

While you can't always prevent leg cramps, there are things you can do to significantly reduce their risk:

  • Stay hydrated: Dehydration is known to predispose you to leg cramps, although the exact reason why is not known. Drink at least three full glasses of water each day, including one before bedtime. Also drink plenty of fluid before, during, and after exercise.
  • Pick foods wisely: Electrolyte drinks may help keep your levels steady, but eating potassium- or magnesium-rich foods may also help. These include bananas, sweet potatoes, beans/legumes, and avocados.
  • Stretch: Stretching can relax muscle fibers. When working out, a good post-workout stretching routine may help prevent cramps. Make sure you cool down after exercising and do not exercise vigorously just prior to sleep.
  • Train gradually: Avoid sudden increases in activity. The "10% rule" is a good one: Never increase your weekly exercise load by more than 10% compared to the week before. Most athletes who have leg cramps, such as long-distance runners, tend to do so because they increased the intensity or duration of their training too quickly.

A Word From Verywell

Most leg cramps are spontaneous, painful events that quickly resolve. They can be frustrating, particularly if they occur at night and disrupt sleep. If your leg cramps seem more frequent or more severe than is typical, see your healthcare provider.

4 Sources
Verywell Health 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. Behringer M, Moser M, Mccourt M, Montag J, Mester J. A promising approach to effectively reduce cramp susceptibility in human muscles: a randomized, controlled clinical trial. PLoS ONE. 2014;9(4):e94910. doi:10.1371/journal.pone.0094910

  2. Young G. Leg crampsBMJ Clin Evid. 2009;2009:1113.

  3. Young G. Leg cramps. BMJ Clin Evid. 2009;2009:1113.

  4. Torres PA, Helmstetter JA, Kaye AM, Kaye AD. Rhabdomyolysis: pathogenesis, diagnosis, and treatment. Ochsner J. 2015;15(1):58-69.

Additional Reading
  • Bordoni B, Sugumar K, Varacallo M. Muscle Cramps. [Updated 2019 Jun 22]. In: StatPearls [Internet]. Treasure Island (FL): StatPearls Publishing; 2019 Jan-.

  • National Institutes of Health. Medline Plus. Rhabdomyolysis.

  • Young G. Leg cramps. BMJ Clin Evid. 2015 May 13;2015. pii: 1113. 

By Jonathan Cluett, MD
Jonathan Cluett, MD, is board-certified in orthopedic surgery. He served as assistant team physician to Chivas USA (Major League Soccer) and the United States men's and women's national soccer teams.