EN
РусскийEnglishEspañol — próximamenteFrançais — bientôtDeutsch — in VorbereitungItaliano — in arrivoAll languages

Night leg cramps: which tests reveal the cause

Nighttime calf cramps are not always "low magnesium": electrolytes, blood sugar, vitamin D — and when to see a doctor.

In shortFor nighttime calf cramps, test: magnesium (typical range 0.70–0.91 mmol/L), calcium, potassium, and sodium — the electrolytes muscle contraction runs on; glucose — cramps occur with diabetes; vitamin D — its deficiency comes with muscle spasms. If results are normal, the cause is sought in veins, nerves, and lifestyle: dehydration, exertion, diuretics.

What a cramp is, biochemically

A cramp is an uncontrolled muscle contraction, and contraction is governed by calcium, magnesium, potassium, and sodium crossing cell membranes. A shift in any of these electrolytes makes muscle and nerve twitchier — and the nighttime calf seizes.

So a sensible search starts with an electrolyte panel: magnesium, calcium, potassium, sodium. Cheap tests that immediately rule out the most fixable group of causes.

Magnesium and calcium: the main pair

Magnesium deficiency is the most discussed cause of cramps, and not without reason: magnesium dampens excessive nerve excitation. The typical blood range is 0.70–0.91 mmol/L (1.7–2.2 mg/dL); a result below it, together with cramps, argues for correction supervised by a doctor.

Calcium works as magnesium's pair: low calcium produces spasms and crawling sensations. Read both together — and do not swallow supplements blindly: excess calcium without an indication harms vessels and kidneys.

Potassium, sodium, and water

Potassium and sodium shift with vomiting, diarrhea, heavy sweating, and — very often — with diuretics prescribed for blood pressure and edema. If you take water pills, cramps are a classic reason to check electrolytes and discuss the regimen with your doctor.

A separate line is water itself: dehydration concentrates the blood and provokes night spasms, especially in summer and in people who train. Before hunting for disease, check the obvious — how much you drink and how much you lose in sweat.

If electrolytes are normal

A clean electrolyte panel shifts the search onward: glucose — diabetic neuropathy produces cramps and burning in the legs; vitamin D — its deficiency comes with muscle weakness and spasms. Both tests cost little compared to the diagnoses they rule out.

Beyond that it is an examination, not a laboratory: varicose veins and venous insufficiency, lumbar spine problems with root irritation, flat feet, long hours standing. If cramps are one-sided with swelling and pain — see a specialist promptly to exclude thrombosis.

The basic set for cramps

  • Magnesium — 0.70–0.91 mmol/L (1.7–2.2 mg/dL), international typical range
  • Calcium — works as magnesium's pair
  • Potassium and sodium — especially on diuretics
  • Glucose — cramps occur with diabetes
  • Vitamin D — deficiency produces muscle spasms

Markers covered in this article

Several markers on your report?

See how MedProtect explains results in the app: the whole report, a check of the recognized values, and a clear breakdown.

Frequently asked questions

Can I just take magnesium without testing?
A short course of a standard over-the-counter dose is safe for most people, but without a test you do not know whether magnesium is the issue: cramps from veins or neuropathy will not respond. Testing the panel and closing the actual deficiency is smarter.
Why do cramps strike at night?
At night the foot is pointed, the calf shortened and ready to spasm, and circulation slows. Any electrolyte shift or the day's muscle fatigue plays out exactly in that position.
When are cramps dangerous?
Warning signs: a spasm in one leg with swelling and pain (exclude thrombosis), cramps with weakness and numbness (a neurologist), generalized spasms with altered consciousness — emergency help.

Sources

  1. Magnesium blood test: MedlinePlus Medical Encyclopedia — MedlinePlus, National Library of Medicine. Accessed: August 31, 2026.
  2. Calcium Blood Test: MedlinePlus Medical Test — MedlinePlus, National Library of Medicine. Accessed: August 29, 2026.
  3. Calcium blood test: MedlinePlus Medical Encyclopedia — MedlinePlus, National Library of Medicine. Accessed: August 29, 2026.
  4. Blood Glucose Test: MedlinePlus Medical Test — MedlinePlus, National Library of Medicine. Accessed: August 29, 2026.

Keep reading