Hypomagnesemia associated with proton pump inhibitor (PPI) therapy has been documented in case reports. We performed a cross-sectional study to examine the association between PPI use and serum magnesium (Mg) levels or hypomagnesemia. Data were extracted from hospitalized adults with basic metabolic panels and/or serum magnesium levels available during the hospital stays. The first Mg value was used for data analysis. Hypomagnesemia is defined as levels less than 1.7 mg/dL (or 0.70 mmol/L). Multiple linear and logistic regression analyses were used to assess the association between PPI use and Mg levels or hypomagnesemia, respectively. Among study patients, PPI users (n = 207) had a mean Mg level of 1.91[SD = 0.34] mg/dL, and non-users (n = 280) 2.00 (0.30) mg/dL, p = 0.004. PPI use was associated with lower serum Mg levels (adjusted coefficient β = -0.10, 95% CI = [-0.16, -0.04]) after adjusting for confounders. PPI use was associated with risk of hypomagnesemia after adjusting for confounders (adjusted OR = 2.50, 95% CI = [1.43, 4.36]). Both standard (1) and high (2 or higher) defined daily dose units of PPI therapy were associated with hypomagnesemia. PPI use was associated with lower serum Mg levels and hypomagnesemia in a population of hospitalized adult patients. Our study supports the general notion that long-term PPI use could be associated with sub-clinical Mg insufficiency or deficiency status. Copyright © 2012 John Wiley & Sons, Ltd.