Magnesium is often suggested as a kind of “magic mineral” for things like cramps, headaches (especially migraines), and mood issues. There is evidence that it helps in some cases—but it's not a cure-all. Let’s examine what science says, where it helps most, and what to watch out for.
The Basics: What Magnesium Does in the Body
Magnesium is involved in hundreds of biochemical reactions: energy (ATP) production; nerve signal transmission; muscle contraction and relaxation; regulation of blood sugar; maintaining bone health; and more.
Because it’s so central, when magnesium levels drop, it can contribute to muscle hyperexcitability, nerve irritability, and perhaps mood dysregulation. But “low magnesium” isn’t always clearly defined—serum magnesium doesn’t always reflect what’s happening inside cells—and many trials use different forms of magnesium, dosages, and populations. So results vary.
Sources of Magnesium

To get enough magnesium, diet is important. Foods rich in magnesium include:
-
Leafy greens (spinach, Swiss chard)
-
Nuts and seeds (almonds, pumpkin seeds)
-
Whole grains like brown rice, quinoa
-
Legumes (beans, lentils)
-
Dark chocolate
Supplements are another route, especially when diet falls short. But different forms (oxide, citrate, bisglycinate, etc.) have different absorption and side-effect profiles.
What the Research Says: Cramps, Headaches, Mood Swings
Here are key findings based on human clinical studies and meta-analyses. Not everything is settled; some evidence is strong, some weak or mixed.
Magnesium & Cramps
Pregnancy-induced leg cramps:
-
A randomized, double-blind, placebo-controlled trial studied 86 pregnant women (14-34 weeks) who had leg cramps ≥2 times weekly. They took 300 mg/day of magnesium bisglycinate chelate for 4 weeks. Results: ~86% of women in the magnesium group achieved a 50% reduction in cramp frequency vs ~60% in placebo. Intensity also dropped more in the magnesium group.
-
However, there are conflicting findings: another trial found no significant reduction in frequency of leg cramps during pregnancy when magnesium citrate was given. So the benefit may depend on the form of magnesium, baseline deficiency, or other factors.
Nocturnal leg cramps in adults (non-pregnancy):
-
A study tested magnesium oxide monohydrate 226 mg at bedtime for 60 days vs placebo, in adults with nocturnal leg cramps. It found improvements in frequency, duration, and severity of cramps, improved sleep, and quality-of-life scores in the magnesium group.
-
But many studies have mixed methodology; absorption, the severity of cramps, and individual nutrition status likely influence outcomes.
Magnesium & Headaches / Migraines
There is stronger evidence here, though again with caveats.
-
A systematic review found Grade C evidence that oral magnesium (especially magnesium citrate, ~600 mg) may reduce the number of migraine attacks versus placebo in some RCTs. It’s not uniformly strong, but promising.
-
A meta-analysis considered both intravenous and oral magnesium in migraine treatment or prevention. It concluded that IV magnesium has significant benefit for acute migraine relief, and oral magnesium helps reduce migraine frequency and intensity.
-
More recently, research from 2025 has gathered accumulating evidence of links between magnesium deficiency and both acute and chronic migraine conditions. Lower magnesium levels (in serum, saliva, erythrocytes, etc.) are observed among migraineurs.
So, for migraines, magnesium looks like a reasonable supplement to consider, especially if someone’s levels are low or if other triggers are in play.
Magnesium & Mood Swings, Anxiety, etc.
The link between magnesium and mood is less direct, though there are some signals:
-
Studies show magnesium plays a part in neurotransmitter activity (e.g. NMDA receptors, serotonin). If someone has low magnesium, nervous system excitability can increase, possibly contributing to anxiety or mood instability.
-
Some trials report improvements in depressive or anxiety symptoms in people with mild-to-moderate symptoms when supplementing with magnesium—but often when part of multi-nutrient or lifestyle interventions. The challenge is isolating the effect of magnesium alone.
-
Evidence isn’t strong enough to say magnesium reliably prevents mood swings, but it may modestly help, especially if the person has a deficiency or multiple risk factors (stress, poor diet, etc.).
What We Don’t Know (or Are Less Sure About)
-
Uniform effectiveness for cramps outside pregnancy: While some adult trials (non-pregnancy) show benefit, many do not, or show only marginal improvements. The form of magnesium, dose, timing, and baseline status matter.
-
Dosage / Form Standardization: There’s no universal consensus on which form (oxide, citrate, bisglycinate, etc.) or dose works best for a given symptom. Some forms absorb better but may cost more.
-
Long-term safety at higher intakes: Magnesium from food is very safe; however, high supplemental magnesium (especially in people with kidney issues) can lead to side effects (diarrhea, abdomen discomfort, electrolyte imbalances).
-
Serum vs Cellular Magnesium: Blood levels don’t always reflect what matters inside cells or in the brain. So a “normal” blood test doesn’t guarantee “sufficient” function.
How to Use Magnesium Responsibly: What Works Best
Here are what studies suggest as best practices if considering magnesium for cramps, migraines, or mood:
-
Check your baseline
-
Assess diet: are you eating magnesium-rich foods?
-
Consider whether you have risk factors for low magnesium (e.g. use of certain diuretics, gastrointestinal issues, poor diet).
-
-
Choose an absorbable form
-
Forms like citrate, bisglycinate tend to be better tolerated/absorbed than magnesium oxide in many individuals.
-
Some studies used magnesium bisglycinate chelate and magnesium oxide monohydrate with positive results.
-
-
Dose and timing
-
For cramps (especially nocturnal leg cramps), taking magnesium in evening or bedtime seems effective in several trials.
-
For migraine prevention, ~600 mg of magnesium (e.g. magnesium citrate) per day has been used in trials.
-
-
Consistency over time
-
Effects often take weeks to emerge (many studies are 4–12 weeks).
-
Regular supplementation plus diet is more reliable than occasional use.
-
-
Watch for side effects and interactions
-
High doses can cause gastrointestinal upset (diarrhea, cramping).
-
Magnesium supplements can interact with some medications (e.g. certain antibiotics, drugs that affect kidney function). If you have kidney issues, talk to a doctor before high doses.
-
-
Combine with lifestyle
-
Adequate hydration, stretching, regular sleep, stress reduction, avoiding triggers (for migraine) amplify potential benefits.
-
For cramps: stretching, staying active, correcting any electrolyte imbalance helps.
-
Practical Suggestions: What to Try If You Have These Symptoms
| Symptom | Suggested Magnesium Approach | What to Expect / Considerations |
|---|---|---|
| Nighttime leg cramps | Try ~200-400 mg of a well-absorbed form at bedtime (e.g., bisglycinate or oxide monohydrate), for 4–8 weeks. Pair with stretching routines. | May see reduced frequency and intensity. If no effect, possible non-magnesium causes (dehydration, electrolyte issues). |
| Migraines / Headache prevention | Try magnesium citrate, around 600 mg/day, or supplement as per RCT protocols. Monitor changes in frequency, severity over several weeks. | May reduce attacks modestly. Not as strong as full medical migraine therapy but useful adjunct. |
| Mood swings / Anxiety | If you suspect deficiency (poor diet, GI losses, medication-use), try moderate supplemental magnesium + diet rich in whole foods. | Effects usually mild to moderate. If depressed mood or anxiety is severe, should be seen with other treatments. |
Bottom Line
Magnesium can help with certain cramps, headaches (especially migraines), possibly some mood symptoms — but it’s not guaranteed. The strength of benefit depends a lot on who you are, how deficient you might be, the form and dose of magnesium, and whether you’re combining it with other healthy practices.
If you’re experiencing frequent cramps, migraines, or mood swings, exploring magnesium (food + supplement) is reasonable. But always check in with a healthcare professional if symptoms are severe or persistent, or if you have underlying health issues (especially kidney disease).