ICD-10 Code for Hypomagnesemia: E83.42 Guidelines & Coding Tips
E83.42.
Now the annoying part, which is that ICD-10-CM gives you three codes for low magnesium and scatters them across three chapters. E83.42 under metabolic disorders. E61.2 under nutritional deficiencies. P71.2 over in perinatal for babies under 28 days.
Which one you pick depends on why the mag is low. Not how low.
E83.42 Sits Under Disorders of Mineral Metabolism, And That Placement is The Whole Rule
Chapter 4, then E70-E88 metabolic disorders, then category E83 disorders of mineral metabolism, then E83.4 for magnesium, then .42 for the low end.
The parent category is the thing to hold onto. E83 is mineral metabolism. So E83.42 is a patient whose body is dumping magnesium or failing to handle it, not one who isn’t eating enough. Billable, no seventh character, nothing complicated about the code itself.
The Rule That Decides E83.42 vs E61.2 is Filed Under E61.2, Not E83.42

This is the bit that costs people money.
E61.2 carries an Excludes note pointing at hypomagnesemia E83.42. Everybody looks up E83.42 in the tabular, sees a clean billable code, and never opens E61.2 to find the instruction that actually governs the choice.
What that means in practice: E61.2 is nutritional only. Metabolic cause documented and E61.2 is off the table.
So what you’re hunting for in the record is aetiology.
Points you at E83.42:
- Diuretics, loop or thiazide.
- Renal wasting, including inherited tubulopathies if you get a Gitelman or a Bartter.
- Long-term PPI.
- Aminoglycosides, ampho B, cisplatin, calcineurin inhibitors.
- Malabsorption, chronic diarrhoea, IBD, NG suction.
- Alcohol.
Points you at E61.2:
- Documented poor intake.
- Normal renal function.
- Nothing else explaining the loss.
Honestly, on inpatient you’ll hardly ever land on E61.2, because anyone getting a mag level drawn is usually already on a diuretic or a PPI or vomiting. Outpatient nutrition is a different story, it turns up there.
Alcohol trips people up. Looks nutritional, since these patients often aren’t eating. Codes metabolic, because the mechanism is renal wasting and the note nearly always says so. Pick up the AUD as well.
P71.2 For Under 28 Days, And It Groups To 791 or 793
Note should say neonatal explicitly, and carry the level plus whatever prompted the test, usually feeding difficulty or something neuro.
Adjacent thing worth knowing since it comes up: R79.0 abnormal blood mineral has a Type 1 Excludes for E83.-. So a low mag that’s been diagnosed doesn’t go to R79.0. One or the other, never both.
E83.40 Exists And Shouldn’t Get Used Much
Serum mag is a number. The number tells you the direction.
If there’s a value in the chart and it’s low, E83.42 is sitting right there, and unspecified codes on a condition that isn’t ambiguous get flagged on review and make your specificity numbers look bad. If you’re reaching for E83.40, query instead.
Documentation Needs a Lab Value And a Provider Linking It to Something

Two things, and one without the other doesn’t hold.
The lab value. Under the lab’s own reference range, usually below 1.7 mg/dL, but check the range printed on the report because they vary and I’ve watched people code off a textbook number and get burned for it. CMS is clear enough that suspicion without lab confirmation doesn’t support the code.
The linkage. Provider tying the result to the patient. Any of:
- Tremor, fasciculations, hyperreflexia, tetany.
- ECG changes, PR or QT prolongation, T wave inversion, wide QRS, arrhythmia.
- Treatment given in response to the result.
A lab value on its own is an abnormal finding, not a diagnosis, and you can’t make that link yourself. This is where most technically correct E83.42s die on audit. Not the code selection. The linkage.
Code The Potassium And Calcium Too
Mag comes down and potassium usually follows, and stays down until the mag is fixed, which is why it reads as refractory hypokalemia. Calcium goes the same way, through impaired PTH release and end-organ PTH resistance.
Both are separately reportable when documented. They move severity, and on inpatient they can move the DRG.
Where These Get Denied
Four things, roughly in the order I see them:
- E61.2 assigned where the cause was metabolic. The Excludes note under E61.2 straightforwardly prohibits it, and this is far and away the most common one.
- Lab value with no provider linkage.
- E83.40 used where E83.42 was supported.
- Underlying cause left off entirely, so the chart carries the manifestation with nothing about the diuretic, the PPI or the alcohol behind it.