How to test for magnesium deficiency
Assessment of magnesium status rests on symptoms, risk factors, and targeted labs. The most common test is serum magnesium, useful to detect frank hypomagnesemia; additional tests may be needed depending on context.
Which tests first?
- Serum magnesium (venous blood): first‑line and widely available. Low values confirm hypomagnesemia. Reference ranges vary by lab; interpret with clinical context; see reference markers.
- Electrolyte panel: check potassium (hypokalemia is common), calcium, sometimes phosphate, to orient mechanism and consequences.
- Renal function: kidney handling governs magnesium balance and supplement safety.
Serum magnesium represents a small fraction of total body magnesium; it can be normal despite tissue deficiency, especially early or in mild cases.
Understanding limitations and clinical interpretation
A normal serum magnesium does not exclude deficiency, particularly when signs (cramps, paresthesias, fatigue, palpitations) and risk factors are present (GI losses, alcohol, diuretics, PPIs) — see hypomagnesemia.
In practice, weigh:
- Symptom severity and chronology
- Current medications (diuretics, PPIs, aminoglycosides, chemotherapy)
- Comorbidities (diabetes, GI diseases)
- Associated labs (K/Ca), often more informative than serum magnesium alone, per StatPearls
Additional tests when doubt persists
- 24‑hour urine magnesium: distinguishes renal (high urinary magnesium) from GI losses; more informative than a random spot
- Erythrocyte magnesium (RBC): sometimes proposed; clinical value debated and availability variable; reserve for specialized settings
- Ionized magnesium: free fraction; technique not standardized and limited availability; mostly specialized use
- Magnesium loading test: rarely used; can help document tissue deficiency when doubt remains despite equivocal serum results
Start with serum magnesium and electrolytes. Consider advanced tests only when there is a clinic‑lab mismatch or persistent high‑risk context.
When to order labs
Common indications: combination of cramps/spasms, paresthesias, fatigue, sleep issues; palpitations; GI losses, alcohol use, diuretics, PPIs; or comorbidities (diabetes, GI disease). In patients at cardiovascular risk or on multiple drugs, document early before adjusting treatments — see hypomagnesemia.
Seizures, arrhythmias, altered consciousness: address urgently. IV treatment is hospital‑based and does not replace oral supplementation.
Practical prep and avoiding common pitfalls
- Ideally avoid supplementation in the 24–48 h before the blood draw if the goal is diagnostic (unless advised otherwise)
- List medications (diuretics, PPIs, antibiotics), alcohol, recent diarrhea, dehydration
- Interpret results against lab reference ranges and the overall clinical picture
Which tests are most useful by scenario
- Serum magnesium: first line; does not reflect total stores
- Electrolyte panel: K, Ca, P for context
- 24‑h urine magnesium: differentiates renal vs GI losses; collection burden
- RBC magnesium: debated; specialized contexts
- Ionized magnesium: free fraction; limited standardization/availability




