The prevalence of hypomagnesemia and hypermagnesemia among hospitalized patients was studied by determining magnesium levels in 621 serum samples randomly selected from those submitted to the clinical chemistry laboratory for a biochemical test panel. The reference range for serum magnesium was established in this study as 1.2 to 1.9 mEq/L from measurements of serum magnesium on 341 healthy volunteers. Hypomagnesemia (less than 1.2 mEq/L) was present in 68 patients or 11.0%, and hypermagnesemia (greater than 1.9 mEq/L) occurred in 58 patients or 9.3%. The degree of association between hypomagnesemia and hypocalcemia was assessed by measuring serum magnesium on a separate group of 61 patients with hypocalcemia (corrected calcium less than 8.6 mg/dL). Hypomagnesemia was present in 23.3% of patients hypocalcemic in the absence of renal failure; this proportion was higher significantly than the 11.0% who were hypomagnesemic in the hospitalized patient group (P less than 0.025).