SymptomBones, joints & muscles

Muscle Spasms: What Causes Them and When to Worry

Muscle spasms are sudden, involuntary contractions of a muscle or part of a muscle. They range from a harmless flicker under the skin to a painful cramp that locks a calf or a thumb in place. Most are caused by overuse, dehydration, holding one position too long or low levels of minerals such as potassium, calcium or magnesium. Spasms that are frequent, spreading, or come with weakness, numbness or muscle wasting should be checked by a doctor.

Also called: Muscle cramps, muscle twitching, involuntary muscle contractions, charley horse

At a glance

What it is
An involuntary contraction of a muscle, from a small twitch to a painful, locked cramp.
Common causes
Overuse, fatigue, dehydration, heat, repetitive hand use, pregnancy and some medicines.
Less common causes
Low potassium, calcium or magnesium, pinched nerves, carpal tunnel syndrome, thyroid or kidney disease, and nerve diseases.
Typical duration
Seconds to a few minutes. Soreness can last a day.
Treatment
Stretching, massage, heat, fluids and treating the cause.

When to get help

Call 911 or go to the ER

  • Spasms with sudden weakness, numbness or drooping on one side of the face or body, or trouble speaking
  • Painful spasms of the jaw ("lockjaw") and neck after a wound, especially if not vaccinated against tetanus
  • Severe muscle pain and weakness with dark brown or cola-colored urine, especially after extreme exercise, heat or a crush injury

See a doctor within a day or two

  • Spasms of the hands and feet with tingling around the mouth, especially after thyroid or neck surgery, which suggests low calcium
  • Spasms with severe vomiting, diarrhea or confusion
  • Back spasms with numbness between the legs, leg weakness or new bladder or bowel problems

Book a routine appointment

  • Frequent spasms or cramps that disturb sleep or daily activities
  • Twitching that spreads, or comes with muscle weakness, thinning or trouble gripping
  • Hand or finger spasms with numbness or tingling in the thumb and first fingers
  • Spasms that started after a new medicine

Usually safe to manage at home

  • An occasional calf cramp at night or after exercise that eases with stretching
  • A twitching eyelid or a small flicker in a muscle that comes and goes, with no weakness

What muscle spasms feel like

The word covers several different experiences:

TypeWhat happensExample
CrampSudden, painful, hard tightening of a whole muscle for seconds to minutesCalf cramp at night, foot cramp while swimming
Twitch (fasciculation)Small, painless flicker under the skinEyelid or thumb twitching
TetanySustained spasm of hands and feet, often with tinglingFingers bending inward from low calcium
DystoniaProlonged contraction causing twisting or abnormal posturesWriter's cramp, a twisted neck
Protective spasmA muscle tightens around an injured areaBack spasm after a strain

The condition-focused page on muscle spasm covers neck and back spasms and their treatment in more detail.

Common causes of muscle spasms

  • Muscle fatigue and overuse: the most common cause. Spasms happen during or after exercise, or after unaccustomed work such as gardening.
  • Dehydration and heavy sweating: loss of fluid and salt in heat or long exertion. See dehydration.
  • Holding one position: sitting with legs bent, sleeping with toes pointed, or gripping a phone or mouse for hours.
  • Pregnancy: leg cramps are common in the second and third trimesters.
  • Age: muscles lose bulk and nerves become more irritable, so night cramps become more common after 50.
  • Stress, caffeine and lack of sleep: these make muscles twitchy, often around the eyes and in the calves.
  • Medicines: diuretics (water pills), statins, some asthma inhalers, and stimulants.

Muscle spasms of the thumb, fingers and forearm

The thumb, index finger and forearm muscles are used constantly for gripping, typing and phone use, which makes them prone to spasms. Common causes:

  • Repetitive strain: texting, typing, gaming, playing an instrument or using tools. The muscle at the base of the thumb and the forearm flexors tire and twitch.
  • Carpal tunnel syndrome: pressure on the median nerve at the wrist causes numbness, tingling and sometimes twitching or weakness in the thumb, index and middle fingers, often worse at night.
  • Pinched nerve in the neck: a disc or arthritis pressing on a nerve root can cause spasms, pain and tingling running down the arm into specific fingers.
  • Low calcium (tetany): the fingers and thumb fold inward toward the palm, often with tingling around the lips. Causes include low parathyroid hormone after neck surgery, low vitamin D and very low magnesium.
  • Focal hand dystonia (writer's cramp): cramping or curling of the fingers that happens only during a specific task, such as writing or playing an instrument.
  • Dehydration or low minerals after heavy sweating, vomiting or diarrhea.

Less common and serious causes

  • Electrolyte problems: low potassium (hypokalemia) from diuretics or vomiting; low calcium (hypocalcemia); low magnesium from alcohol, diarrhea or some acid-reducing medicines.
  • Nerve damage: peripheral neuropathy from diabetes, alcohol or vitamin B12 deficiency, and pinched nerves from a herniated disc.
  • Thyroid disease and kidney failure, especially in people on dialysis.
  • Neurological diseases: multiple sclerosis, Parkinson's disease, dystonia, and rarely motor neuron disease (ALS), in which twitching comes with progressive weakness and muscle wasting.
  • Poor circulation: cramping leg pain on walking that eases with rest (claudication).
  • Tetanus: a bacterial infection from a contaminated wound that causes severe spasms, starting in the jaw.

Twitching on its own, without weakness or wasting, is very rarely a sign of ALS. Benign fasciculations are extremely common, especially with anxiety, caffeine and exercise.

How doctors find the cause

Your doctor will ask where and when spasms happen, how long they last, what triggers them, your activity, fluid intake, alcohol and all medicines. They will examine muscle strength, bulk, reflexes and sensation, and may tap over the wrist for carpal tunnel. Tests may include:

  • blood tests for potassium, calcium, magnesium, kidney and thyroid function, blood sugar, vitamin D and B12, and creatine kinase (CK) for muscle damage
  • nerve conduction studies and electromyography (EMG) for nerve problems
  • an MRI of the neck or back for a pinched nerve

Treatment and home care

During a spasm

  • Stretch the muscle gently. For a calf cramp, straighten the leg and pull your toes toward you. For a hand cramp, open your fingers and press the palm flat against a table.
  • Massage the muscle firmly.
  • Apply heat to relax a tight muscle, or ice afterward if it is sore.
  • Walk around or move the limb.

Preventing spasms

  • Drink enough fluids, especially in heat and during exercise. Consider an electrolyte drink for long sessions.
  • Stretch the calves and hamstrings before bed and before exercise.
  • Take regular breaks from typing and phone use, and stretch your forearms and fingers.
  • Cut down on caffeine and alcohol, and get enough sleep.
  • Eat potassium- and magnesium-rich foods such as bananas, leafy greens, beans and nuts.

Quinine is no longer recommended for routine leg cramps because of serious side effects. Magnesium supplements have limited evidence for ordinary cramps but may help when levels are low. Specific causes such as carpal tunnel syndrome, low calcium or dystonia need their own treatment, which may include splints, supplements or botulinum toxin injections.

Frequently asked questions

What can cause muscle spasms in the forearm, thumb and pointer finger?

The most common causes are repetitive use (typing, texting, gripping), carpal tunnel syndrome, a pinched nerve in the neck, and dehydration. Spasms where the fingers curl inward with tingling around the mouth suggest low calcium. If spasms come with numbness or weakness, see a doctor.

Why do my thumb and fingers spasm?

Thumb and finger spasms are usually from muscle fatigue after repetitive hand use, or from irritation of the median nerve in carpal tunnel syndrome. Low calcium or magnesium, writer's cramp (a focal dystonia) and nerve problems are less common causes.

Are muscle spasms a sign of something serious?

Usually not. Most are caused by overuse, dehydration or holding one position. See a doctor if spasms are frequent, spread, come with weakness, muscle wasting, numbness, or follow a new medicine, or if you have other symptoms such as confusion or dark urine.

What deficiency causes muscle spasms?

Low potassium, calcium and magnesium can all cause spasms, as can dehydration and low sodium after heavy sweating. Low vitamin D can lead to low calcium. A simple blood test can check these levels.

How do I stop a muscle spasm quickly?

Gently stretch the muscle in the opposite direction to the cramp and hold it for 30 seconds, then massage it. Heat helps it relax. Walking or moving the limb also helps. Most spasms ease within a minute or two.

Sources

This guide was written from current patient and clinical guidance, including:

  • MedlinePlus (US National Library of Medicine): Muscle cramps
  • NHS: Leg cramps
  • Mayo Clinic: Muscle cramp
  • American Association of Neuromuscular and Electrodiagnostic Medicine: Muscle cramps
  • National Institute of Neurological Disorders and Stroke: Dystonia