BackgroundThe Magnesium depletion score (MDS) serves as a novel metric for quantifying magnesium deficiency in the human body, comprehensively assessing four indicators: diuretic use, proton pump inhibitor use, estimated glomerular filtration rate, and alcohol abuse. However, there have been no studies examining the potential association between MDS and depression.MethodsThe study population for this cross-sectional study comprised adults from the National Health and Nutrition Examination Survey database from 2009 to 2018. Participants with a score of 10 or above on the Patient Health Questionnaire-9 were defined as having depression. We employed multivariable logistic regression models to investigate the association between MDS and depression. Furthermore, subgroup analyses were conducted to assess potential differences in this association among populations with diverse characteristics.ResultsA total of 13,197 participants were included in this study. After adjusting for all covariates, a significant positive correlation was observed between MDS and depression. Specifically, for every unit increase in MDS, the likelihood of developing depression increased by 13% (OR = 1.13, 95% CI: 1.04–1.22, p = 0.0025). This positive correlation was consistent across MDS groups, with a 19% increase in depression likelihood in the medium group (OR = 1.19, 95% CI: 1.01–1.41, p = 0.0404) and a 58% increase in the high group (OR = 1.58, 95% CI: 1.21–2.07, p = 0.0007), using the low subgroup as a reference. Subgroup analyses revealed significant differences in the relationship between MDS and depression across races, marital statuses, and hypertension status.ConclusionOur study has uncovered a significant positive association between MDS and depression. Reducing MDS in individuals may play a positive role in both the prevention and treatment of depression.