Skip to main content

Does magnesium help with muscle cramps and soreness?

Medically reviewed by Kristianne Hannemann, PharmD. Last updated on April 27, 2025.

Official answer

by Drugs.com

Magnesium is a mineral that has been marketed as a treatment for muscle cramps and soreness. Notably, magnesium is critically involved in muscle function, specifically the processes of contraction and relaxation. This physiological role has led to the widespread belief and common recommendation that magnesium supplementation can alleviate muscle cramps and soreness. However, the evidence on its efficacy is mixed. Below, we’ll dive into the latest research on magnesium and its relationship to muscle cramps.

What is Magnesium?

Magnesium is an important mineral that the body can't make on its own. It plays a key role in nerve communication and muscle contraction. Magnesium is found in a number of different sources, including many common supplements. Good dietary sources of magnesium include leafy green vegetables (spinach, kale), nuts (almonds, cashews), seeds (pumpkin, chia), legumes (beans, lentils), whole grains, avocados, and dark chocolate. Consulting a healthcare provider is recommended before starting supplementation, especially for those with kidney conditions, as excess magnesium is excreted by the kidneys.

What is the Role of Magnesium in Muscle Function?

Muscle contraction is initiated by calcium entering muscle cells, triggering a cascade of events leading to the interaction of actin and myosin filaments. Muscle relaxation requires the active pumping of calcium out of the cell cytoplasm and back into storage. Magnesium plays several key roles here. Given these roles, a deficiency in magnesium can theoretically disrupt normal muscle function, potentially leading to symptoms like cramping, spasms, and weakness.

Does Magnesium Help with Muscle Cramps?

Muscle cramps can strike for various reasons, and magnesium's effectiveness seems to depend heavily on the underlying cause. Here is a breakdown of different reasons people might experience muscle cramps:

  • Confirmed magnesium deficiency: If blood tests confirm you have low magnesium levels (hypomagnesemia), supplementation is often necessary and likely very effective at resolving associated muscle cramps and weakness. Deficiency can result from poor diet, certain medical conditions (like gastrointestinal diseases), some medications (like diuretics), or chronic alcoholism.
  • Pregnancy cramps: Leg cramps are common during pregnancy. Research is mixed on whether magnesium is an effective way to reduce the frequency and intensity of these cramps for expectant mothers.
  • Nocturnal leg cramps: For those common, often age-related leg cramps that occur at night without a known magnesium deficiency, studies have produced conflicting results. Several major reviews have concluded that magnesium supplements are generally not significantly better than a placebo for preventing these types of cramps in the general adult population.
  • Exercise-associated muscle cramps (EAMC): Cramps during or after intense exercise are complex. While electrolyte depletion (including magnesium) is often blamed, factors like muscle fatigue, dehydration, and altered neuromuscular control are likely major players. Lactic acid, produced during intense exercise when the body can't get enough oxygen to muscles, can contribute to muscle fatigue and burning sensations. Some research shows that magnesium may delay the accumulation of lactate in muscles during exercise. Currently, there isn't strong, consistent evidence proving that taking magnesium supplements prevents EAMC in athletes.

Magnesium and Muscle Soreness (DOMS): Limited Support

Delayed onset muscle soreness, or DOMS, is that familiar ache appearing 24-72 hours after strenuous or new exercise. It's caused by microscopic muscle damage and inflammation.

While magnesium is involved in energy metabolism and has anti-inflammatory properties, the theory hasn't translated into strong proof for supplementation. Most research examining whether magnesium supplements can reduce the severity or duration of DOMS has found little to no significant benefit. Proper cool-downs, hydration, adequate protein intake, and rest remain the primary strategies for managing post-exercise soreness.

Studies on Magnesium for Muscle Cramps

  • A Cochrane review examined the efficacy of magnesium supplementation for skeletal muscle cramps. The review concluded that it is unlikely that magnesium supplementation is effective for idiopathic skeletal muscle cramps at any dose or administration route used.
  • A systematic review also found similar results, with small and not statistically significant differences in cramp frequency between magnesium and placebo groups in older people and pregnant women.
  • A study involving intravenous infusions of magnesium in people with nighttime muscle cramps found no difference between magnesium and placebo groups, showing that magnesium doesn't make a difference in reducing cramp frequency or severity.
  • A meta-analysis of trials found no RCTs evaluating magnesium for exercise-associated muscle cramps or disease-state-associated muscle cramps other than a single small study in people with liver cirrhosis.
  • A 2024 systematic review found that supplementation with magnesium decreased muscle soreness, improved performance, and had a protective effect on muscle damage in physically active individuals.

When to Seek Medical Help

It's important to understand when to get medical help for muscle cramps and soreness. Seek medical attention if your muscle cramps are:

  • Associated with other symptoms like pain, muscle at rest, or are a recent change in your health.
  • Not improving with over-the-counter supplements like magnesium.
  • Associated with other health symptoms, like restless leg syndrome.

Conclusion

While magnesium is undeniably essential for proper muscle function, the evidence supporting the use of supplemental magnesium to prevent or treat common muscle cramps (nocturnal or exercise-associated) and soreness (DOMS) in individuals without a deficiency is generally weak or inconsistent according to rigorous scientific reviews.

  • There is insufficient high-quality evidence to recommend routine magnesium supplementation for nocturnal leg cramps in the general population, although a potential benefit might exist for pregnancy-related cramps (requiring further confirmation).
  • Evidence for preventing EAMC through magnesium supplementation alone is not strong; factors like hydration, sodium balance, and neuromuscular conditioning appear more critical.
  • Studies on magnesium for reducing DOMS have yielded mixed results, and it is not currently considered a primary evidence-based strategy for muscle soreness management post-exercise.

The most clear benefit of magnesium supplementation for muscle issues arises when correcting an existing deficiency. For most healthy individuals, focusing on a balanced diet rich in magnesium-containing foods is the best initial approach. If persistent cramps or severe soreness are an issue, consulting a healthcare professional to rule out underlying conditions, assess nutritional status, and discuss evidence-based treatment options is advisable before resorting to supplementation.

Read this next: Magnesium 101: Benefits, types, foods & dosage guide

References
  1. Garrison, S. R., et. al. (2011). The effect of magnesium infusion on rest cramps: randomized controlled trial. The journals of gerontology. Series A, Biological sciences and medical sciences, 66(6), 661–666. https://doi.org/10.1093/gerona/glq232
  2. Garrison, S. R., et. al. (2020). Magnesium for skeletal muscle cramps. In: The Cochrane database of systematic reviews, 9(9), CD009402. https://doi.org/10.1002/14651858.CD009402.pub3
  3. Gash, M.C., et. al. Updated 2023. In: StatPearls [Internet]. Treasure Island (FL): StatPearls Publishing; 2025 Jan-. Accessed April 27, 2025 at: https://www.ncbi.nlm.nih.gov/books/NBK537140/
  4. KidsHealth Medical Experts. (2023, January). Leg cramps. KidsHealth. https://kidshealth.org/en/parents/leg-cramps.html
  5. Miller, K.C., et. al. 2010. Exercise-associated muscle cramps: causes, treatment, and prevention. In: Sports Health. DOI: https://doi.org/10.1177/1941738109357299
  6. Miller, K.C., et. al. 2021. An Evidence-Based Review of the Pathophysiology, Treatment, and Prevention of Exercise-Associated Muscle Cramps. In: J Athl Train. DOI: https://doi.org/10.4085/1062-6050-0696.20
  7. Supakatisant, C.,et. al. (2015). Oral magnesium for relief in pregnancy-induced leg cramps: a randomised controlled trial. Maternal & child nutrition, 11(2), 139–145. https://doi.org/10.1111/j.1740-8709.2012.00440.x
  8. Tarsitano, M.G., Quinzi, F., Folino, K. et al. (2022).  Effects of magnesium supplementation on muscle soreness in different type of physical activities: a systematic review. J Transl Med. https://doi.org/10.1186/s12967-024-05434-x