Skip to main content

Blood Tests for Muscle Cramps and Spasms

That 3am calf cramp is rarely “just one of those things.” Here are the blood tests that reveal what your muscles are trying to tell you.

Why Muscles Cramp in the First Place

A muscle cramp is a sudden, involuntary contraction that will not let go. It happens when the electrical balance inside the muscle cell goes wrong. Three things have to work in perfect harmony: calcium tells the muscle to contract, magnesium tells it to relax, and potassium and sodium move the electrical signal across the cell wall.

Disrupt any one of those minerals - or starve the muscle of oxygen, sugar, or nerve signals - and the muscle locks. The good news is that almost every cause leaves a fingerprint in your blood. A simple panel of tests can usually find it in one go.

Persistent cramps - more than a couple of times a week, or any cramp that wakes you from sleep - are worth investigating. They are not normal at any age.

8 Blood-Testable Causes of Muscle Cramps

Magnesium Deficiency

Serum Magnesium
RBC Magnesium

Why this causes cramps: Magnesium is required for muscle relaxation. Calcium contracts muscles; magnesium relaxes them. Without enough magnesium, muscles cannot fully relax and lock up into painful cramps. This is the single most common cause of unexplained cramps in adults.

How to recognise it: Cramps at night (especially calves), eyelid twitches, restless legs, muscle stiffness, anxiety, poor sleep. Often worse after intense exercise, sweating, or alcohol use. Soft drinks and processed foods deplete magnesium further.

Low Calcium

Calcium (corrected)
Albumin
Vitamin D

Why this causes cramps: Calcium is essential for the electrical signal that tells muscles to contract and release. Low calcium (hypocalcaemia) causes muscle hyperexcitability - nerves fire too easily, triggering spasms, twitches, and full cramps. Around the mouth and hands is a classic pattern.

How to recognise it: Tingling around the lips or fingertips, muscle twitches at rest (not just during movement), Chvostek sign (tap the cheek - it spasms), hand cramps that curl the fingers. Often linked to vitamin D deficiency.

Low Potassium

Potassium
Urea
Creatinine

Why this causes cramps: Potassium controls the electrical charge across muscle cell membranes. Low potassium (hypokalaemia) makes muscles weak and prone to cramping. Diuretics, vomiting, diarrhoea, and excessive sweating all drain potassium fast. This is one cause your GP should rule out urgently.

How to recognise it: Generalised muscle weakness alongside cramps, constipation, heart palpitations, fatigue. People on water tablets (frusemide), with eating disorders, or with severe gastroenteritis are at highest risk. Severe hypokalaemia is a medical emergency.

Low Sodium

Sodium
Plasma Osmolality

Why this causes cramps: Sodium is the primary electrolyte in your blood, and it works tightly with potassium to control nerve and muscle signals. Endurance athletes who drink only water during long events can develop dilutional hyponatraemia - and the cramps come fast.

How to recognise it: Cramps during or after long exercise sessions, headache, nausea, confusion, swollen fingers. Affects marathon runners, hikers, tradies working in heat, and people on certain antidepressants (SSRIs cause SIADH).

Vitamin D Deficiency

25-Hydroxyvitamin D

Why this causes cramps: Vitamin D regulates calcium absorption AND has direct effects on muscle function. Vitamin D receptors are present in every muscle cell. Deficiency causes muscle weakness, pain and cramps - even when calcium levels look normal on a blood test.

How to recognise it: Cramps plus deep muscle aches, weakness climbing stairs, bone tenderness when pressed (especially the shins and breastbone), low mood, frequent infections. Over 30% of Australian adults are deficient despite the sunshine.

Kidney Dysfunction

eGFR
Creatinine
Potassium
Calcium
Phosphate

Why this causes cramps: Your kidneys regulate every electrolyte in your blood. When kidney function declines, electrolyte balance goes haywire - too much potassium, too little calcium, abnormal phosphate. The cramps from kidney disease are deep, persistent, and often worsen at night or during dialysis.

How to recognise it: Cramps plus swelling in the ankles, foamy urine, fatigue, itchy skin, metallic taste in the mouth, reduced urine output. Diabetics, people with high blood pressure, and anyone over 60 should have eGFR checked annually.

Diabetes / High Blood Sugar

HbA1c
Fasting Glucose

Why this causes cramps: Chronically elevated blood sugar damages small nerves (diabetic neuropathy), and the resulting nerve dysfunction causes painful cramps - especially at night in the calves and feet. Diabetes also causes electrolyte imbalances through frequent urination.

How to recognise it: Cramps plus burning or tingling in the feet, slow-healing wounds, frequent thirst, blurred vision, frequent urination. Cramps that wake you from sleep at 2-3am are a classic diabetic neuropathy pattern.

Thyroid Dysfunction

TSH
Free T4
Free T3

Why this causes cramps: An underactive thyroid (hypothyroidism) slows muscle relaxation and energy production within muscle cells. The result is cramps, stiffness, and a curious symptom called myoedema - where you press the muscle and it stays dented for a moment.

How to recognise it: Cramps plus cold intolerance, weight gain, dry skin, fatigue, constipation, slow heart rate, hoarse voice. The cramps are often in larger muscle groups (thighs, shoulders) rather than the typical calf cramps of magnesium deficiency.

Cramp Pattern Matcher

Where and when you cramp tells your doctor a lot. Match your pattern to the most likely cause and the test that should be ordered first.

PatternMost Likely CauseTest First
Night cramps in calvesMagnesium deficiency, dehydration

Magnesium, Sodium

Cramps during exerciseSodium / potassium loss from sweat

Sodium, Potassium

Hand or foot cramps with tinglingLow calcium or vitamin D

Calcium, Vitamin D

Cramps + numbness in feetDiabetic neuropathy

HbA1c, Fasting Glucose

Cramps + dark urine after exerciseRhabdomyolysis - URGENT

CK, eGFR, Potassium

Generalised muscle weaknessLow potassium, thyroid issue

Potassium, TSH

Cramps + restless legsIron or magnesium deficiency

Ferritin, Magnesium

Cramps + new medicationStatin, diuretic, or beta-agonist side effect

CK, Potassium

Cramps + bone painVitamin D deficiency

25-OH Vitamin D

Cramps in pregnancyCalcium, magnesium, or low blood sugar

Calcium, Magnesium, BSL

Exercise Cramps vs Rest Cramps

When your cramps happen matters as much as where. Two different problems, two different test priorities.

Exercise-induced cramps

During or right after activity, especially in heat or long sessions.

Most likely: sodium loss, dehydration, glycogen depletion.
Test first: Sodium, Potassium, CK, eGFR.

Rest cramps (especially at night)

Wake you from sleep, lock the calf or foot for minutes at a time.

Most likely: magnesium, vitamin D, ferritin, diabetes, thyroid.
Test first: Magnesium, Vitamin D, Ferritin, HbA1c, TSH.

What to Ask Your Doctor

Many GPs default to telling cramp patients to drink more water and eat a banana. That helps some people but misses the real cause in most. Walk in with a specific request.

Ready-to-use script for your GP appointment:

“I have been getting muscle cramps for [X weeks/months], mainly in my [calves/hands/feet] and most often [at night / during exercise / at random]. Increasing fluids and bananas has not helped. Could we check a full electrolyte panel including magnesium, calcium, vitamin D, kidney function, HbA1c and thyroid - and CK if you think muscle damage is possible?”

Electrolytes (Na, K, Cl, HCO3)

Magnesium

Corrected Calcium

Phosphate

Vitamin D (25-OH)

Kidney function (eGFR, Creatinine)

HbA1c

TSH and Free T4

CK (Creatine Kinase)

Ferritin

Cramp Red Flags - When to Act Fast

Most cramps are uncomfortable but harmless. These combinations are not. Get medical help the same day for any of these.

The Cramp Investigation Panel

If your GP can only order one batch of blood tests to look into persistent cramps, this is the panel that covers all the common causes. In Australia, almost everything below is bulk billed when ordered with a clinical reason.

TestWhat it checksCost (Australia)
Electrolytes (Na, K, Cl, HCO3)Sodium, potassium, chloride - core nerve & muscle signalling
Bulk billed
MagnesiumThe most common deficiency causing cramps
Bulk billed*
Calcium (corrected)Muscle contraction control
Bulk billed
PhosphateOften abnormal alongside calcium
Bulk billed
Vitamin D (25-OH)Muscle function and calcium absorption
Bulk billed*
Kidney Function (eGFR, Creatinine)Filtration of electrolytes
Bulk billed
HbA1cDetects diabetic neuropathy as a cause
Bulk billed
TSH (Thyroid)Hypothyroid cramps and stiffness
Bulk billed
CK (Creatine Kinase)Muscle breakdown - rules out statin myopathy / rhabdo
Bulk billed*
FerritinIron stores - linked to restless legs and night cramps
Bulk billed

* Magnesium, vitamin D and CK are bulk billed when there is a clinical reason on the request form - persistent cramps qualifies.


Already Had a Blood Test? See What It Says

Upload your results to SmarterBlood and our AI will instantly check every cramp-related marker, highlight what is out of range, and explain it in plain English. Free and private.