A runner on a track bends down to hold their calf, which appears red and irritated.

Using Magnesium for Muscle Cramps: What You Need to Know

Dec 26, 2025 Rebecca Taylor

Anyone who’s had muscle cramps knows how painful they can be. You can get them during physical activity, while you’re asleep, or for no apparent reason, so they’re often unexpected as much as they’re uncomfortable. One remedy that can help is magnesium.

This essential mineral plays an important role in muscle function, and its supplementation is commonly recommended for people experiencing muscle and leg cramps. Below, we’ll explore:

  • Benefits of magnesium for muscle cramps
  • Different types of magnesium
  • Best ways to incorporate magnesium into your routine
  • What you need to know before using magnesium

What Is Magnesium?

Let’s geek out for a moment: Magnesium is an essential mineral involved in over 300 biochemical reactions in the body. It helps with:

  • Muscle contraction
  • Nerve transmission
  • Blood sugar control
  • Bone health

Despite its importance, research published in Cureus found that magnesium deficiency is very common. Furthermore, a 2018 study in Open Heart revealed magnesium deficiency affects around 8% of the population. The study also showed that 20% of women between the ages of 18 and 22 are deficient in magnesium.

We need magnesium for proper nerve function and muscle relaxation. This makes it particularly important for people who experience muscle cramps – especially if your cramps are caused by exercise, pregnancy, deficiency, or a medical condition, like Crohn's disease and celiac disease.

Should You Try Magnesium For Muscle Cramps?

If you suffer from muscle cramps, particularly night leg cramps or muscle spasms, magnesium supplementation can help relieve them. This is because magnesium helps regulate muscle contraction and function, and low magnesium levels may lead to cramps.

Additionally, a 2017 study published in Nutrients linked magnesium to improved muscle function during exercise, which is helpful for people experiencing exercise-associated muscle cramps.

If you’re considering magnesium for cramps, you need to make sure you’re using the right form of magnesium and taking the right dose. Fear not, geeks! We’ll walk you through everything you need to know below.

Types of Magnesium You Can Take for Cramps

There are many types of magnesium compounds used in dietary supplements, each with different absorption rates and health effects. Here’s a look at the most common ones:

Magnesium Glycinate (Bisglycinate)

This type of magnesium is one of the most common options, and it has excellent absorption. It's also very gentle on the stomach, making it great for long-term use. Our Magnesium Glycinate 3-in-1 is designed to support:

  • Muscle relaxation
  • Better sleep quality
  • Energy production
  • Overall well-being

The body easily absorbs magnesium glycinate, making it less likely to cause digestive discomfort compared to other forms of magnesium.

Magnesium Malate

People who struggle with muscle cramps (especially athletes) often choose magnesium malate because it has high absorption and contains malic acid, which is part of the Krebs cycle. This is the cycle where your body breaks down and releases energy. Magnesium malate helps with symptoms like muscle pain and restless legs, which can both lead to leg cramps.

Magnesium Citrate

You might use this form of magnesium to treat leg cramps, but it’s also great for those with magnesium deficiency. This is because one of the symptoms of magnesium deficiency is leg cramps and spasms. Magnesium citrate is highly absorbable and increases the levels of magnesium in the body to reduce the occurrence of cramps and spasms.

Magnesium Sulphate (Epsom Salt)

Better known as Epsom Salt, magnesium sulphate is best used topically as a bath soak to relax the muscles. You can also take Epsom Salt orally, but this normally results in a strong laxative effect and should only be done under medical supervision.

Recommended Levels of Magnesium for Muscle Cramps

The recommended daily intake of magnesium varies by age and gender. According to the National Institutes of Health (NIH), these are the levels needed:

  • Adult women typically require about 310 to 320 milligrams per day
  • Adult men need about 400 to 420 milligrams per day
  • Pregnant women may need around 350 to 400 milligrams per day

For people experiencing muscle cramps or those at higher risk for magnesium deficiency, supplementation can ensure you’re getting enough.

Foods That Contain Magnesium

Another way to get magnesium is through your diet. Several foods are excellent sources of magnesium and can help you achieve the recommended daily intake without the need for supplementation. Here are some magnesium-rich foods to include in your meals:

Dark Leafy Greens

Dark leafy greens, such as spinach, kale, collard greens, and Swiss chard, are some of the best sources of magnesium. These vegetables are rich in magnesium and provide important vitamins, minerals, and fibre. Including a variety of dark leafy greens in your diet can support muscle health and overall well-being.

Bananas

Bananas are well-known for their potassium content, but they’re also a good source of magnesium. Eating a banana daily can help support muscle function and reduce the chances of cramps.

Avocados

Avocados are nutrient-dense and provide a healthy dose of magnesium. They’re also rich in healthy fats, which are great for your overall health.

Sweet Potatoes

Sweet potatoes are another excellent source of magnesium. They’re versatile and you can include them in a variety of dishes, from baked fries to casseroles.

Melons

Melons, such as cantaloupe and watermelon, offer a good amount of magnesium. Their high water content can also help with muscle hydration, which is important for preventing cramps.

Lentils and Beans

Lentils and beans are great plant-based sources of magnesium. They’re also rich in fibre and protein, making them an ideal choice for those looking to improve their muscle health and overall nutrition.

A muscular man uses a cable machine in a gym, performing a chest exercise while sweating.

What Science Says About Magnesium for Muscle Cramps

A study published in Cochrane Database of Systematic Reviews found that magnesium supplementation was effective for treating:

  • Muscle cramps
  • Nocturnal leg cramps
  • Exercise-associated muscle cramps
  • Skeletal muscle cramps

Research published in Nutrients suggested that magnesium may help alleviate cramps by supporting muscle function, improving nerve transmission, and balancing electrolytes.

A randomised controlled trial published in the Italian Journal of Pediatrics found that oral magnesium supplementation can reduce the frequency of nocturnal leg cramps in adults, particularly in older individuals. Another study published in Maternal & Child Nutrition concluded that magnesium sulfate therapy may help reduce the severity of muscle spasms, such as those experienced during pregnancy-associated leg cramps.

More research is needed to understand the precise mechanisms behind magnesium’s effectiveness. However, there’s sufficient evidence to support its role in treating muscle cramps, particularly for individuals who have low magnesium levels.

Things to Consider Before Taking Magnesium

Before starting magnesium supplementation, it’s important to consider a few factors:

Magnesium Deficiency

If you’re magnesium-deficient, supplementation may be the solution for your needs. Symptoms of magnesium deficiency can include:

  • Muscle cramps
  • Fatigue
  • Weakness
  • Irregular heartbeat
  • Anxiety
  • Irritation and irritability
  • Headaches

Health Conditions

Certain health conditions, such as kidney disease, may interfere with your ability to safely take magnesium supplements. Consult your healthcare provider before starting magnesium therapy, particularly if you have any preexisting conditions.

Medications

Some medications, such as diuretics and antibiotics, can affect magnesium levels. If you're on any medications, discuss possible interactions with your doctor.

Forms of Magnesium

Magnesium supplements come in various forms, including:

  • Magnesium glycinate
  • Magnesium oxide
  • Magnesium malate
  • Magnesium citrate

Each form has different absorption rates and potential side effects. Magnesium glycinate is often recommended for those with sensitive stomachs, as it’s gentler on the digestive system.

Other Muscle Cramp Treatment and Prevention Tips

While magnesium can help alleviate muscle cramps, there are other methods to consider as well. Incorporating these approaches helps prevent and treat muscle cramps:

Stretching

Regular stretching helps prevent muscle cramps by improving flexibility and reducing muscle tension. Stretching before and after exercise also prepares your muscles for physical activity and reduces the risk of cramps.

Hydration

Dehydration is a common cause of muscle cramps. Try to drink more water as a way to reduce cramps. Drinking water throughout the day and eating hydrating foods like fruits and vegetables can support muscle health.

Massage

A gentle massage relaxes your muscles and relieves the discomfort caused by cramps. Massage therapy improves blood flow and reduces the severity of cramping episodes.

Heat or Ice

Applying heat or ice to a cramped muscle is great for immediate relief. Heat helps to relax tight muscles, while ice reduces inflammation and numbs the pain. You’ll need to experiment with both options to find what works best for you.

An older man sits on a running track holding his knee in pain after an apparent injury.

Frequently Asked Questions

Which Form of Magnesium Is Best for Muscle Cramps?

Magnesium glycinate is ideal for muscle cramps because it’s highly absorbable and gentler on the stomach compared to other forms like magnesium oxide. It’s also typically the best choice to reduce muscle cramps with minimal side effects.

Can Kids Take Magnesium for Cramps?

Yes, children can take magnesium for cramps, but the dosage should be appropriate for their age and size. It’s important to consult your paediatrician before giving magnesium supplements to your children.

In most cases, magnesium supplements should only be used for cramps in children if recommended by a healthcare provider. For children, magnesium-rich foods like bananas, avocados, beans, and leafy greens help prevent muscle cramps.

What Type of Magnesium Should Pregnant Women Use for Leg Cramps?

Many doctors recommend magnesium supplementation for pregnant women experiencing leg cramps, which are common during pregnancy. Most people prefer magnesium glycinate because it’s gentle on the digestive system and is highly absorbable. However, always consult a healthcare provider before taking magnesium supplements during pregnancy to ensure it’s safe for you and your baby.

When Is the Best Time to Take Magnesium for Leg Cramps?

The best time to take magnesium for leg cramps is in the evening, especially if you’re dealing with nocturnal leg cramps. Magnesium helps relax your muscles so you can sleep better. We recommend taking it 30 minutes to an hour before bed. However, if you're taking magnesium to support muscle function throughout the day, you can take it with meals.

Is It Better to Take Magnesium Citrate or Magnesium Glycinate?

Both magnesium citrate and magnesium glycinate have their benefits. The body absorbs magnesium citrate well, and it can help relieve constipation, but it may cause digestive upset in some people.

Magnesium glycinate is highly absorbable and gentler on the stomach, making it an excellent choice for muscle cramps and overall magnesium supplementation without digestive issues. If you have a sensitive stomach, magnesium glycinate is the better option.

Who Should Not Take Magnesium?

People with kidney disease or severe kidney dysfunction should avoid magnesium supplementation or use it cautiously, as the kidneys process magnesium. Additionally, individuals on certain medications, like diuretics or antibiotics, should consult a healthcare provider before taking magnesium supplements. 

Pregnant or breastfeeding women should also seek medical advice before starting magnesium supplementation, although doctors generally consider magnesium safe for most pregnant women.

What Food Is Highest in Magnesium?

The foods highest in magnesium include:

  • Leafy green vegetables, especially spinach
  • Nuts, like almonds
  • Seeds, such as pumpkin seeds
  • Legumes, particularly black beans
  • Whole grains

If you’re looking to increase your magnesium intake naturally, these foods are a great way to meet your needs. Dark chocolate is also a magnesium-rich food, though you should eat it in moderation due to its calorie content.

Conclusion

Magnesium is a powerful mineral that plays an important role in muscle function. Magnesium supplementation may offer significant benefits if you’re dealing with:

  • Exercise-associated muscle cramps
  • Nocturnal leg cramps
  • Muscle spasms
  • Restless legs syndrome

In addition to magnesium, other strategies, such as stretching, hydration, heat or ice therapy, and massage, can support muscle health and reduce the risk of cramps. If you’re experiencing persistent or severe cramps, consult your healthcare provider for personalised advice.

References

  • DiNicolantonio, J. J., O’Keefe, J. H., & Wilson, W. (2018). Subclinical magnesium deficiency: a principal driver of cardiovascular disease and a public health crisis. Open Heart, 5(1), e000668.
  • Garrison, S. R., Korownyk, C. S., Kolber, M. R., Allan, G. M., Musini, V. M., Sekhon, R. K., & Dugré, N. (2020). Magnesium for skeletal muscle cramps. Cochrane Database of Systematic Reviews, 9(9).
  • Kirkland, A., Sarlo, G., & Holton, K. (2018). The Role of Magnesium in Neurological Disorders. Nutrients, 10(6), 730.
  • Kothari, M., Anil Wanjari, Shaikh, S. M., Parav Tantia, Waghmare, B. V., Avinash Parepalli, Hamdulay, K. F., & Manikanta Nelakuditi. (2024). A Comprehensive Review on Understanding Magnesium Disorders: Pathophysiology, Clinical Manifestations, and Management Strategies. Cureus.
  • Moretti, A. (2021). What is the role of magnesium for skeletal muscle cramps? A Cochrane Review summary with commentary. Journal of Musculoskeletal & Neuronal Interactions, 21(1), 1.
  • National Institutes of Health. (2021, March 22). Office of Dietary Supplements - Magnesium. NIH.
  • Supakatisant, C., & Phupong, V. (2012). Oral magnesium for relief in pregnancy-induced leg cramps: a randomised controlled trial. Maternal & Child Nutrition, 11(2), 139–145.
  • Zhang, Y., Xun, P., Wang, R., Mao, L., & He, K. (2017). Can Magnesium Enhance Exercise Performance? Nutrients, 9(9), 946.

More articles

Comments (0)

There are no comments for this article. Be the first one to leave a message!

Leave a comment

Please note: comments must be approved before they are published