Magnesium is involved in hundreds of enzymatic reactions, including energy production, muscle function, insulin signaling, and nerve stability. In the kidneys, magnesium is filtered and reabsorbed to maintain balance, with excess excreted in urine. A 24 hour urine magnesium test measures daily magnesium loss and helps assess both intake and renal handling.
Low urinary magnesium may reflect inadequate dietary intake or increased retention in the setting of deficiency. This pattern is clinically important because magnesium binds oxalate in the urine, reducing the formation of calcium oxalate kidney stones. Higher urinary magnesium is generally protective against stones, though very high levels may reflect supplementation or altered kidney handling. Because blood magnesium often stays normal even in deficiency, urine testing can reveal hidden magnesium imbalance that affects stone risk and metabolic health.