Muscle Cramps

Condition Basics

What are muscle cramps?

A muscle cramp is a strong, painful contraction or tightening of a muscle that comes on suddenly and lasts from a few seconds to several minutes. It often occurs in the legs. A muscle cramp is also called a charley horse.

Nighttime leg cramps are usually sudden spasms, or tightening, of muscles in the calf. The muscle cramps can sometimes happen in the thigh or the foot. They often occur just as you are falling asleep or waking up.

What causes them?

The cause of muscle cramps isn't always known. Muscle cramps may be brought on by many conditions or activities, such as:

  • Exercising, injury, or overuse of muscles.
  • Pregnancy. Cramps may occur because of decreased amounts of minerals, such as calcium and magnesium, especially in the later months of pregnancy.
  • Exposure to cold temperatures, especially to cold water.
  • Other medical conditions, such as blood flow problems (peripheral arterial disease), kidney disease, thyroid disease, and multiple sclerosis.
  • Standing on a hard surface for a long time, sitting for a long time, or putting your legs in awkward positions while you sleep.
  • Not having enough potassium, calcium, and other minerals in your blood.
  • Being dehydrated, which means that your body has lost too much fluid.
  • Taking certain medicines, such as antipsychotics, birth control pills, diuretics, and steroids.

How are muscle cramps treated?

If cramps keep coming back, bother you a lot, or interfere with your sleep, your doctor may prescribe medicine that relaxes your muscles.

Talk with your doctor if you have muscle cramps that keep coming back or are severe. These may be symptoms of another problem, such as restless legs syndrome.

How can you care for yourself?

You may need to try several different ways to stop a muscle cramp before you find what works best for you. Here are some things you can try:

  • Stretch and massage the muscle.
  • Take a warm shower or bath to relax the muscle. A heating pad placed on the muscle can also help.
  • Try using an ice or cold pack. Always keep a cloth between your skin and the ice pack.
  • Take an over-the-counter pain medicine, such as acetaminophen (Tylenol), ibuprofen (Advil, Motrin), or naproxen (Aleve). Be safe with medicines. Read and follow all instructions on the label.
  • If your doctor prescribes medicines for muscle cramps, take them exactly as prescribed. Call your doctor if you have any problems with your medicine.
  • Drink plenty of fluids. You can also drink an electrolyte replacement drink or sports drink, such as Gatorade, after exercise.
  • Walk around, or jiggle your leg.
  • Stretch your calf muscles. You can do this stretch while you sit or stand:
    • While sitting, straighten your leg and flex your foot up toward your knee. It may help to place a rolled towel under the ball of your foot and, while holding the towel at both ends, gently pull the towel toward you while keeping your knee straight.
    • While standing about 2 ft (0.6 m) from a wall, lean forward against the wall. Keep the knee of the affected leg straight and the heel on the ground. Do this while you bend the knee of the other leg.

If you think a medicine is causing muscle cramps:

  • Before you take another dose, call the doctor who prescribed the medicine. The medicine may need to be stopped or changed, or the dose may need to be adjusted.
  • If you are taking any medicine not prescribed by a doctor, stop taking it. Talk to your doctor if you think you need to continue taking the medicine.

How can you prevent them?

These tips may help prevent muscle cramps:

  • Drink plenty of water and other fluids.
  • Limit or avoid drinks with alcohol.
  • Make sure you are eating healthy foods (especially if you are pregnant) that are rich in calcium, potassium, and magnesium.
  • Ride a bike or stationary bike to condition and stretch your muscles.
  • Stretch your muscles every day, especially before and after exercise and at bedtime.
  • Don't suddenly increase the amount of exercise you get. Increase your exercise a little each week.

If you are taking medicines that are known to cause leg cramps, your doctor may prescribe different medicines.

Related Information

Credits

Current as of: November 9, 2022

Author: Healthwise Staff
Medical Review:
Anne C. Poinier MD - Internal Medicine
Kathleen Romito MD - Family Medicine
Martin J. Gabica MD - Family Medicine
Karin M. Lindholm DO - Neurology