Magnesium rarely gets the attention of vitamins like C or D, but it's quietly essential: it's a cofactor in hundreds of enzyme reactions, from making energy to firing nerves and contracting muscles. Many people get slightly less than recommended, which has made magnesium a popular supplement — though food is the best place to start.

What magnesium does

Magnesium is involved in:

  • Muscle and nerve function, including normal heart rhythm;
  • Energy production from the food you eat;
  • Blood sugar and blood pressure regulation;
  • Bone health (most of the body's magnesium is stored in bone);
  • Making protein and DNA.

How much do you need?

How much do you need?
GroupRecommended daily amount
Adult men~400–420 mg
Adult women~310–320 mg
Pregnancy~350–360 mg

These amounts are readily met through a varied diet, though surveys suggest many people fall a little short of the ideal.

Best food sources

Magnesium is found in many whole foods, especially:

  • Nuts and seeds — pumpkin seeds, almonds, cashews;
  • Leafy greens — spinach, Swiss chard;
  • Whole grains — brown rice, oats, whole-wheat;
  • Legumes — black beans, edamame, lentils;
  • Dark chocolate and bananas.

Eating a range of these usually covers your needs without a supplement.

What the evidence shows for benefits

  • Sleep and relaxation: magnesium may modestly support sleep, and shortfalls are common in people who sleep poorly — see magnesium for menopause.
  • Muscle cramps: evidence is mixed, but correcting a deficiency can help.
  • Migraine: magnesium is used as one preventive option, with reasonable supporting evidence.
  • Blood pressure and blood sugar: adequate intake supports both, especially as part of a healthy diet.
  • Bone health: magnesium works alongside calcium and vitamin D.

Benefits are clearest when you're correcting a shortfall — taking extra when you're already replete offers little.

Signs of low magnesium

True deficiency is uncommon in healthy people but more likely with certain conditions (digestive diseases, type 2 diabetes, alcohol use disorder) or some medications. Early signs can include loss of appetite, nausea, fatigue, and muscle cramps or twitches; severe deficiency can affect heart rhythm.

Supplements: forms, dosage, and safety

  • Forms: magnesium glycinate and citrate are well absorbed and gentle; magnesium oxide is cheaper but more likely to cause loose stools.
  • Dosage: the upper limit for supplemental magnesium is 350 mg a day for adults (separate from food, which doesn't carry the same limit). Stay at or below this unless a clinician advises otherwise.
  • Too much from supplements causes diarrhea, nausea, and cramping; very high doses can be dangerous, especially with kidney problems.
  • Interactions: magnesium can affect the absorption of some medicines (such as certain antibiotics and osteoporosis drugs) — space them apart and check with a pharmacist.

Magnesium and specific health concerns

Magnesium is studied for several conditions, with varying strength of evidence:

  • Migraine: magnesium is one recognized preventive option, with reasonable evidence, sometimes recommended for people with frequent migraines.
  • Blood pressure: adequate magnesium supports healthy blood pressure, especially as part of an overall good diet, though supplements have only a modest effect.
  • Type 2 diabetes: higher dietary magnesium is associated with better blood-sugar control and lower diabetes risk.
  • Constipation: certain forms (like magnesium citrate or hydroxide) draw water into the bowel and are used as laxatives — which is also why oxide causes loose stools.
  • Stress and PMS: often marketed for these, but the evidence is limited; correcting a genuine shortfall is more likely to help than topping up when you're already replete.

How to choose and take a supplement

If you and your clinician decide a supplement makes sense, a few pointers help:

  • Form: magnesium glycinate and citrate are well absorbed and gentle on the stomach; oxide is cheap but poorly absorbed and more likely to loosen stools.
  • Quality: choose products with third-party testing (a USP or NSF mark) in a loosely regulated market.
  • Timing: it can be taken with food to reduce stomach upset; some people take it in the evening for its relaxing effect.
  • Dose sensibly: stay at or below the 350 mg/day supplemental upper limit unless a clinician advises more, and split doses if higher amounts upset your stomach.

Who is most likely to be low

Healthy people eating a varied diet rarely become deficient, but the risk rises with digestive disorders (such as Crohn's or celiac disease, which impair absorption), type 2 diabetes, alcohol use disorder, older age, and some medications — including long-term proton-pump inhibitors (acid reducers) and certain diuretics. If you fall into one of these groups and have symptoms like cramps, fatigue, or palpitations, ask your clinician whether your magnesium should be checked.

When to seek medical care

Talk to a doctor before taking magnesium supplements if you have kidney disease (which impairs magnesium clearance), take regular medications, or have symptoms you think may be from a deficiency. Persistent muscle cramps, fatigue, or irregular heartbeat should be evaluated rather than self-treated.