sofidexFor patientsAre you a clinician? Clinical site

Health Library  ›  Questions  ›  What causes muscle spasms?

Question · Muscle cramps

What causes muscle spasms?

Muscle spasms often have no single clear cause. Possible triggers include muscle fatigue or overuse, staying in one position, heat and heavy sweating, pregnancy, fluid or salt loss, certain medicines, and conditions affecting nerves, blood flow, or mineral levels.

QuestionReviewed 2026-11-28sofidex editorial standards

Common triggers
Overuse, prolonged positions, heat, sweating, or increased activity
Possible contributors
Pregnancy, fluid or salt loss, and certain medicines
Less common causes
Nerve compression, reduced blood flow, or low mineral levels
Often unexplained
Many cramps, especially at night, have no clear cause

Everyday triggers

A muscle can cramp after it becomes tired or is overused during exercise or physical work. Holding one position for a long time, having tight calf muscles, or suddenly increasing activity can also trigger cramps.

Exercise in hot conditions and heavy sweating may contribute. Fluid and salt loss from sweating, vomiting, or diarrhoea can cause cramping, but cramps are not always due to dehydration.

Medicines and health conditions

Some medicines may cause muscle symptoms or change fluid and mineral levels. Do not stop a prescribed medicine on your own; a prescriber can review it if cramps began after starting or changing treatment.

Less common causes include low sodium, calcium, or magnesium, compressed nerves, and reduced blood flow. Thyroid disorders, diabetes, kidney disease, and some nerve or muscle conditions may also be involved.

Clues to the cause

Notice when cramps happen, which muscles are affected, and whether you also have swelling, numbness, weakness, or skin-colour changes. A record of the timing, duration, recent activity, medicines, and other symptoms can help identify the cause.

Occasional typical cramps often need no tests. Persistent cramps or other symptoms may lead to blood tests for mineral levels, kidney function, blood sugar, or thyroid function.

When to get help. Arrange an appointment if cramps are frequent, worsening, disturbing sleep, linked to a medicine change, or accompanied by ongoing numbness, weakness, weight loss, or difficulty walking. Seek urgent help for a newly swollen, warm, discoloured and painful leg, or for cramps with chest pain, breathlessness, faintness, severe weakness, dark urine, confusion, collapse, or sudden trouble speaking.

Sources

  1. 1NHS. Leg cramps
  2. 2Allen RE, Kirby KA. Nocturnal Leg Cramps . American Family Physician . 2012;86(4):350–355
  3. 3Garrison SR, Korownyk CS, Kolber MR, et al. Magnesium for skeletal muscle cramps . Cochrane Database of Systematic Reviews . 2020;9:CD009402
  4. 4American Academy of Neurology. Assessment: Symptomatic treatment for muscle cramps . Neurology . 2010;74(8):691–696
  5. 5US Food and Drug Administration. FDA Drug Safety Communication: Qualaquin should not be used for night-time leg cramps

Health information, not medical advice. Nothing here replaces talking to your own doctor about your own situation.