Additional menu

Magnesium for leg cramps? (18 foods)

Written by John Davis

Last updated: October 10, 2022

Nocturnal leg cramps are extremely painful and annoying. The recurrent, painful tightening of the calf muscles can result in severe insomnia. Up to 60% of the adult population and 7% of children report that they’ve had terrible leg cramps. (1, 2, 3)

Cramps are often attributed to multiple systemic disorders, including neuromuscular diseases and metabolic disorders(4). They can also arise from electrolyte imbalance in the body, such as hypomagnesemia–a condition characterized by low magnesium levels (5). 

Magnesium Consumption

Magnesium is the fourth most abundant electrolyte in the body, after calcium, sodium, and potassium. The mineral plays a role in over 300 biochemical reactions in the body.(6)

It helps maintain normal blood pressure and bone health and supports digestive function. Magnesium also supports nerve function, muscle contraction, and energy metabolism.(7)

Sadly, it’s estimated that between 56% and 68% of American adults do not acquire enough magnesium from their diets to meet the recommended daily allowance(RDA). (8)

Can Magnesium Help With Leg Cramps? 

Anecdotally, magnesium supplementation helps some people. Magnesium supplements are often marketed as potential remedies for painful leg cramps in Europe and Latin America. 

However, most, if not all, clinical studies on magnesium’s effectiveness in treating cramps remain inconclusive. A 2017 randomized clinical trial on 94 subjects showed no significant improvements when using magnesium oxide tablets for night cramps compared to a placebo. (9

A frequently cited review of seven randomized trials in 2013 found that magnesium supplements don’t appear to ease conditions of the general population. The study identified slight positive improvements for pregnant women. (10)

Where’s The Catch?

While the benefits of magnesium supplementation remain fairly anecdotal, studies on hypomagnesemia show muscle cramping and twitching are major symptoms of low magnesium levels in the body. 

Magnesium deficiency can lead to secondary hypocalcemia( low calcium levels in the body). Hypocalcemia causes muscle twitching, cramping, tremors, and spasms. (11

Certain groups are at a higher risk of magnesium deficiency. (12) These may include:

  • The elderly
  • People with digestive disorders such as Cron’s or Celiac disease
  • Individuals with a history of alcohol abuse
  • People with type 2 diabetes
  • People with kidney disease

Ensuring that you obtain the recommended dietary allowance for magnesium can help you reduce the risk of muscle spasms and tremors. 

How Much Magnesium Do You Need? 

The amount of magnesium you need may depend on several factors, including age, sex, and overall health. The National Institutes of Health(NIH) recommends 400-420mg daily for men, 310-320mg for women, and 350-360mg for pregnant women. (13

You can meet the recommended daily intake(DV) through the diet. Magnesium supplements are also a safe way to help you meet the RDA. 

20 Magnesium Rich Fruits and Vegetables

How can you ensure that you are getting enough magnesium? Here’s a list of 18 fruits and vegetables rich in this vital mineral. 

1. Dried Figs

Dried figs are often known for their high sugar and calorie content. They are also rich in magnesium, arguably providing the highest DV value of all fruits. 

One cup serving, approximately 150g, of dried figs provides 101.3mg of magnesium. This equates to nearly 24% of the RDA. You may also get your daily supply of dietary fiber, calcium, copper, potassium, and sodium. (14)

You can incorporate dried figs into your diet as a healthy snacking habit. 

2. Edamame

If you are closely watching your calorie intake, edamame( immature soybeans) is the perfect magnesium source. Half a cup of edamame(80g) provides 50mg of magnesium, equivalent to 12% of the DV. (15

You can also benefit from 6g of plant protein and 5g of dietary fiber to fill you up—all these benefits for less than 65 calories. 

You can boil or steam the white, immature soybean pods before adding them to your salad, stew, or noodle dish. You may also season them with salt and eat them as a healthy snack. 

3. Bananas

Bananas are one of the quickest ways to increase magnesium levels. They are easily accessible,  easy to eat, and delicious to boot. 

One cup of sliced bananas(150g) can provide 10% of your daily requirement for magnesium, or approximately 41mg. You can also elevate your potassium, manganese, and phytosterol levels. (16)

You can enjoy the sliced bananas singularly or with a salad. You can also add them to your smoothies for a creamier texture. 

4. Swiss Chard

The Swiss Chard is a leafy, green vegetable that can fall between spinach and kale. It’s not as tender as spinach, yet not as tough as kale. 

A cup serving of the nutritious vegetable(175g) contains 150.5mg of magnesium. This amount is approximately 36% of the DV, making swiss chard one of the best sources of magnesium. (17)

You can include it in your diet by adding it to your baked beans soup, lasagna, or egg frittata. 

5. Blackberries

Blackberries are more popular for their phytonutrients. The phenolic compounds offer protective effects against age-related neurodegenerative diseases(18). 

A cup of blackberries, approximately 140g, provides 27mg of magnesium. This amount is about 6% of the recommended daily allowance. 

Blackberry smoothies are a perfect morning snack. You can also add some blackberries to your salad or pancakes to add flavor. 

6. Potatoes (With Skin)

Potatoes are a universally-loved vegetable that can fit in dozens of recipes and diets. Like most vegetables, they are also rich in magnesium and potassium on the skin and flesh. 

A 175g serving of boiled potatoes with their skin can provide 49mg of magnesium or approximately 12% of the DV. You may also get a healthy amount of dietary fiber, potassium, vitamin C, and vitamin B6. (19

For a healthier diet, you can consider boiled or baked potatoes. You should try to avoid fried potato products. 

7. Raspberries 

Raspberries are often referred to as a ‘superfruit’ due to their incredible nutritional profile. They are one of the best sources of potassium and magnesium. (20)

A cup of raspberries(123g) can provide 27mg of magnesium, or 7% of the recommended daily intake. You can also receive 36% of the DV for manganese from the same serving. (21)

Raspberries are a popular ingredient in homemade jellies, syrups, and jams. You can also add them to your smoothies or vegetable salads for additional flavor. 

8. Okra

Okra, popularly identified as lady’s finger or gumbo, is a nutrient-dense vegetable that should make into your daily diet. 

Half a cup of cooked and sliced okra(80g) contains approximately 28.8mg of magnesium, about 7% of DV.  The vegetable is also rich in iron, zinc, folate, vitamin C, and manganese. (22)

You can easily add Okra into your diet by steaming or sauteing them in a small amount of olive oil. You can add your favorite spices to vary the taste profile. 

9. Cantaloupes

Cantaloupe is a tasty and healthy fruit that’s more popular in summer. The melon has a high water content alongside a range of key vitamins, minerals, and antioxidants. 

One cup serving of approximately 177g has 21.2mg of magnesium or 21% of the DV. The fruit is also rich in vitamin C, potassium, beta-carotene, and folate. (23)

Cantaloupes are delicious, whether alone or within a fruit salad. You can add them to your morning smoothie for a refreshing, healthy drink during a hot day. 

10. Spinach 

Spinach is an extremely nutrient-dense vegetable. It’s often regarded as a superfood with health benefits cutting across almost all bodily functions. (24

One cup(180g) serving of spinach provides 156.6mg of magnesium, ranking as the highest best source among the vegetable class. Spinach is also high in dietary fiber, folate, vitamins A, C, K, and multiple phenols. (25)

You can add spinach to your diet, from soups to salads. You can also throw a few leaves into your green smoothie to enrich the nutrient profile. 

11. Grapefruit

Grapefruit is a tropical citrus fruit packed with a range of vital nutrients. One cup of approximately 230g contains 5% of the DV for magnesium or about 20.7mg. (26)

The fruit is also rich in vitamin C, vitamin A, Thiamine, Folate, and Fiber. Grapefruit requires little-to-no preparation, making it an easy addition to your diet. 

You can snack on the slices during the day, blend them into a smoothie or add the pieces to a citrus salad. 

12. Green Bell Pepper

Bell peppers are fruits under the nightshade family, closely related to chili peppers and tomatoes. Green Bell peppers are simply unripe, with a slightly bitter taste than red or yellow peppers. 

One cup of chopped, raw Green Bell Pepper(149g) contains approximately 14.9mg of magnesium. This amount is about 4% of the DV. You may also benefit from the high levels of antioxidants, including vitamin C and Capsaicin. (27)

You can slice and munch Green Bell Peppers in your hummus dressing or salad. Alternatively, you can add slices to your soups and stews. 

13. Papayas

Papaya is a versatile tropical fruit that can become a perfect companion on your journey to a healthier you. 

One cup of chopped papaya(145g) contains approximately 30.5mg of magnesium, 7% of the DV. The same serving is enough to satisfy your daily recommended allowance of vitamin C, availing nearly 98% of the DV. (28)

You can eat raw papayas as a stand-alone snack or add slices to your salad. You can also add them to your smoothies. 

14. Artichokes

Artichokes have for centuries been used for their medicinal properties. The potential health benefits include lowering blood sugar levels and improving digestion and heart health. (29)

One medium artichoke of approximately 128g contains 76.8mg of magnesium. This amount is about 19% of the DV, making the vegetable one of the best sources of magnesium. (30)

You can add artichokes to your diet as a salad alongside other magnesium-rich veggies and seeds. 

15. Kiwifruit

Kiwi is a nutrient-dense fruit native to China. Its reputation as a health food is tied to its extremely high amounts of vitamin C. However, kiwis are also rich in other nutrients, key among them: magnesium. 

A cup of sliced kiwifruit, approximately 180g, contains 31mg of magnesium, about 7% of the DV. The same serving provides 166mg of vitamin C, or 185% of the recommended daily intake. (31)

You can use a spoon to scoop out the flesh from the kiwifruit as you enjoy it singularly. Additionally, you can include it in your fruit cocktail, smoothies, or salad dressing. 

16. Beetroot

Beetroot is a nutrient-packed root vegetable that enjoys a love-hate relationship across different populations. It’s closely associated with numerous health benefits, including lower blood pressure, improved athletic performance, and improved blood flow. (31,32)

One cup of raw, chopped beetroot(136g) has 31.4g of magnesium, about 8% of the DV. (33) You can add it to your meals by:

  • Adding the chopped slices to your salad
  • Pressing the root beet to produce a nutrient-dense beet juice
  • Roasting the pieces in an oven to get a taste sidedish

You may notice a slight change in the color of your urine, which shouldn’t raise any alarm. 

17. Avocados

Avocados are incredibly delicious and richly packed with numerous vital nutrients. As a superfood, their benefits range from better heart health to stronger immune and neural systems. (34)

One cup of cubed avocado(150g) contains 43.5g of magnesium, nearly 11% of the DV. Furthermore, avocados are also rich in potassium, vitamin C, vitaminB6, folate, and copper. (35)

You can enjoy chopped avocados as a healthy afternoon snack. You may add avocado slices to your salad dressing or blend them into your green smoothie. 

18. Green Peas 

Green Peas are a popular, nutritious vegetable containing a fair amount of minerals, antioxidants, and dietary fiber. Research shows they can help protect against certain chronic illnesses, including heart disease and cancer. 

One cup of cooked Green Peas can provide 62mg of magnesium, about 15% of the DV. They are also rich in vitamins C, A, K, folate, phosphorus, and iron. (36)

You can prepare a Green peas soup to incorporate them into your diet. However, the legume cum vegetable also contains high levels of antinutrients that can induce bloating and gut discomfort. 

Wrapping Up

Magnesium is a critical electrolyte involved in hundreds of enzymatic reactions within the body. Deficiency of this mineral manifests in various ways, including muscle tremors and spasms. 

While scientists can’t yet pin a direct relationship between magnesium and leg cramps, ensuring an adequate amount of the mineral can reduce your risk of experiencing spasms. 

Fortunately, magnesium is readily available in various foods, allowing you to meet the recommended daily allowance easily. Research shows cooking and boiling typically reduce the amount of Magnesium available in foods. (37

Most foods listed above require little to no preparation, allowing you to maximize your magnesium intake. Play around with different recipes and meal plans to get the maximum amount and meet your RDA. 


John Davis