Is Magnesium Good for Leg Cramps at Night?

Magnesium is one of the most popular supplements people reach for when nighttime leg cramps strike, but the clinical evidence is disappointing. A Cochrane review of randomized trials found that magnesium supplements produced no statistically significant improvement in cramp frequency, intensity, or duration compared to placebo in older adults. That said, magnesium plays a real role in how muscles contract and relax, and nearly half the U.S. population falls short of the recommended 300 to 400 mg daily intake, which means some people with cramps genuinely are low in magnesium.

What the Clinical Trials Actually Show

The strongest evidence comes from a 2020 Cochrane systematic review that pooled data from multiple randomized controlled trials. Across five studies involving 307 participants, people taking magnesium experienced only 0.18 fewer cramps per week than those on placebo. That difference was not statistically significant. The percentage of people who saw at least a 25% reduction in cramp frequency was essentially identical between groups.

Cramp intensity and duration didn’t improve either. The proportion of participants still rating their cramps as moderate or severe at four weeks was no different whether they took magnesium or a sugar pill. The review concluded that magnesium supplementation is unlikely to provide clinically meaningful relief for older adults with nocturnal leg cramps. In fact, participants in the magnesium groups were about 50% more likely to experience minor side effects, mostly digestive issues like diarrhea.

For pregnant women, the picture is murkier. One trial found that women taking magnesium were nearly six times more likely to report being completely cramp-free after treatment, and another showed a 42% greater chance of cutting cramp frequency in half. But other trials in the same Cochrane analysis found little to no benefit. The evidence is inconsistent enough that no firm recommendation can be made for pregnancy-related cramps either.

Why Magnesium Seems Like It Should Work

The reason magnesium is so widely recommended despite weak trial data is that its role in muscle function is well established. Inside your muscle cells, magnesium sits on the same binding sites that calcium uses to trigger a contraction. In a resting muscle, magnesium concentrations are roughly 10,000 times higher than calcium, effectively blocking those sites and keeping the muscle relaxed. When your nervous system signals a contraction, calcium floods in from storage compartments and displaces the magnesium.

When magnesium levels drop, even small amounts of calcium can push magnesium off those binding sites. The result is a muscle that contracts more easily and has a harder time relaxing, which is essentially what a cramp is. Magnesium is also required for the pump that pulls calcium back into storage after a contraction ends. Without enough of it, that cleanup process slows down and the muscle stays contracted longer.

This biochemistry is why magnesium deficiency can cause cramps and spasms. The disconnect is that most people who get nighttime leg cramps aren’t actually magnesium deficient. Nocturnal cramps are extremely common in older adults for reasons that involve nerve function, circulation, and muscle fatigue, not just mineral levels.

When Magnesium Might Still Help

If your magnesium intake is genuinely low, supplementation could address one contributing factor. Up to 42% of young adults have undetected magnesium insufficiency, and nearly half the U.S. population doesn’t meet the recommended daily amount. People who eat few nuts, seeds, leafy greens, or whole grains are at higher risk. So are those who drink alcohol heavily, take certain diuretics, or have digestive conditions that impair absorption.

A Mayo Clinic physician recommends 250 to 500 mg of magnesium taken as a single dose at bedtime for people whose sleep is disrupted by leg cramps or restless legs. The tolerable upper intake level for supplemental magnesium (separate from what you get through food) is 350 mg per day for adults, according to the National Institutes of Health. Doses above that threshold increase the likelihood of diarrhea and stomach cramping.

Choosing a Supplement Form

Not all magnesium supplements are equally well absorbed. Chelated forms, where magnesium is bonded to amino acids, tend to be absorbed more efficiently. Magnesium glycinate is a common chelated option and is less likely to cause diarrhea, making it a practical choice for people with sensitive stomachs. Magnesium citrate is well absorbed too, but it has a notable laxative effect that some people find uncomfortable at higher doses.

Magnesium oxide is the cheapest and most widely available form, but your body absorbs it less efficiently, so you get less usable magnesium per pill. If you’re specifically trying to address cramps, glycinate or citrate are more practical choices.

Topical Magnesium Doesn’t Absorb Through Skin

Magnesium sprays, oils, and bath salts are marketed heavily for muscle cramps, but the science doesn’t support them. A review published in Nutrients found that the claim of transdermal magnesium absorption is scientifically unsupported. The outer layer of your skin is specifically designed to block minerals and other substances from entering the body. Studies in both animals and human volunteers confirmed that magnesium applied to the skin does not raise blood magnesium levels. Any relief people feel from rubbing magnesium oil on a cramping muscle is likely from the massage itself or a placebo effect.

Who Should Avoid Magnesium Supplements

People with kidney disease face the most significant risk. Your kidneys are responsible for clearing excess magnesium from the blood, and when kidney function is impaired, magnesium can accumulate to dangerous levels. This condition, hypermagnesemia, interferes with heart rhythm and muscle function. At very high levels, excess magnesium suppresses the nerve signals that trigger muscle contractions, including in the heart. Anyone with chronic kidney disease should not take magnesium supplements without direct guidance from a nephrologist.

Magnesium can also interfere with certain medications, particularly some antibiotics and blood pressure drugs, by altering how they’re absorbed. If you take prescription medications regularly, checking for interactions before adding magnesium is worth the effort.