provider image
Welcome! You’re in GoodRx for healthcare professionals. Now, you’ll enjoy a streamlined experience created specifically for healthcare professionals.
Skip to main content
HomeWell-beingSupplements and Herbs

Magnesium: Overview and Benefits

Sarah Gupta, MDKatie E. Golden, MD
Written by Sarah Gupta, MD | Reviewed by Katie E. Golden, MD
Updated on August 16, 2023

Key takeaways:

  • Magnesium is a mineral your body needs to function properly. It’s found in many foods and is also available as a dietary supplement. 

  • Taking magnesium supplements may help with migraine prevention, but it’s not clear how well it helps with other health conditions. 

  • Unless your healthcare provider has said otherwise, you probably don’t need to take a magnesium supplement — especially if you eat a wide variety of nutritious foods.

Access savings on related medications

Assorted magnesium rich foods on a black and gray textured background.
Aamulya/iStock via Getty Images

What is magnesium?

Magnesium is a mineral that is vital for your health. It’s one of the most important minerals that your body uses. Your body can’t make magnesium on its own, so you need to get it from an outside source — like food. Once it’s in your body, your kidneys help control the amount of magnesium circulating in your blood. 

Magnesium has many different jobs in your body, including:

  • Helping your nerves and muscles work well

  • Keeping your immune system strong

  • Maintaining a regular, steady heartbeat

  • Regulating your blood pressure

  • Building strong bones

  • Controlling your blood sugar 

  • Making energy and protein

  • Making DNA

Search and compare options

Search is powered by a third party. By clicking a topic in the advertisement above, you agree that you will visit a landing page with search results generated by a third party, and that your personal identifiers and engagement on this page and the landing page may be shared with such third party. GoodRx may receive compensation in relation to your search.

What are the health benefits of taking magnesium supplements?

Researchers are still learning about magnesium and health. There’s some evidence that consuming higher amounts of magnesium might help prevent or treat:

And keep in mind: Even though magnesium is important, magnesium supplements are not recommended by the National Institutes of Health (NIH) for most people — unless your healthcare provider specifically recommends that you take them. 

Magnesium: Sources and supplements

You can get magnesium from three different sources:

  • Food

  • Dietary supplements

  • Certain over-the-counter medications

It’s best to get all of the magnesium you need by eating nutrient-rich foods. Not only are nutritious foods a great way to get magnesium, but they also contain vitamins, fiber, and other healthy minerals. 

Foods that are high in magnesium include:

  • Nuts

  • Seeds

  • Beans 

  • Lentils

  • Soybeans

  • Tofu

  • Dark, leafy greens

  • Whole grains

  • Fortified breakfast cereals

  • Milk 

  • Yogurt

  • Dark chocolate

If you can’t get enough magnesium from foods, your healthcare provider might recommend a magnesium supplement. Magnesium supplements are available as pills, chewable tablets, liquids, or dissolvable powders. Magnesium is also in many multivitamins. 

What type of magnesium should you take?

Most people get enough magnesium from food. But if your healthcare provider has suggested you take a magnesium supplement, there are several different types. The ones most easily absorbed by your body are:

Dissolvable powders are completely absorbed in your gut, while other forms of magnesium are not. 

Magnesium supplement dosing

Your daily recommended amount of magnesium depends on your age and sex. Typical doses are listed in the table below.

Age group

Magnesium dose (mg) 

Children age 1 to 3

80 mg

Children age 4 to 8

130 mg

Children age 9 to 13

240 mg

Female teens age 14 to 18

360 mg

Male teens age 14 to 18

410 mg

Female adults age 19 to 30

310 mg

Male adults age 19 to 30

400 mg

Female adults age 31 and older

320 mg

Male adults age 31 and older

420 mg

Also, keep in mind: If you’re taking magnesium supplements, make sure that you don’t go above the recommended daily maximum. 

The daily maximums for magnesium supplements are listed below.

Age group

Magnesium dose (mg)

Children ages 1 to 3 

65 mg

Children age 4 to 8

110 mg

Children age 9 to 18

350 mg

Adults

350 mg

Notice that these daily maximums are less than the total recommended daily amount. That’s because most people who take a magnesium supplement also get magnesium from the food they eat. 

The magnesium doses used for migraines are usually above the recommended daily maximum of 350 mg for adults.

Should I take a magnesium supplement?

Probably not. Most people get all the magnesium they need from food. But in some cases, your healthcare provider might recommend a dietary supplement if your magnesium levels are too low

Low magnesium levels are more common in people who:

  • Are older

  • Have inflammatory bowel disease

  • Have had part of their intestines surgically removed

  • Are on a gluten-free diet

  • Have Type 2 diabetes

  • Drink a lot of alcohol

  • Take certain medications

Magnesium supplement interactions

Magnesium supplements can potentially affect how your body absorbs certain medications when you take them around the same time. Your healthcare provider may advise you to separate your magnesium and medication doses by a few hours to avoid this interaction.

Examples of these medications include:

Certain medications can affect magnesium levels in your body. If you’re taking any of these medications long term, your healthcare provider may want to monitor your levels.

Examples include:

The examples listed above do not include all potential interactions with magnesium. 

Magnesium supplement side effects

Most commonly, high doses of magnesium supplements can cause diarrhea. In fact, magnesium-containing laxatives (such as milk of magnesia) use this effect to help with constipation. Nausea and abdominal cramping can also happen with higher doses.

If your recommended dose is causing these side effects and they become bothersome, talk to your healthcare provider or pharmacist.

Safety of magnesium supplements

Magnesium toxicity can happen if you’re taking very large doses of magnesium. This is when the magnesium levels in your blood are too high. High magnesium levels may be more likely if you have kidney problems. As mentioned above, your kidneys help remove extra magnesium from your body.

Early symptoms of high magnesium levels can include:

  • Dizzy or lightheaded feeling (sign of low blood pressure)

  • Flushed skin

  • Nausea

  • Vomiting

  • Difficulty urinating

  • Fatigue

If you’re experiencing any of these symptoms, contact your healthcare provider right away. 

The symptoms listed above can progress into more serious ones, including:

  • Difficulty breathing

  • Muscle weakness

  • Feeling like you’re going to pass out

  • Fast or irregular heartbeat

If you’re experiencing any of these symptoms, get immediate medical attention. In some cases, they can progress to cardiac arrest (when your heart suddenly stops beating).

FAQs

Is it OK to take vitamin D and magnesium supplements together?

Yes. In fact, magnesium is needed to activate vitamin D in your body. If you’re considering taking both vitamin D and magnesium, talk to your healthcare provider about how they work together. Remember: Both vitamin D and magnesium can have different side effects and can interfere with other medications you may be taking.

Is it OK to take magnesium supplements every day?

According to the NIH, you should not take magnesium supplements every day — unless specifically directed to do so by your healthcare provider. It’s best to get all the magnesium you need through food and beverages. 

Does magnesium help you sleep?

It’s not clear. So far, most of the studies on sleep and magnesium have had mixed results — including research on restless leg syndrome. If you’re having trouble sleeping, talk to your healthcare provider about whether magnesium might be right for you. They can also help you understand other strategies for getting good sleep, like therapy, medications, and lifestyle changes. 

Disclaimer: The FDA does not test supplements for safety and effectiveness. Supplements can contain harmful substances. They can also affect how your medications work. Always speak with your healthcare provider before taking any supplement.

why trust our exports reliability shield

Why trust our experts?

Sarah Gupta, MD
Written by:
Sarah Gupta, MD
Sarah Gupta, MD, is a licensed physician with a special interest in mental health, sex and gender, eating disorders, and the human microbiome. She is currently board certified by the American Board of Psychiatry and Neurology.
Samvida Patel, MNSP, INHC
Samvida Patel, MNSP, INHC, is a health editor at GoodRx. She is a nutritionist and integrative nutrition health coach with over 8 years of experience in health communications.
Katie E. Golden, MD
Katie E. Golden, MD, is a board-certified emergency medicine physician and a medical editor at GoodRx.

References

American Academy of Neurology. (2012). New guidelines on treating migraine press kit.

American Migraine Foundation. (2021). Magnesium and migraine.

View All References (22)

Boyle, N. B., et al. (2017). The effects of magnesium supplementation on subjective anxiety and stress—A systematic review. Nutrients.

Evert, A. B., et al. (2013). Nutrition therapy recommendations for the management of adults with diabetes. Diabetes Care.

Fiorentini, D., et al. (2021). Magnesium: Biochemistry, nutrition, detection, and social impact of diseases linked to its deficiency. Nutrients.

Hindiyeh, N. (n.d.). How do I help my patient choose the right preventive treatment?

Larsson, S. C., et al. (2012). Dietary magnesium intake and risk of stroke: A meta-analysis of prospective studies. The American Journal of Clinical Nutrition.

Marshall, N. S., et al. (2019). Magnesium supplementation for the treatment of restless legs syndrome and periodic limb movement disorder: A systematic review. Sleep Medicine Reviews.

MedlinePlus. (n.d.). Magnesium in diet.

MedlinePlus. (2023). Aspartic acid.

Młyniec, K., et al. (2014). Essential elements in depression and anxiety. Part I. Pharmacological Reports.

National Center for Complementary and Integrative Health. (2023). Vitamins and minerals.

National Institutes of Health, Office of Dietary Supplements. (2020). Magnesium fact sheet for consumers.

National Institutes of Health, Office of Dietary Supplements. (2022). Magnesium - Fact sheet for health professionals.

O’Conner, A. (2021). Can magnesium supplements really help you sleep? The New York Times.

Porri, D., et al. (2021). Effect of magnesium supplementation on women's health and well-being. Nutrition and Food Science Journal

PubChem. (n.d.). Magnesium aspartate tetrahydrate. U.S. National Library of Medicine.

PubChem. (n.d.). Magnesium chloride. U.S. National Library of Medicine.

PubChem. (n.d.). Magnesium lactate. U.S. National Library of Medicine.

U.S. Department of Agriculture and U.S. Department of Health and Human Services. (2020). Dietary guidelines for Americans, 2020 - 2025.

U.S. Department of Agriculture. (2018). Abridged list ordered by nutrient content in household measure.

U.S. Food and Drug Administration. (2022). Questions and answers on dietary supplements.

Uwitonze, A. et al. (2018). Role of magnesium in vitamin D activation and function. Journal of Osteopathic Medicine.

Welch, A. A., et al. (2017). Dietary magnesium may be protective for aging of bone and skeletal muscle in middle and younger older age men and women: Cross-sectional findings from the UK Biobank Cohort. Nutrients.

GoodRx Health has strict sourcing policies and relies on primary sources such as medical organizations, governmental agencies, academic institutions, and peer-reviewed scientific journals. Learn more about how we ensure our content is accurate, thorough, and unbiased by reading our editorial guidelines.

Was this page helpful?

Simple Tips to Eat Healthier

Sign up for our GoodRx Diet and Nutrition Newsletter to receive the latest healthy eating advice, recipes, and savings that are most relevant to you.

By signing up, I agree to GoodRx's Terms and Privacy Policy, and to receive marketing messages from GoodRx.