← OxalateWatch   All posts

Magnesium and Kidney Stones: The Crystal Inhibitor Behind the Numbers

2026-08-21 · By Elena Novak, Research Editor · Dietary reference, not medical advice

Calcium gets most of the attention in stone advice, but another mineral works quietly against crystals: magnesium. It is one of the body's natural crystal inhibitors, and the epidemiology backs that up with numbers large enough to take seriously.

The Numbers From Two Large Cohorts

In the Health Professionals Follow-up Study, men in the highest fifth of magnesium intake had a 29 percent lower risk of a first stone than men in the lowest fifth (relative risk 0.71, 95% CI 0.56-0.89), after adjusting for other diet factors. A later systematic review and meta-analysis pooled multiple cohorts and found a summary relative risk of 0.66 (95% CI 0.55-0.79) for higher versus lower magnesium intake — a 34 percent lower risk.

The mechanism is concrete. Magnesium competes with calcium to bind oxalate in the urine, forming magnesium oxalate, which stays dissolved far more readily than calcium oxalate. It also interferes with crystal growth directly. Low urinary magnesium is itself considered a stone risk factor, alongside low citrate and low volume.

The boundary, stated clearly: the population data show an association, and the mechanism is real, but clinical trials of magnesium supplements alone preventing stones in unselected stone formers are sparse. Food sources are the low-risk way to get more; supplements belong in a clinician's plan, not a self-directed one.

Magnesium-Rich Foods, With the Oxalate Twist

Here is the catch: some of the most magnesium-dense plants are also high in oxalate. The measured values show the trade:

FoodOxalate (mg)ServingRating
Almonds107 mg1/4 cupAvoid
Spinach, raw590 mg1 servingAvoid
Banana6 mg1 mediumSafe
Oatmeal, cooked2 mg1 cupSafe
Yogurt, plain whole-milk5 mg6 ozSafe

Almonds and spinach are magnesium powerhouses and also oxalate heavyweights — the exact foods to portion, not fear. Banana, oatmeal, and yogurt deliver magnesium with little oxalate, which is why they sit at the safe end of the stone table while still contributing to the magnesium side of the ledger.

What to Do With This

The move is to widen the magnesium base without widening the oxalate base. Favor the low-oxalate magnesium sources — bananas, oats, legumes, dairy — and keep the high-oxalate ones (nuts, spinach) portioned rather than central. The Nurses' Health Study II found that, after adjusting for other factors, magnesium intake alone was not independently significant in younger women, which tempers the message: magnesium helps as part of a balanced pattern, not as a single bullet. Calcium from food, fluid, and produce still do the heavy lifting.

Frequently Asked Questions

Should I take a magnesium supplement for stones?
Population data link higher magnesium intake to lower risk, but trials of supplements alone are limited. Food sources are the safer first step; a supplement should be discussed with your doctor, especially if you have kidney disease where magnesium can accumulate.
Are almonds bad because they are high in oxalate?
They are high-oxalate but also magnesium- and protein-rich. The measured answer is to portion them — a small handful, not the bag — and pair them with calcium. They are a trade, not a ban.
Sources:
Harvard T.H. Chan School of Public Health Oxalate Database (2024); USDA FoodData Central; Taylor EN, Stampfer MJ, Curhan GC. "Dietary factors and the risk of incident kidney stones in men." J Am Soc Nephrol. 2004;15(12):3225-3232; systematic review and meta-analysis, BMC Nephrol. 2020;21:267. All oxalate values are lab-measured via ion chromatography. This page is a dietary reference tool, not medical advice.

See how oxalate values are measured and verified on our data methodology page.

Medical Disclaimer: This site is a dietary reference tool based on published food composition data. It does not provide medical advice, diagnose, or treat any condition. Talk to your doctor or a registered dietitian before changing your diet, especially if you have kidney stones, kidney disease, or other medical conditions.