Magnesium For Cramps

Do you suffer from cramps and want to find out more about how to prevent or treat them? If that is so, read this article to learn more about muscle cramps and what magnesium's role is in their prevention and treatment.

A muscle cramp is an involuntary, persistent, and painful contraction of the skeletal muscle fibres that happens suddenly.1 Cramps are most frequent in the calf muscles but can occur in any muscle, including in the feet, thighs or hands.2 They can range in intensity from mild to severe, and can last from a few seconds to several minutes.3 Magnesium is an essential mineral that plays a crucial role in various metabolic reactions in the body, including protein synthesis, energy production and storage, reproduction, DNA and RNA synthesis, and stabilising mitochondrial membranes.4 It is also important for the proper functioning of muscles and nerves, and a deficiency in magnesium can lead to muscle cramps and spasms.1 While some research suggests that magnesium supplements may be effective in reducing muscle cramps and spasms, there is currently no evidence to support that the use of magnesium supplements provides clinical benefits for patients who suffer from muscle cramps.5,6

If you want to learn more about what could be causing your muscle cramps, whether magnesium can be a solution, and other treatments and prevention tips to help to relieve your cramps, keep reading.

What causes cramps?

If you are experiencing frequent or severe muscle cramps that is affecting your quality of life, it is important to speak with a healthcare provider to determine the underlying cause and receive appropriate treatment.2 Muscle cramps can occur as an isolated phenomenon, called idiopathic cramps, or can be associated with other health conditions.1

Most of the time, muscle cramps are idiopathic; however, muscle cramps can be caused by a variety of factors, including:

Muscle fatigue

Cramps can occur when a muscle has been overworked - for example, exercise-associated cramps - or used in an unusual way.7


Not getting enough fluids can lead to muscle cramps, especially if you are engaging in physical activity that causes you to sweat.8

Electrolyte imbalances

Electrolytes, such as sodium, potassium, and magnesium, help regulate muscle function. An imbalance of these electrolytes can lead to muscle cramps.3


Some medications, such as statins and diuretics, can cause muscle cramps as a side effect.2,8

Medical conditions

Certain medical conditions, such as kidney disease, liver disease and hormonal imbalances, like thyroid and parathyroid disorders, can also cause muscle cramps.1

In addition to those causes, factors like advanced age and pregnancy also lead to more frequent episodes of muscle cramps.8

What is the role of magnesium in muscle cramps?

Magnesium is a mineral that is essential for the proper functioning of the body's muscles and nerves.9 It plays a role in muscle contractions and relaxation, and a deficiency in magnesium can contribute to muscle problems. In fact, low levels of magnesium can disrupt the electrolyte balance and lead to muscle cramps and spasms, particularly in people who engage in intense physical activity or who have certain medical conditions that can cause magnesium deficiency.10

Hypomagnesemia, or magnesium deficiency, is characterised by a range of symptoms including muscle contractions, fatigue or weakness, facial muscle twitching, insomnia, constipation, leg cramps, anxiety, and abnormal heart rate. It is important to identify the root cause of magnesium deficiency and start a magnesium supplement to address the deficiency. If left untreated, magnesium deficiency can lead to more serious complications such as high blood pressure, arrhythmias, thrombosis, or stroke.9,11

Does magnesium help prevent cramps?

As mentioned before, magnesium deficiency was proven to contribute to muscle cramps and spasms.12 But, while magnesium supplements are often promoted as a way to prevent or treat muscle cramps, it is important to note that the effectiveness of these supplements in reducing muscle cramps is not well established.6 Some studies have found that magnesium supplements may be beneficial for reducing the frequency and severity of muscle cramps in certain populations, such as pregnant women and people with kidney disease, but more research is needed to confirm these findings.13 Some studies hypothesise that magnesium may work by helping to regulate the activity of calcium and potassium, which are important for muscle function.14  

Should you try magnesium?

Muscle cramps usually resolve on their own, without the need for any type of treatment.3 If you think you have low magnesium levels, increasing the intake can help you prevent muscle cramps.

If you want to try improving your magnesium intake, the first step should always be through natural magnesium-rich foods.9 Some of these foods include:

  • Cooked green leafy vegetables, such as spinach and broccoli
  • Nuts, such as almonds, peanuts, cashews
  • Pumpkin seeds
  • Peanut butter
  • Beans (black, kidney)
  • Soybeans and soy milk
  • White potato with skin
  • Brown rice
  • Oatmeal
  • Salmon
  • Beef
  • Poultry
  • Banana
  • Raisins
  • Dark chocolate (at least 70%)
  • Milk and yoghurt
  • Avocado

Another option is magnesium supplements. As mentioned before, there is no strong evidence that magnesium supplements provide clinical benefits.13 But if you have hypomagnesemia, and you are considering taking a magnesium supplement to help with muscle cramps, it is important to speak with a healthcare provider to determine the appropriate dosage and to make sure it is safe for you.

There are different types of magnesium supplements that can come in a variety of formats, such as powders, tablets, liquids, and capsules.15

 Some of the magnesium supplements available are:

  • Magnesium citrate
  • Magnesium chloride
  • Magnesium lactate
  • Magnesium oxide
  • Magnesium taurate
  • Magnesium aspartate
  • Magnesium sulphate
  • Magnesium malate15

Before starting the magnesium supplement, it is also important to consult your doctor or pharmacist if you suffer from any of these conditions: kidney disease, heart disease, intestinal disease, neuromuscular disease, or allergy to magnesium salts.16

Other treatment and prevention tips

There are several things you can do to help prevent muscle cramps:

Adequate hydration

Drinking plenty of fluids, especially during times of increased physical activity or when it is hot outside, can help prevent muscle cramps.3

Eat a balanced diet

Getting enough nutrients, including electrolytes like sodium, potassium, and magnesium, can help prevent muscle cramps.8

Stretching before and after physical activity

Stretching can help improve muscle flexibility and reduce the risk of cramps.7

Warm up before the physical activity

Warming up before doing exercise, like walking or slow jogging, can prevent getting cramps afterwards.3

If prevention is not enough, and you still end up having muscle cramps, some ways to treat them are:

Heat or cold therapy

Applying heat or cold to the affected muscle can also help to relieve muscle cramps. Heat can help to relax the muscles and increase blood flow to the area, while cold can help to reduce swelling and inflammation.17

Deep massaging

Can help relax the muscle and increase blood flow to the affected area.12

In addition to heat or cold therapy and deep massaging, there are several over-the-counter (OTC) options that may help to relieve muscle cramps. These include:

Oral medications

There are several oral medications that may help to relieve muscle cramps - these include ibuprofen and naproxen. These medications work by reducing inflammation and swelling in the muscles, which can help to relieve cramping.18,19

Topical creams

There are also several topical creams that may be effective in relieving muscle cramps. These include creams containing menthol, which can help provide a cooling sensation, and creams containing capsaicin, which can help to reduce the sense of pain.19,20

If the cramps remain painful, recurrent, and incapacitating, it is important to consult your doctor and consider prescription medication.8


A muscle cramp is an involuntary, persistent, and painful contraction of the skeletal muscle fibres that happens suddenly and can occur in any muscle. If you want to increase your magnesium intake, instead of opting for magnesium supplements, it is generally recommended that people get their nutrients from a balanced diet. Foods that are high in magnesium include nuts, seeds, whole grains, and leafy green vegetables. If you are considering taking a magnesium supplement, it is important to speak with a healthcare provider to determine the appropriate dosage and to make sure it is safe for you. Other ways to prevent and treat muscle cramps include, staying hydrated, eating a balanced diet, stretching before and after physical activity, heat or cold therapy, deep massaging, or over-the-counter and prescription medicine.


  1. Moretti A. What is the role of magnesium for skeletal muscle cramps? A Cochrane Review summary with commentary. J Musculoskelet Neuronal Interact [Internet].
  2. Leg cramps causes and treatment [Internet].
  3. Bordoni B, Sugumar K, Varacallo M. Muscle cramps. Em: StatPearls [Internet].
  4. Volpe SL. Magnesium in disease prevention and overall health12. Adv Nutr [Internet].
  5. Barna O, Lohoida P, Holovchenko Y, Bazylevych A, Velychko V, Hovbakh I, et al. A randomized, double-blind, placebo-controlled, multicenter study assessing the efficacy of magnesium oxide monohydrate in the treatment of nocturnal leg cramps. Nutrition Journal [Internet].
  6. Garrison SR, Korownyk CS, Kolber MR, Allan GM, Musini VM, Sekhon RK, et al. Magnesium for skeletal muscle cramps. Cochrane Database of Systematic Reviews [Internet].
  7. Jahic D, Begic E. Exercise-associated muscle cramp-doubts about the cause. Mater Sociomed [Internet].
  8. Muscle cramps [Internet]. Practical Neurology.
  9. Boston 677 Huntington Avenue, Ma 02115 +1495‑1000. Magnesium [Internet]. The Nutrition Source.
  10. Gröber U, Schmidt J, Kisters K. Magnesium in prevention and therapy. Nutrients [Internet].
  11. What you need to know about magnesium: benefits and risks [Internet]. The Amino Company.
  12. PracticePromotions. Massage therapy for muscle spasms and cramps - the fit institute [Internet]. The Fit Institute, Chicago. 2018
  13. Magnesium, a treatment for leg cramps? [Internet]. NPS Medicinewise. 2014.
  14. Mathew AA, Panonnummal R. ‘Magnesium’-the master cation-as a drug—possibilities and evidences. Biometals [Internet].
  15. Magnesium dosage for children [Internet]. LIVESTRONG.COM.
  16. Aboutkidshealth [Internet]. [citado 16 de dezembro de 2022].
  17. Ice packs vs. Warm compresses for pain [Internet]. 2021
  18. Nsaids [Internet]. 2017 [citado 23 de dezembro de 2022].
  19. 9 best treatments for muscle cramps [Internet]. Prevention. 2017
  20. Topical relief for muscle pain [Internet]. Verywell Health.
This content is purely informational and isn’t medical guidance. It shouldn’t replace professional medical counsel. Always consult your physician regarding treatment risks and benefits. See our editorial standards for more details.

Get our health newsletter

Get daily health and wellness advice from our medical team.
Your privacy is important to us. Any information you provide to this website may be placed by us on our servers. If you do not agree do not provide the information.

Joana Carneiro

Masters of Public Health - Escola Nacional de Saúde Pública, Lisboa

Joana is a recent graduate, who has a Degree in Biomedical Sciences and a Master's Degree in Public Health. She has more than two years of experience working as a healthcare professional in both private and public settings and more than 4 years of experience working as a volunteer in a non-profit organization, helping disadvantaged communities. Joana is passionate about public health, specifically about everything related to health education, health communication and health equity.

Leave a Reply

Your email address will not be published. Required fields are marked * presents all health information in line with our terms and conditions. It is essential to understand that the medical information available on our platform is not intended to substitute the relationship between a patient and their physician or doctor, as well as any medical guidance they offer. Always consult with a healthcare professional before making any decisions based on the information found on our website.
Klarity is a citizen-centric health data management platform that enables citizens to securely access, control and share their own health data. Klarity Health Library aims to provide clear and evidence-based health and wellness related informative articles. 
Klarity / Managed Self Ltd
Alum House
5 Alum Chine Road
Westbourne Bournemouth BH4 8DT
VAT Number: 362 5758 74
Company Number: 10696687

Phone Number:

 +44 20 3239 9818