How Much Magnesium Should You Take for Leg Cramps?

Most people trying magnesium for leg cramps take between 200 and 400 mg per day, with 350 mg being the upper safety limit set by the NIH for supplemental magnesium in adults. But here’s the part that might surprise you: the best available clinical evidence suggests magnesium supplements don’t meaningfully reduce leg cramps in most people, even at these doses.

That doesn’t mean magnesium is irrelevant to muscle function. It plays a direct role in how your muscles contract and relax. But the gap between “magnesium matters for muscles” and “magnesium supplements fix cramps” is wider than most supplement labels suggest.

What the Clinical Evidence Actually Shows

A Cochrane review, the gold standard for evaluating medical evidence, pooled results from multiple randomized trials comparing magnesium supplements to placebo for nighttime leg cramps. The findings were consistently underwhelming. People taking magnesium experienced only about 0.18 fewer cramps per week than those taking a sugar pill, a difference that was not statistically significant. The percentage of people who saw at least a 25% improvement in cramp frequency was virtually identical in the magnesium and placebo groups.

Cramp intensity and duration didn’t budge either. The review’s conclusion was blunt: magnesium supplementation is unlikely to provide meaningful cramp relief for the general population experiencing idiopathic (unexplained) leg cramps, regardless of the dose used. The studies tested a range of doses and forms, and none stood out as effective.

So why do so many people swear by it? Placebo effects are powerful for subjective symptoms like cramps, and leg cramps also tend to come and go on their own. If you start a supplement during a bad stretch, natural improvement can feel like the magnesium is working.

When Magnesium Might Actually Help

There’s an important exception to the lackluster evidence: people who are genuinely magnesium-deficient. The clinical trials largely studied older adults with normal magnesium levels. If your body is actually low on magnesium, the situation is different. Magnesium deficiency can directly cause cramps, tremors, and muscle twitching, and correcting that deficiency resolves those symptoms.

Magnesium and calcium act as counterweights in muscle tissue. Calcium triggers muscle fibers to contract, while magnesium helps them relax. When magnesium levels drop too low, this balance tips toward contraction, and muscles become more excitable and prone to involuntary spasms. So if you’re cramping because you’re low on magnesium, supplementation addresses the root cause rather than just masking a symptom.

Risk factors for low magnesium include heavy alcohol use, poorly controlled diabetes, chronic digestive conditions like Crohn’s disease, long-term use of certain diuretics, and diets consistently low in leafy greens, nuts, and whole grains. If any of these apply, a blood test can clarify whether deficiency is contributing to your cramps.

Dosage and the Safety Ceiling

If you decide to try magnesium despite the mixed evidence, the NIH sets the tolerable upper intake level for supplemental magnesium at 350 mg per day for adults. This limit applies only to magnesium from supplements and medications, not from food. You can’t realistically overdose on magnesium from diet alone because your kidneys efficiently clear the excess.

Most people start with 200 to 350 mg daily. Going above 350 mg from supplements increases the risk of diarrhea, nausea, and stomach cramping. These gastrointestinal side effects are the most common reason people scale back their dose. Taking magnesium with food rather than on an empty stomach significantly reduces the chance of digestive upset and also improves absorption.

Which Form to Choose

Not all magnesium supplements are absorbed equally. Organic forms, where magnesium is bound to a carbon-containing molecule, are generally better absorbed than inorganic forms. In practical terms:

  • Magnesium citrate is well-absorbed and widely available, though it has a mild laxative effect that bothers some people.
  • Magnesium glycinate is bound to an amino acid, tends to be gentler on the stomach, and is a common choice for people taking it at bedtime.
  • Magnesium oxide is the cheapest option and packs more elemental magnesium per pill, but your body absorbs a smaller percentage of it. It’s also more likely to cause loose stools.

Absorption is dose-dependent for all forms. Your body absorbs a higher percentage of a smaller dose than a larger one, so splitting your intake into two smaller doses (say, 150 mg twice daily instead of 300 mg at once) can improve how much you actually retain.

Timing Your Dose

Consistency matters more than timing. Taking magnesium at the same time each day keeps your levels steady, and the full effects of supplementation build over weeks of regular use, not overnight.

That said, if your cramps tend to hit at night, taking magnesium one to two hours before bed is a reasonable approach. It may promote muscle relaxation and has a mild calming effect that some people find helpful for sleep. If you also take a calcium supplement, separate the two by several hours. Calcium and magnesium compete for absorption, so taking calcium in the morning and magnesium in the evening optimizes uptake of both.

Other Electrolytes That Affect Cramping

Magnesium gets the most attention, but it’s only one of several electrolytes involved in muscle function. Potassium supports nerve signaling to muscles. Sodium controls fluid balance. Calcium regulates contraction itself. An imbalance in any of these can trigger cramps, and focusing on magnesium alone may mean missing the actual culprit.

Dehydration is one of the most common and overlooked cramp triggers because it concentrates electrolytes unevenly. If your cramps happen after exercise, in hot weather, or on days you don’t drink enough water, fluid and overall electrolyte balance deserves attention before singling out magnesium.

Medications That Interact With Magnesium

Magnesium supplements can interfere with several common medications. If you take certain antibiotics (fluoroquinolones like ciprofloxacin, or tetracyclines like doxycycline), magnesium reduces how much antibiotic your body absorbs. You need to separate them by at least two hours before or four to six hours after taking magnesium. Magnesium can also reduce the absorption of digoxin, a heart medication, and may increase bleeding risk if you take blood thinners.

If you’re on any prescription medication, checking for interactions before adding a magnesium supplement is worth the two minutes it takes.