Magnesium is one of the most important minerals in the body, yet it often gets overlooked. It is involved in more than 300 enzyme reactions, from making energy and protein to controlling muscle and nerve signals, blood sugar and blood pressure. Surveys suggest that around half of Americans eat less magnesium than recommended. So what is magnesium good for, and do you need a supplement? The answer depends on your diet, health conditions and what you hope to improve.

This guide covers 12 evidence-based benefits, how much you need, signs of deficiency, the best food sources, the different supplement forms and how to take magnesium safely.
Key takeaways
- Magnesium supports muscle and nerve function, heart rhythm, bone health, energy production and blood sugar control.
- Evidence supports magnesium for migraine prevention, constipation, and modest reductions in blood pressure.
- Adults need about 310 to 420 mg a day; many people fall short.
- Nuts, seeds, beans, whole grains and leafy greens are the best food sources.
- The upper limit for supplements is 350 mg a day for adults unless a doctor advises more.
What is magnesium good for in the body?
About 50 to 60 percent of the body’s magnesium is stored in bones, with most of the rest inside cells of muscles and soft tissues. Less than 1 percent is in the blood. Magnesium helps produce ATP, the energy molecule cells use, and is needed for DNA and protein synthesis. It regulates the movement of calcium and potassium across cell membranes, which is essential for nerve signals, muscle contraction and a normal heartbeat. It also plays a role in insulin signaling and vitamin D activation.

What is magnesium good for? 12 benefits
1. Muscle function and cramps
Magnesium helps muscles relax after contracting. Severe deficiency causes cramps and spasms. However, reviews show magnesium supplements do not reliably prevent ordinary leg cramps in older adults, though they may help pregnancy-related cramps in some studies.
2. Heart rhythm
Magnesium helps maintain a steady heartbeat. Low magnesium is linked to arrhythmias, and doctors give IV magnesium for some rhythm problems.
3. Blood pressure
Meta-analyses show magnesium supplements can lower blood pressure by about 2 mmHg systolic on average, with larger effects in people with low magnesium or high blood pressure.
4. Blood sugar and type 2 diabetes
Higher magnesium intake is linked to a lower risk of type 2 diabetes in large observational studies. Supplements may improve insulin sensitivity and fasting glucose in people who are deficient.
5. Bone health
Magnesium is part of bone structure and helps regulate calcium and vitamin D. Higher intakes are associated with greater bone mineral density.
6. Migraine prevention
People with migraines often have lower magnesium levels. The American Academy of Neurology and American Headache Society list magnesium as “probably effective” for migraine prevention, typically 400 to 600 mg daily.
7. Constipation
Magnesium citrate, oxide and hydroxide draw water into the bowel and are effective laxatives. See magnesium citrate for constipation.
8. Sleep
Small trials, particularly in older adults, suggest magnesium may improve sleep quality, especially in people who are low. Read about taking magnesium at night.
9. Mood and anxiety
Some studies suggest magnesium may help mild anxiety and depression, but evidence is limited and of mixed quality.
10. PMS symptoms
Small studies suggest magnesium, sometimes with vitamin B6, may reduce bloating, mood changes and breast tenderness before periods.
11. Heartburn and indigestion
Magnesium hydroxide and carbonate are used in antacids to neutralize stomach acid.
12. Exercise performance and recovery
Magnesium is needed for energy production and muscle function. Supplements may help people who are deficient but have little effect on performance in those with adequate levels.
How much magnesium do you need?
| Age | Men | Women |
|---|---|---|
| 14–18 years | 410 mg | 360 mg |
| 19–30 years | 400 mg | 310 mg |
| 31+ years | 420 mg | 320 mg |
| Pregnancy (19–30 / 31+) | — | 350 / 360 mg |
| Supplement upper limit (adults) | 350 mg | 350 mg |
These are U.S. Recommended Dietary Allowances from the National Academy of Medicine. The upper limit applies only to supplements and medicines, not food.
Best food sources of magnesium
| Food | Serving | Magnesium (approx.) |
|---|---|---|
| Pumpkin seeds, roasted | 1 oz (28 g) | 156 mg |
| Chia seeds | 1 oz | 111 mg |
| Almonds, dry roasted | 1 oz | 80 mg |
| Spinach, boiled | Half cup | 78 mg |
| Cashews | 1 oz | 74 mg |
| Peanuts | Quarter cup | 63 mg |
| Shredded wheat cereal | 2 biscuits | 61 mg |
| Soy milk | 1 cup | 61 mg |
| Black beans, cooked | Half cup | 60 mg |
| Edamame | Half cup | 50 mg |
| Dark chocolate (70–85%) | 1 oz | About 65 mg |
| Brown rice, cooked | Half cup | 42 mg |
| Avocado | Half cup cubed | 22 mg |
| Banana | 1 medium | 32 mg |

Signs of low magnesium
- Fatigue and weakness.
- Loss of appetite, nausea.
- Muscle cramps, twitching or tremors.
- Numbness and tingling.
- Abnormal heart rhythms.
- Low calcium or potassium that is hard to correct.
People at higher risk include those with type 2 diabetes, gut disorders such as Crohn or celiac disease, alcohol use disorder, older adults, and those taking proton pump inhibitors or diuretics long term.
Magnesium supplement forms
| Form | Best for | Notes |
|---|---|---|
| Glycinate | Sleep, sensitive stomachs | Well absorbed, gentle |
| Citrate | General use, constipation | Well absorbed; mild laxative |
| Oxide | Constipation, heartburn | Poorly absorbed; strong laxative |
| Chloride | General use | Good absorption |
| L-threonate | Marketed for brain health | More expensive; limited human data |
| Malate | General use | Often marketed for energy and fibromyalgia |
See our comparison of magnesium glycinate vs bisglycinate.
Safety and interactions
Too much magnesium from supplements causes diarrhea, nausea and cramping. Serious toxicity is rare but can occur in people with kidney disease. Magnesium can interfere with absorption of some antibiotics, bisphosphonates and thyroid medicine, so separate doses by a few hours. Learn more in can you take too much magnesium.
What is magnesium good for in older adults?
Magnesium absorption from the gut tends to decline with age, while kidney losses can increase, and older adults are more likely to take medicines that lower magnesium, such as diuretics and acid reducers. Low magnesium in older people is linked to weaker bones, muscle cramps, poor sleep and higher blood pressure. A diet rich in nuts, seeds, whole grains and greens is the first step. Supplements may help if levels are low, but kidney function should be checked first because older kidneys clear magnesium less efficiently.
What is magnesium good for in athletes?
Intense exercise increases magnesium losses through sweat and urine. Athletes with low intake may experience muscle cramps, fatigue and slower recovery. Most athletes can meet their needs from food, especially with plenty of whole grains, beans, nuts and leafy greens. Supplements are most useful when blood tests or diet records show a shortfall.
Magnesium myths
- “Everyone is deficient.” Many people eat less than recommended, but true deficiency with symptoms is less common.
- “Epsom salt baths raise magnesium levels.” Skin absorption is minimal; baths may relax you but are not a reliable supplement.
- “More is better.” Doses above 350 mg from supplements often cause diarrhea, and excess can be dangerous with kidney disease.
- “Magnesium cures anxiety and insomnia.” It may help modestly, especially if you are low, but it is not a cure.
Understanding what is magnesium good for, and what it is not, helps you decide whether to focus on food or consider a supplement.
Related guides
- Magnesium Glycinate vs Bisglycinate
- Taking Magnesium at Night
- Can You Take Too Much Magnesium?
- Magnesium Citrate for Constipation
- How Much Potassium Per Day
Frequently asked questions
What is magnesium good for in women?
Magnesium may help PMS symptoms, migraines, sleep and bone health, and needs rise in pregnancy.
Should I take magnesium in the morning or at night?
Either works. Many people take it at night for sleep; consistency matters more than timing.
Can magnesium help anxiety?
Some studies suggest a small benefit, especially in people who are low, but evidence is limited.
How long does magnesium take to work?
Laxative effects occur within hours; benefits for sleep or migraines may take several weeks.
Who should not take magnesium?
People with kidney disease, heart block or myasthenia gravis should ask a doctor first.
What is magnesium good for in the skin?
Topical magnesium has little evidence. Most benefits come from adequate intake through food or supplements.
Medical disclaimer: This article is for general information and is not a substitute for advice from your doctor or another qualified health professional. See our medical disclaimer and editorial policy.