What Does Magnesium Do in the Body?

Four bowls with pumpkin seeds, almonds, fresh spinach, and black beans.


Last updated: November, 2026

Magnesium helps your cells use energy, your muscles and nerves work together, and your bones develop and maintain their structure. It also plays a part in how your body regulates blood sugar, blood pressure, and normal heart rhythm. You get magnesium from foods such as pumpkin seeds, almonds, spinach, beans, and whole grains. [1]

Key takeaways

  • U.S. recommendations for adults age 19 and older range from 310 to 420 mg per day, depending on age and sex. Pregnancy has separate recommendations.
  • A bowl with cooked black beans, brown rice, and spinach can provide about 180 mg from those three ingredients.
  • The 350 mg daily upper limit for adults applies to magnesium from supplements and medications. Magnesium naturally present in food is outside that limit.
  • Magnesium is essential for normal muscle and nerve function. Research on taking extra magnesium for sleep or cramps answers a different question, and the results depend on the outcome and population studied.

What magnesium does in your body

Helps cells use energy

Your cells use a molecule called adenosine triphosphate, or ATP, to power work such as moving muscles and transporting substances across cell membranes. Many enzymes use ATP in a form bound to magnesium. This is one reason magnesium is involved in energy metabolism throughout the body. Fatigue can have many causes, so feeling tired alone gives little information about your magnesium status. [1, 2]

Supports muscle function, nerve signaling, and heart rhythm

Magnesium helps regulate the movement of charged minerals across cell membranes. Nerves depend on those electrical signals to communicate, and muscles use them to coordinate contractions. This includes the heart muscle, which relies on coordinated electrical activity to beat regularly. [1, 2]

That role helps explain why magnesium is studied for muscle cramps. A Cochrane review found that supplements were unlikely to provide meaningful prevention of common cramps in older adults. The review found no randomized trials on exercise-associated cramps, leaving that question open in the evidence it assessed. [3]

An illustrated motor nerve branches to connect with several skeletal muscle fibers.
Motor nerves send signals that tell muscles to contract. Magnesium helps maintain normal nerve and muscle function.

Contributes to bone structure

Roughly half of the magnesium in an adult body is in the bones. Magnesium contributes to bone structure and participates in processes that regulate calcium and vitamin D. Bone health also depends on factors such as physical activity and an adequate overall diet. [1, 2]

Helps regulate blood sugar and blood pressure

Magnesium is involved in glucose metabolism and in how cells respond to insulin. It also plays a role in the processes that help regulate blood pressure. These are normal functions of the mineral. If you have diabetes or high blood pressure, decisions about supplements belong in the context of your current treatment and medications. [1]

How much magnesium do adults need per day?

The U.S. Recommended Dietary Allowance (RDA) is a daily intake level intended to meet the needs of nearly all healthy people in a given group. It counts magnesium from all sources, including food, beverages, and any supplements you take. [1]

AgeMenWomen
19–30 years400 mg310 mg
31 years and older420 mg320 mg

During pregnancy, the RDA is 350 mg at ages 19–30 and 360 mg at ages 31–50. During breastfeeding, it is 310 mg and 320 mg, respectively. [1]

Think of the RDA as a guide for your usual intake over time. A single day below the recommended amount tells you little about your long-term intake or whether you have a deficiency.

Foods that contain magnesium

Seeds and nuts can supply a substantial amount in a small serving. Beans, cooked greens, and whole grains can add magnesium to meals you already make. The amounts below are approximate. [1]

FoodServingMagnesium
Roasted pumpkin seeds1 oz156 mg
Chia seeds1 oz111 mg
Dry-roasted almonds1 oz80 mg
Boiled spinach½ cup78 mg
Cooked black beans½ cup60 mg
Cooked brown rice½ cup42 mg

For a simple lunch, combine ½ cup black beans, ½ cup brown rice, and ½ cup cooked spinach. Together, they provide about 180 mg of magnesium. Add lemon, olive oil, or your usual seasonings. If you prefer a snack, an ounce of dry-roasted almonds provides about 80 mg. [1]

A bowl with separate portions of cooked black beans, brown rice, and spinach.
Half a cup each of cooked black beans, brown rice, and spinach provides about 180 mg of magnesium.




Who is more likely to have low magnesium?

A diet with few nuts, seeds, legumes, whole grains, or leafy greens can make it harder to reach the recommended intake. A low intake estimate and a clinical deficiency are different findings. The kidneys can help conserve magnesium when intake is low, and a clinician can consider diet, medications, health history, and lab results together. [1]

People with certain gastrointestinal conditions, such as Crohn’s disease or celiac disease, may absorb less magnesium. Older adults, people with type 2 diabetes, and people with long-term alcohol dependence are also more likely to have low magnesium. Prolonged use of some acid-reducing medicines called proton pump inhibitors can lower magnesium levels. [1]

Early signs of deficiency can include loss of appetite, nausea, fatigue, and weakness. These symptoms have many possible causes. If they persist, a healthcare professional can help determine whether magnesium or another issue is involved. [1]

Does magnesium help with sleep or stress?

A systematic review of three small trials in older adults with insomnia found that oral magnesium might shorten the time it takes to fall asleep. The reviewers rated the evidence low to very low quality, so it is unclear how reliably the result would apply to other adults or whether it would translate into better sleep overall. [4]

A separate review of studies on self-reported anxiety and stress found suggestive results in some groups, with limitations in study quality. Magnesium’s role in nerve signaling is well established. Whether a supplement helps a particular person sleep better or feel less stressed remains uncertain. [2, 5]

What to know before taking a magnesium supplement

Check the elemental magnesium per serving on the Supplement Facts panel. This is the amount of magnesium the product supplies. Also check how many capsules or tablets make up a serving. If you take a multivitamin, electrolyte product, antacid, or laxative that contains magnesium, include those amounts when tallying supplemental and medication sources. [1]

The adult U.S. upper limit is 350 mg per day from supplements and medications combined. This is a safety reference. The RDA is the separate reference for typical intake from all sources. High supplemental amounts can cause diarrhea, nausea, or abdominal cramping. People with impaired kidney function have a higher risk of magnesium toxicity. Certain antibiotics and oral bisphosphonates can interact with magnesium, so ask a pharmacist or clinician about dose and timing if you take these medicines. [1]

For more on how supplement labels name the different forms, see Different Types of Magnesium Explained. For an example of how to read a label that lists multiple forms together, see our Magnesium Breakthrough Review.

Medical disclaimer

This article is for general education. For advice about persistent symptoms, a medical condition, or whether a supplement is appropriate for you, consult a qualified healthcare professional.

References

  1. National Institutes of Health, Office of Dietary Supplements. Magnesium Fact Sheet for Health Professionals. Accessed November 25, 2026.
  2. de Baaij JHF, Hoenderop JGJ, Bindels RJM. Magnesium in Man: Implications for Health and Disease. Physiological Reviews. 2015.
  3. Garrison SR, et al. Magnesium for Skeletal Muscle Cramps. Cochrane Database of Systematic Reviews. 2020.
  4. Mah J, Pitre T. Oral Magnesium Supplementation for Insomnia in Older Adults: A Systematic Review & Meta-Analysis. BMC Complementary Medicine and Therapies. 2021.
  5. Boyle NB, Lawton C, Dye L. The Effects of Magnesium Supplementation on Subjective Anxiety and Stress: A Systematic Review. Nutrients. 2017.

Leave a Reply

Your email address will not be published. Required fields are marked *