Muscle Cramps

ByMark Freedman, MD, MSc, University of Ottawa
Reviewed/Revised Oct 2023
VIEW PROFESSIONAL VERSION
GET THE QUICK FACTS

A cramp is a sudden, brief, unintended (involuntary), and usually painful contraction of a muscle or group of muscles. Muscle cramps can be a symptom of nervous system malfunction.

Causes of Muscle Cramps

The most common causes of muscle cramps are

  • Benign leg cramps that occur for no known reason, typically at night

  • Exercise-associated muscle cramping (cramping during or immediately after exercise)

Muscle cramps (also called charley horses) often occur in healthy people, usually in middle-aged and older adults but sometimes in younger people. Cramps tend to occur during or after vigorous exercise but sometimes occur during rest. Some people have painful leg cramps during sleep. Sleep-related leg cramps usually affect the calf and foot muscles, causing the foot and toes to curl downward. Although painful, these cramps are usually not serious and are thus called benign leg cramps.

Almost everyone has muscle cramps at some time, but certain conditions increase the risk and/or severity of cramps. They include the following:

  • Having tight calf muscles, which may be caused by not stretching, inactivity, or sometimes repeated accumulation of fluid (called edema) in the lower leg

  • Becoming dehydrated

  • Having low levels of electrolytes (such as potassium, magnesium, or calcium) in the blood

  • Having a nerve disorder or an underactive thyroid gland (hypothyroidism)

  • Taking certain medications

Low electrolyte levels may result from use of some diuretics, an alcohol use disorder certain hormonal (endocrine) disorders, , or conditions that cause loss of fluids (and thus electrolytes). Electrolyte levels may become low late in pregnancy.

Cramps can occur shortly after dialysis, possibly because dialysis removes too much fluid from the body, removes the fluid too quickly, and/or lowers electrolyte levels.

Table
Table

Disorders that cause similar symptoms

Some disorders cause symptoms that resemble muscle cramps.

Dystonias are involuntary muscle contractions, but they usually last longer and occur more often than cramps. Also, they tend to affect other muscles and may affect many other muscles, including any limb muscles as well as those of the back, neck, and voice. In contrast, benign leg cramps and exercise-associated muscle cramping tend to affect the calf muscles.

Tetany is continuous or periodic spasms of muscles throughout the body. These spasms usually last much longer than muscle cramps and are more widespread. The muscles may also twitch.

Illusory muscle cramps occur in some people. These people feel as if they are having cramps but no muscle contraction occurs.

Peripheral arterial disease (commonly called hardening of the arteries) in the legs may cause calf pain (claudication) during physical activity such as walking. This pain is due to inadequate blood flow to muscles, not to muscle contraction as occurs with cramps.

Evaluation of Muscle Cramps

The following information can help people decide whether a doctor's evaluation is needed and help them know what to expect during the evaluation.

Warning signs

In people with muscle cramps, the following symptoms and characteristics are of particular concern:

  • Cramps in the arms or trunk

  • Muscle twitching

  • Signs of alcohol use disorder, such as a history of consuming large amounts of alcohol, spider veins, and red palms

  • Weakness

  • Cramps that occur after loss of body fluids (dehydration) or use of diuretics

  • Pain or loss of sensation unless they occur at the same time as the cramping

If people have cramps in the arms or trunk or muscle twitching, the cause is more likely to be a disorder (such as an electrolyte or hormonal disorder) or a medication or drug than benign leg cramps or exercise-related muscle cramps.

When to see a doctor

People with muscle cramps should consult a doctor as soon as possible if they also have alcohol use disorder, sudden weakness or loss of sensation, or severe symptoms or if they have lost body fluids (for example, through vomiting, diarrhea, or excessive sweating). Otherwise, people should call their doctor to discuss how soon the doctor needs to see them.

What the doctor does

Doctors first ask questions about the person's symptoms and medical history and then does a physical examination. What doctors find during the history and physical examination often suggests a cause and the tests that may need to be done.

Doctors ask the person to describe the cramps, including the following:

  • When they occur

  • How long they last

  • How frequent they are

  • Where they are

  • Whether any event seems to trigger them

  • Whether any other symptoms are present

Doctors ask about symptoms that suggest clues to the cause:

  • Lack of menstrual periods or menstrual irregularities—symptoms that suggest pregnancy-related leg cramps

  • Vomiting, diarrhea, use of diuretics, excessive exercise, and sweating—symptoms that suggest loss of body fluids or electrolytes

  • Difficulty tolerating cold, weight gain, and coarse, thick skin—symptoms that may indicate hypothyroidism

  • Weakness, pain, or loss of sensation—symptoms that suggest a nerve disorder

The person is also asked about use of medications and alcohol, recent dialysis treatment, and any association between past dialysis treatments and muscle cramps.

The physical examination focuses first on the nervous system (neurologic examination), including assessment of muscles and reflexes.

Doctors also inspect the skin for signs of the following:

  • Alcohol use disorder (such as spider veins, red palms, and, in men, changes in the pattern of genital hair)

  • Hypothyroidism (such as a puffy face and loss of eyebrow hair)

  • Dehydration (such as less elastic skin)

Testing

No tests are routinely done. Instead, testing is done based on the history and results of the physical examination.

If cramping is widespread, particularly if reflexes are overactive, doctors measure levels of blood sugar and electrolytes (including calcium and magnesium) and do blood tests to check for kidney malfunction (which can cause levels of calcium and magnesium to be abnormal).

If the cramped muscles are also weak, electromyography may be done. For this test, a small needle is inserted into a muscle to record the electrical activity of the muscle when the muscle is at rest and when it is contracting.

If muscle weakness is widespread and doctors think that it is related to a problem with the nervous system, magnetic resonance imaging (MRI) of the brain and spinal cord is done.

Prevention of Muscle Cramps

Preventing cramps is the best approach. The following measures can help:

  • Not exercising immediately after eating

  • Gently stretching the muscles before exercising or going to bed

  • Drinking plenty of fluids (particularly sports beverages that contain potassium) after exercise

  • Not smoking

  • nicotine

Stretching makes muscles and tendons more flexible and less likely to contract involuntarily. The runner's (gastrocnemius) stretch is the best stretch for preventing calf cramps. A person stands with one leg forward and bent at the knee and the other leg behind with the knee straight—a lunge position. The hands can be placed on the wall for balance. Both heels remain on the floor. The knee of the front leg is bent further until a stretch is felt along the back of the other leg. The greater the distance between the two feet and the more the front knee is bent, the greater the stretch. The stretch is held for 30 seconds and repeated 4 or 5 times. Then the set of stretches is repeated on the other side.

Did You Know...

  • Stretching helps prevent cramps because it makes muscles less likely to contract involuntarily (without the person's intending it).

Treatment of Muscle Cramps

If a disorder that can cause muscle cramps is identified, it is treated.

If a cramp occurs, stretching the affected muscle often relieves the cramp. For example, for a calf cramp, the person could use a hand to pull the foot and toes upward or could do the runner's stretch. Massage may temporarily relieve some types of cramps.

Key Points

  • Leg cramps are common.

  • The most common causes are benign leg cramps and exercise-associated cramping.

  • Medications are not usually recommended to prevent muscle cramps.

Drugs Mentioned In This Article
quizzes_lightbulb_red
Test your KnowledgeTake a Quiz!
Download the free Merck Manual App iOS ANDROID
Download the free Merck Manual App iOS ANDROID
Download the free Merck Manual App iOS ANDROID