Neither magnesium nor potassium is a clear winner for leg cramps, and the honest answer may disappoint: clinical evidence for both is weaker than supplement marketing suggests. Magnesium has been studied more directly for cramps, but rigorous trials show it doesn’t significantly reduce cramp frequency in most people. Potassium, meanwhile, is rarely studied as a standalone cramp treatment because supplementing it carries real safety risks. What actually matters is whether you’re deficient in one or both minerals, because that changes the picture entirely.
What Each Mineral Does in Your Muscles
Magnesium and potassium play different roles in muscle function, which is why people assume supplementing either one should help with cramps. Magnesium works as a natural counterbalance to calcium inside muscle cells. When calcium floods in, muscles contract. Magnesium helps lower that intracellular calcium, allowing the muscle to relax. Without enough magnesium, the relaxation step can falter, and muscles may twitch or spasm.
Potassium controls something more fundamental: the electrical charge across your muscle cell membranes. Your muscles fire through rapid shifts of sodium and potassium across cell walls. When potassium levels drop, the normal electrical signaling gets disrupted, making muscles more excitable and prone to involuntary contractions. This is why muscle cramps are a hallmark symptom of low potassium, typically appearing when blood levels fall below 3.0 mmol/L.
What the Clinical Trials Actually Show
Magnesium has been tested in multiple randomized controlled trials for nighttime leg cramps, and the results are consistently underwhelming. A Cochrane review pooling data from several studies found that oral magnesium (ranging from 100 to 520 mg of elemental magnesium daily) did not significantly reduce cramp frequency compared to placebo after one month. It didn’t meaningfully improve cramp intensity or duration either, and these findings carried moderate to high certainty.
The one exception is pregnant women. A separate meta-analysis of seven trials found that while magnesium showed no benefit in the general population, it had a small but measurable effect in pregnant women, reducing cramps by roughly 0.8 fewer episodes per week compared to placebo. Pregnancy creates unique mineral demands, which likely explains the difference.
Potassium, by contrast, has almost no clinical trial data for cramps in people with normal potassium levels. Researchers don’t run those studies partly because potassium supplements carry cardiac risks at higher doses, making casual experimentation harder to justify ethically. What we do know is that confirmed low potassium (hypokalemia) reliably causes cramps, and correcting the deficiency resolves them. But that’s treating a deficiency, not using potassium as a general cramp remedy.
Cramps Often Aren’t About Either Mineral
Most leg cramps in otherwise healthy people don’t stem from a magnesium or potassium shortage. Current research points to a neuromuscular mechanism: an imbalance between excitatory and inhibitory signals at the nerve level. Essentially, the nerve controlling the muscle gets overstimulated while the signals that should calm it down become too weak. This can happen from muscle fatigue, prolonged sitting, or holding an awkward position.
Sodium and chloride may play a bigger role than people realize. One study found that dehydration alone didn’t make muscles more cramp-prone, but drinking plain water after dehydration did, because it diluted sodium and chloride concentrations in the blood. When participants rehydrated with an electrolyte solution instead, cramp susceptibility didn’t increase. This suggests that the overall electrolyte balance matters more than any single mineral.
When Deficiency Is the Real Problem
If you’re actually low in magnesium or potassium, supplementing the one you’re missing will likely help your cramps. The challenge is figuring out which one, since symptoms overlap. Both deficiencies cause muscle cramps, weakness, and fatigue. A few patterns can help distinguish them.
Low potassium tends to produce more generalized weakness alongside cramps, and it’s common in people taking certain blood pressure medications (especially diuretics), those with frequent vomiting or diarrhea, or anyone eating a heavily processed diet low in fruits and vegetables. Symptoms usually don’t appear until blood levels drop below 3.0 mmol/L, and significant weakness sets in below 2.5 mmol/L. A simple blood test can confirm it.
Low magnesium is harder to detect because only about 1% of your body’s magnesium lives in the blood, so standard tests can miss a deficit. People at higher risk include those who drink alcohol heavily, have digestive conditions that impair absorption, take proton pump inhibitors for acid reflux, or are older adults. Magnesium deficiency often shows up as cramps combined with eye twitches, restlessness, or trouble sleeping.
Supplement Safety Differences
This is where the two minerals diverge sharply. Magnesium supplements are relatively safe and widely available. Adults need 310 to 420 mg daily depending on age and sex, and most forms are well tolerated. The main side effect at higher doses is loose stools, which is why magnesium citrate doubles as a laxative. Magnesium citrate also happens to be far better absorbed than the cheaper magnesium oxide. In one study, urinary magnesium (a marker of absorption) was roughly 37 times higher after a citrate dose than after an equivalent oxide dose.
Potassium supplements are a different story. Most over-the-counter products contain just 99 mg per pill, only about 2% of the daily value. That limit exists because the FDA found that oral potassium products above 99 mg can cause small-bowel lesions, including obstruction and hemorrhage. More importantly, too much potassium can cause dangerous heart rhythm problems. People with kidney disease, diabetes, heart failure, or those on ACE inhibitors or potassium-sparing diuretics face especially high risk because their bodies can’t clear excess potassium efficiently. Even healthy people can overwhelm their kidneys with very high supplemental doses.
This means you can reasonably try magnesium on your own for cramps with minimal risk. Potassium supplementation beyond small doses should be guided by bloodwork confirming a deficiency.
Best Food Sources for Both Minerals
Food is the safest and most effective way to increase your intake of both minerals simultaneously, and many of the best sources deliver both at once.
- Cooked spinach: 636 mg potassium per half cup, plus one of the richest vegetable sources of magnesium
- Baked potato with skin: 531 mg potassium per medium potato
- Edamame: 422 mg potassium per half cup, with substantial magnesium from the soybean
- Pinto beans: 405 mg potassium per half cup
- Salmon: 449 mg potassium per small fillet, plus a good magnesium source
- Banana: 358 mg potassium per small banana
- Raisins: 744 mg potassium per quarter cup, one of the most concentrated sources
For magnesium specifically, pumpkin seeds, almonds, dark chocolate, and black beans are among the most concentrated sources. Adults who eat several servings of vegetables, legumes, nuts, and whole grains daily will generally meet their needs for both minerals without supplements.
The Practical Bottom Line
If you’re choosing between the two for occasional leg cramps, magnesium is the more practical option to try first. Not because the evidence for it is strong, but because it’s safe to experiment with, widely available, and many people fall short of the recommended intake. Choose magnesium citrate or glycinate over oxide for better absorption, and give it at least four weeks.
Potassium is harder to supplement safely, and the cramps it causes are typically tied to a measurable deficiency rather than a marginal shortfall. If your cramps are frequent and severe, or if you take medications that affect electrolyte balance, getting bloodwork to check both levels is more useful than guessing which supplement to buy. And don’t overlook sodium: staying hydrated with electrolytes rather than plain water alone may do more for exercise-related cramps than either magnesium or potassium on its own.

