We include products we think are useful for our readers. If you buy through links on this page, we may earn a small commission. Here’s our process.

Healthline only shows you brands and products that we stand behind.

Our team thoroughly researches and evaluates the recommendations we make on our site. To establish that the product manufacturers addressed safety and efficacy standards, we:
  • Evaluate ingredients and composition: Do they have the potential to cause harm?
  • Fact-check all health claims: Do they align with the current body of scientific evidence?
  • Assess the brand: Does it operate with integrity and adhere to industry best practices?
We do the research so you can find trusted products for your health and wellness.
Was this helpful?

Although muscle spasms are usually short lived and aren’t serious, they can be painful. Stretching can be particularly helpful at relieving a muscle spasm. Other home treatments like massage, using ice and heat, and staying hydrated may help, too.

Muscle spasms or cramps are fairly common and most frequently occur in the leg muscles. But any muscles, including your back, hands, feet, or toes can spasm.

Muscle spasms can last anywhere from a few seconds to 15 minutes. If you experience chronic muscle cramping, you may want to see a doctor.

How muscle spasms feel

A spasm may be a twitch in the muscle or may feel tight or hard, like a knot. After the contraction stops, the muscle can feel sore and tender. Sometimes severe spasms can be incapacitating.

Was this helpful?

Specific home treatments are recommended to relieve a muscle spasm. These work for many people. But controlled studies have shown limited proof of the effectiveness of some of these remedies.

Here are some things to try:

Stretching the area that has the muscle spasm can usually help improve or stop the spasm from occurring. Below are stretches for the muscles in your calves, thighs, back, and neck.

4 stretches for calf muscle spasms

To do the first stretch:

  1. Lie down, stretching your leg by pointing or pulling your toes toward your head. (Pointing the toes toward you is called dorsiflexion.)
  2. Hold for a few seconds or until the spasm stops.
  3. You can also use a strap or belt looped around your foot to gently pull the top of your foot toward you.

This also works for a hamstring muscle spasm.

Other stretches to do:

  • Stand and put your weight on the cramped leg, bending your knee slightly.
  • Stand on your tiptoes for a few seconds.
  • Lunge forward with the leg that isn’t cramped, keeping the cramped leg straight.

Stretch for thigh spasms

  1. Stand and hold on to a chair for balance.
  2. Bend your leg at the knee and reach your leg backward from the hip.
  3. Holding your ankle, pull your foot up behind you toward your buttock.

4 stretches for back spasms

The first and easiest way to stretch a back spasm is to walk around, which can loosen your back muscles and relieve a spasm. Walk at a slow, steady pace to loosen your back muscles.

Tennis ball stretch:

  1. Lie down on the floor or on a bed with a tennis ball (or another small ball) under the area with the spasm for a few minutes.
  2. Try to relax and breathe normally.
  3. Move the ball to an adjoining spot and repeat.

Foam roller stretch:

  1. Lie on the floor with a foam roller perpendicular to your spine.
  2. Move your back over the roller, up to your shoulder blades, and down to your belly button.
  3. Keep your arms crossed on your chest.

Exercise ball stretch:

  1. Sit on an exercise ball and lie back, so that your back, shoulders, and buttocks are stretched out on the ball, with your feet flat on the floor. Do this near a chair or couch so that you can hold on if you lose your balance.
  2. Lie stretched out for a few minutes.

Stretch for neck spasms

  1. While sitting or standing, circle your shoulders by rolling your shoulders forward, up, back, and down. Repeat this motion 10 times.
  2. Then roll your shoulders in the opposite direction by moving your shoulders back, up, forward, and down. Repeat 10 circles in this direction.

You can perform shoulder rolls anywhere, while sitting in a car, at a desk, or if you’re standing in line somewhere waiting.

Shop for stretching accessories

Stretching is great for you, and adding extras like resistance bands and foam rollers may give you faster relief from muscle spasms.

Massage can be a great way to relieve physical pain and muscle cramps.

  1. Gently rub the muscle that’s in spasm.
  2. For a persisting back spasm, try pinching the area around it hard and holding the pinch for a few minutes. You may need someone else to do the pinching if you can’t reach the area.

Treating pain and spasms with hot or cold therapy can be extremely effective.

For a persistent spasm, apply an ice pack on the muscle for 15 to 20 minutes at a time, a few times a day. Make sure to wrap the ice in a thin towel or cloth so that the ice isn’t directly on your skin.

A heating pad on the area may also be effective for 15 to 20 minutes at a time, but follow this with an ice pack. This is because while heat feels good for pain, it may worsen inflammation. Ice will calm down the inflammation.

Other heat options include a warm bath, hot shower, or a hot tub or spa if you have access to one, which can all help relax your muscles.

When you have a spasm, try drinking some water.

To help prevent spasms, make sure that you stay hydrated, especially if you’re exercising or if the weather is hot.

While recommendations for how much water you should drink vary based on things like your individual needs, activities, lifestyle, and weather, here are some amounts to go by.

Adequate amounts of water and equivalent measurements

Women2.7 liters91 ounces11 glasses
During pregnancy3 liters101 ounces12 glasses
During lactation3.8 liters128 ounces16 glasses
Men3.7 liters125 ounces15 1/2 glasses

The Food and Nutrition Board released a report in 2004 that includes general guidelines for total water intake, including the water you get from food and beverages.

The report noted that about 80 percent of the water we need can be taken in from beverages including plain water and 20 percent from foods we eat.

Some people find that they can ward off leg cramps at night (which can occur in up to 60 percent of adults) by doing a little light exercise before they go to sleep.

Some examples of light exercise include:

  • jogging in place
  • walking up and down a set of stairs
  • riding a stationary bike for a few minutes
  • using a row machine for a few minutes
  • bouncing on a trampoline

While light exercise can help, moderate or intense exercise can affect your sleep, so you’ll want to avoid it right before bed.

There are several things you can take by mouth that may help with your muscle spasms:

Over-the-counter pain relieving creams may help. These include products that contain lidocaine, camphor, or menthol (for example, products by Tiger Balm and Biofreeze).

Emollient gel made from curcuma longa (turmeric) and celery seed reportedly helps ease the pain and inflammation of a muscle spasm.

Buy topical pain relieving creams here.

A 2016 review article on spasms reported an observational study with three participants who used hyperventilating at 20 to 30 breaths per minute to resolve cramps that were exercise-related.

Hyperventilation is when you breathe harder and faster than normal. If you have anxiety, hyperventilation may not be a good choice for you, as it can induce feelings of panic.

If you have a persisting muscle spasm, especially if it’s severe, your doctor may prescribe a muscle relaxant or a pain medication.

Muscle relaxants used for muscle spasms are called centrally acting skeletal muscle relaxants (SMRs), and are often only prescribed for 2- to 3-week periods.

If your muscle spasms are frequent, or if the pain is interfering with your day-to-day life, it’s a good idea to see a doctor.

If you make an appointment for muscle spasms, your doctor may:

  • take a medical history
  • ask you about your symptoms
  • ask about your diet and any medications or supplements you’re taking
  • perform a physical exam

They’ll want to rule out any other medical conditions or reasons that might be involved in your muscle spasms.

They may order imaging tests to check for possible conditions, such as a fracture, or order blood tests to look for markers for other conditions.

Your doctor may refer you for physical therapy to help you strengthen a particular set of muscles, or to get flexibility and stretching exercises.

If your spasms are prolonged and painful, they may prescribe prescription-strength solutions.

Other possibilities

If your spasms are in your back, consider seeing a chiropractor. They may give you some targeted therapies and exercises to relieve your muscle spasms.

A professional massage therapist may also help.

The exact mechanism that causes muscle spasms isn’t certain. Common triggers include:

  • muscle fatigue from exercise
  • dehydration or electrolyte depletion
  • low levels of calcium, magnesium, potassium, and sodium
  • some medications, such as statins
  • some medical conditions, such as diabetes, Parkinson’s disease, cardiovascular disease, and cirrhosis
  • pregnancy
  • nerve damage
  • prior injury

Most often, muscle spasms are labeled idiopathic — meaning they have no identified cause.

The evidence is mixed about the effectiveness of remedies for preventing muscle spasms.

If you’re generally healthy and have occasional muscle spasms, experts recommend:

  • staying hydrated
  • doing light stretching before and after you exercise
  • eating a healthy diet

Using kinesio tape or compression stockings may help prevent muscle spasms in your legs, according to a small study on runners.

You may want to keep a record of when you get a muscle spasm, to see if it’s related to a particular activity. Changing that activity may help prevent future spasms.

For example:

  • Do you get a back spasm after you’ve been reading in bed?
  • Do your legs cramp if you’ve been sitting or standing in one place for a long time?
  • Do wearing tight shoes or high heels lead to toe cramps?
  • What position have you been sleeping in?

Answering these questions can help you figure out what might be triggering your muscle spasms.

Muscle spasms are usually short lived and benign. Self-treatment, particularly stretching, works for most people.

If you have spasms frequently, or if they’re very painful, see a doctor to figure out what’s triggering the spasms.