BiomaLearnFoodsNutrition factsNutrientsGuidesAnswersEvidence

Does magnesium help with headaches and migraines?

For preventing migraine, probably a little, at doses above the upper limit for supplements. A 2025 meta-analysis of 22 trials of dietary supplements found magnesium cut migraine attacks by about 2.51 a month and migraine days by 1.66 against control, and its abstract gives no confidence intervals. A 2026 network meta-analysis of 14 supplement trials in 791 adults found a drop of 0.82 attacks a month that did not reach significance (95% CI -2.03 to 0.13). In the same analysis severity fell by 3.56 points on a 0 to 10 scale (95% CI -6.50 to -0.52), from only a few studies. For an attack already under way, magnesium given into a vein in hospital has mixed results.

Unsettled. Every review we found points the same way for migraine prevention, and they disagree on how sure to be. An umbrella review of 16 meta-analyses rated the evidence for fewer and milder migraine relapses as strong by GRADE, with evidence up to 2018. The 2026 network meta-analysis, which came later, found the effect on attack frequency not significant. A 2018 systematic review of 5 placebo-controlled trials called magnesium possibly effective, its Grade C. The trials are small and the best ones disagree with each other.

Two trials, magnesium and placebo side by side, in percent
020406080100Drop in attacks, magnesium81 adults, weeks 9 to 12, 600 mg a day41.6Drop in attacks, magnesium: 41.6 percent (95% CI 41.6 to 41.6)Drop in attacks, placebosame trial15.8Drop in attacks, placebo: 15.8 percent (95% CI 15.8 to 15.8)Treatment success, magnesium1028 adults in emergency care, infusion78.9Treatment success, magnesium: 78.9 percent (95% CI 78.9 to 78.9)Treatment success, placebosame trial, all given paracetamol65.1Treatment success, placebo: 65.1 percent (95% CI 65.1 to 65.1)Side effects, magnesiumsame emergency trial15.4Side effects, magnesium: 15.4 percent (95% CI 15.4 to 15.4)Side effects, placebosame emergency trial11.1Side effects, placebo: 11.1 percent (95% CI 11.1 to 11.1)

The first pair is the fall in attack frequency from baseline in a prevention trial with tablets. The other pairs come from one emergency department trial of a magnesium infusion. Its gap in success was 13.8 points (95% CI 8 to 19), and every pain score gap stayed below the threshold the authors count as clinically important. No intervals are drawn for single arms because the abstracts do not give them. Sources: cards ev-mgha-10 and ev-mgha-13 below.

What the trials found

Preventing migraine with tablets

A 2016 meta-analysis of 10 trials in 789 people found oral magnesium lowered the odds of frequent migraine (odds ratio 0.20) and of intense migraine (0.27). Some of those trials used inadequate randomization. The abstract gives no intervals and no baseline rate, so we cannot turn those odds into how many people out of 100 would benefit. These are odds, which run larger than risks when the outcome is common.

The single trials explain why the reviews hedge. In a 12-week trial of 81 adults with migraine, 600 mg of magnesium a day as trimagnesium dicitrate cut attacks by 41.6 percent from baseline in weeks 9 to 12, against 15.8 percent on placebo. That dose is above the 350 mg upper limit for supplements. A second trial from the same year, in 69 adults with migraine without aura, was stopped early at an interim analysis. On 10 mmol twice a day, 28.6 percent responded, against 29.4 percent on placebo. An older summary on our magnesium pages puts it as three of four small short trials finding modest reductions at up to 600 mg a day.

The 2026 network meta-analysis compared magnesium with coenzyme Q10, probiotics and vitamins. Magnesium had the largest drop in severity, 3.56 points on a 10-point scale, and the authors say the size and stability of that benefit still need confirmation. In a 3-month trial of 222 adults with at least four attacks a month, magnesium alone did less than the drug valproate. Adding magnesium to valproate did better than valproate alone on severity, duration and painkiller use. That trial had no placebo arm and ran in one center.

In 118 children aged 3 to 17 with weekly migrainous headache, magnesium oxide at 9 mg per kg a day for 16 weeks lowered severity. Headache days fell over time on magnesium, and the fall did not clearly beat placebo (P = .88 for the difference between the two slopes). Of the children, 27 per cent dropped out.

Stopping an attack with an infusion

This is a hospital treatment, given into a vein, and it says nothing about a tablet at home. The same 2016 meta-analysis pooled 11 trials in 948 people and found an infusion relieved an acute migraine within 15 to 45 minutes (odds ratio 0.23), at 120 minutes (0.20) and at 24 hours (0.25). A 2014 meta-analysis limited to 5 double-blind trials in 295 adults found no extra relief at 30 minutes (risk difference -0.07, 95% CI -0.23 to 0.09), with comparators that included active drugs such as metoclopramide. A review of 7 emergency department trials in 545 adults found pain eased more with magnesium at 60 to 120 minutes and not earlier. Those trials differed too much to pool.

The largest trial came in 2026. In 1028 adults with headache in the emergency department, all given 1 g of paracetamol by mouth, adding 2 g of magnesium by infusion raised treatment success to 78.9 per cent from 65.1 percent. Rescue painkillers were needed by 7.1 percent against 15.3 percent. Every gap in pain scores was below the 1.3-point threshold for clinical importance.

Who should be careful

Not for everyone. The NIH says the typical dose of magnesium used for migraine prevention exceeds the upper limit, so it should be taken only under the direction and supervision of a health care provider. The upper limit for magnesium from supplements is 350 mg a day for adults, and 65 to 350 mg for children and teenagers by age. Magnesium from food does not count toward it. The adult migraine trials here used up to 600 mg a day.

The common cost is in the gut. In the 81-person trial, 18.6 percent of people on magnesium got diarrhea and 4.7 percent stomach irritation. In the 69-person trial, mild side effects such as soft stools and diarrhea reached 45.7 percent on magnesium against 23.5 percent on placebo. Infusions carry their own. In the 2014 meta-analysis side effects were 37 percentage points more common with magnesium (95% CI 6 to 68), and in the 2026 emergency trial they reached 15.4 percent against 11.1 per cent (difference 4.3, 95% CI 0.1 to 8.4).

The NIH warns that the risk of magnesium toxicity rises with impaired kidney function or kidney failure, because the body can no longer clear the excess. The emergency trials excluded people with kidney impairment. Anyone with kidney disease should treat high-dose magnesium as a question for the person treating them.

Unsettled. Pregnancy is where the sources split. A 2021 systematic review of headache treatment in pregnancy listed oral magnesium among treatments that may be associated with adverse effects in the baby, on low to moderate strength of evidence. A 2026 European Headache Federation consensus called magnesium generally safe in pregnancy and while breastfeeding, as an expert view where data are lacking. Neither is a trial of migraine prevention in pregnant women.

What expert bodies say

In 2012 the American Academy of Neurology and the American Headache Society rated magnesium as probably effective for migraine prevention, their Level B, on evidence reviewed up to May 2009. The same year the Canadian Headache Society gave magnesium citrate a strong recommendation for preventing episodic migraine, one of 11 preventive treatments to get one. The NIH Office of Dietary Supplements still cites the American guideline and adds the warning about supervision above. Both guidelines predate the 2026 network meta-analysis, and we found no newer position from either society that we could read in full.

How we searched

Searched: a local copy of PubMed, queried on 6 October 2026 for magnesium with migraine, headache or cephalalgia (185 hits, top 100 read by title, 21 abstracts read in full). We also searched the NIH Office of Dietary Supplements fact sheet, the local copy of the ClinicalTrials.gov registry and the web for newer meta-analyses, headache society statements and the FDA warning on magnesium sulfate in pregnancy. Every source with a PubMed record was checked in Retraction Watch. None was retracted.

Included: six syntheses of randomized trials, an umbrella review, five randomized trials, three guidelines or consensus statements, a review of harms in pregnancy and three NIH passages, cited below.

Excluded: a network meta-analysis of preventive drugs that tested magnesium only together with valproate, smaller single trials already pooled in the syntheses, combination products, and magnesium for cluster headache, mountain sickness and brain hemorrhage. A 2025 meta-analysis found on the web came from a journal we could not verify and is not used.

What we read: abstracts, with each quotation checked against the abstract text, the full results section of the 2026 network meta-analysis, and the NIH fact sheet sections.

What we could not get: the full texts of the 2025 and 2016 meta-analyses, so their intervals and certainty ratings are unseen. The 2021 American Headache Society update and its 2024 review of supplements reached us only through secondary summaries. We found the 2013 FDA warning on long use of magnesium sulfate infusions in pregnancy and could not confirm its wording a second time, so it is not on this page.

What would change this answer

How much magnesium you need and where it comes from in food is in the magnesium guide. Whether it helps you sleep has its own evidence page.

The rest of the nutrient, in one place. Magnesium: widely under-eaten, and widely over-promised → What it does, how much you need, who runs short, and what too much does, with the evidence level shown on every line.

More questions about this food

The full guide

Sources

  1. ev-mgha-01 · Meta-analysis or systematic review · systematic review and dose-response meta-analysis of RCTs · n = 22 trials
    Magnesium supplementation reduced migraine attacks (mean difference (MD) = -2.51), severity (MD = -0.88), and the monthly migraine days (MD = -1.66) compared with the control group.
    Who: adults with migraine in randomized controlled trials of dietary supplements
    Effect: attack frequency MD -2.51; severity MD -0.88; monthly migraine days MD -1.66 (confidence intervals not given in the abstract)
    Certainty: GRADE used by the authors; full text not in PMC, so intervals and certainty per outcome not seen.
    Neurol Sci, 2025 · checked 2026-10-06 · we read the abstract
  2. ev-mgha-02 · Meta-analysis or systematic review · network meta-analysis of RCTs with trial sequential analysis · n = 791
    Magnesium showed non-significant benefits (MD = -0.82, 95% CI - 2.03 to 0.13), and no active supplements differed statistically from each other.
    Who: adult migraineurs in 14 randomized controlled trials of nutritional supplements, 8 to 24 weeks
    Effect: migraine frequency MD -0.82 attacks/month (95% CI -2.03 to 0.13) vs placebo
    Certainty: CINeMA graded most comparisons moderate; network star-shaped, most comparisons indirect.
    Front Nutr, 2026 · checked 2026-10-06 · we read the abstract
  3. ev-mgha-03 · Meta-analysis or systematic review · network meta-analysis of RCTs · n = 13 trials
    Compared with control, magnesium showed the largest reduction in migraine severity (MD = −3.56 points, 95% CI: −6.50 to −0.52), followed by coenzyme Q10 (MD = −1.21 points, 95% CI: −2.61 to 0.21), probiotics (MD = −0.98 points, 95% CI: −3.03 to 1.27), vitamin plus probiotics (MD = −0.87 points, 95% CI: −3.64 to 1.94), and vitamins (MD = −0.60 points, 95% CI: −1.95 to 0.69; Figure 4C).
    Who: adult migraineurs in 13 randomized trials reporting severity on a 10-point visual analog scale
    Effect: severity MD -3.56 points on 0-10 VAS (95% CI -6.50 to -0.52); 85% probability of ranking first
    Certainty: Few contributing studies; the authors say the size and stability of the benefit need confirmation.
    Front Nutr, 2026 · checked 2026-10-06 · we read the fulltext
  4. ev-mgha-04 · Meta-analysis or systematic review · meta-analysis of RCTs · n = 789
    Oral magnesium significantly alleviated the frequency and intensity of migraine (ORs = 0.20 and 0.27).
    Who: people with migraine in 10 randomized controlled trials of oral magnesium prophylaxis
    Effect: frequency OR 0.20; intensity OR 0.27 (confidence intervals not given in the abstract)
    Certainty: Some included trials used inadequate randomization; odds ratios, not risks.
    Pain Physician, 2016 · checked 2026-10-06 · we read the abstract
  5. ev-mgha-05 · Meta-analysis or systematic review · meta-analysis of RCTs · n = 948
    Intravenous magnesium significantly relieved acute migraine within 15 - 45 minutes, 120 minutes, and 24 hours after the initial infusion (Odd ratios [ORs] = 0.23, 0.20, and 0.25, respectively).
    Who: people with acute migraine in 11 randomized controlled trials of intravenous magnesium
    Effect: OR 0.23 at 15 to 45 min, 0.20 at 120 min, 0.25 at 24 h
    Certainty: Conflicts with the 2014 meta-analysis of double-blind trials only (ev-mgha-06).
    Pain Physician, 2016 · checked 2026-10-06 · we read the abstract
  6. ev-mgha-06 · Meta-analysis or systematic review · meta-analysis of double-blind RCTs · n = 295
    The percentage of patients who experienced side-effects or adverse events was greater in the magnesium groups compared with controls by 37% (pooled risk difference=0.370, 95% CI=0.06-0.68).
    Who: adults with acute migraine in 5 double-blind randomized trials
    Effect: headache relief at 30 min risk difference -0.07 (95% CI -0.23 to 0.09); adverse events risk difference +0.37 (0.06 to 0.68)
    Certainty: Small pooled sample; comparators included active drugs such as metoclopramide.
    Eur J Emerg Med, 2014 · checked 2026-10-06 · we read the abstract
  7. ev-mgha-07 · Meta-analysis or systematic review · umbrella review of systematic reviews and meta-analyses · n = 16 meta-analyses
    A strong evidence for decreased need for hospitalization in pregnancy and for decreased risk of frequency and intensity of migraine relapses in people with migraine was observed using the GRADE assessment.
    Who: people with migraine in meta-analyses of RCTs of magnesium against placebo or no treatment
    Effect: strong evidence (random-effects p<0.005 and high GRADE) for fewer and milder migraine relapses
    Certainty: Rates the evidence base up to 2018; later NMA 2026 found frequency effect non-significant.
    Eur J Nutr, 2020 · checked 2026-10-06 · we read the abstract
  8. ev-mgha-08 · Meta-analysis or systematic review · systematic review of RCTs without meta-analysis · n = 5 trials
    This systematic review provides Grade C (possibly effective) evidence for prevention of migraine with magnesium.
    Who: migraineurs aged 18 to 65 in randomized double-blind placebo-controlled trials, 1990 to 2016
    Effect: one of two Class I trials and two of three Class III trials positive; Grade C (possibly effective)
    Certainty: Not registered; rated with the American Academy of Neurology scheme.
    Headache, 2018 · checked 2026-10-06 · we read the abstract
  9. ev-mgha-09 · Meta-analysis or systematic review · systematic review of RCTs, meta-analysis not performed · n = 545
    Pain intensity was improved with magnesium sulfate vs comparators at 60-120 minutes, but not at earlier time points.
    Who: adults with non-traumatic headache, mostly migraine, treated in emergency departments
    Effect: pain intensity improved at 60 to 120 minutes vs comparators; no pooled estimate (heterogeneity)
    Certainty: Clinically heterogeneous trials; no firm conclusion by the authors.
    Headache, 2019 · checked 2026-10-06 · we read the abstract
  10. ev-mgha-10 · Randomized controlled trial(s) · multicentre double-blind placebo-controlled randomized trial, 12 weeks · n = 81
    In weeks 9-12 the attack frequency was reduced by 41.6% in the magnesium group and by 15.8% in the placebo group compared to the baseline (p < 0.05).
    Who: 81 patients aged 18 to 65 with IHS migraine, mean 3.6 attacks a month
    Effect: attack frequency weeks 9-12: -41.6% magnesium vs -15.8% placebo (p<0.05); diarrhea 18.6%, gastric irritation 4.7%
    Certainty: Dose 600 mg trimagnesium dicitrate, above the 350 mg UL for supplements.
    Cephalalgia, 1996 · checked 2026-10-06 · we read the abstract
  11. ev-mgha-11 · Randomized controlled trial(s) · multicentre double-blind placebo-controlled randomized trial, 12 weeks · n = 69
    The number of responders was 10 in each group (28.6% under magnesium and 29.4% under placebo).
    Who: 69 patients aged 18 to 64 with 2 to 6 migraine attacks a month without aura, interim analysis
    Effect: responders 28.6% magnesium vs 29.4% placebo; mild adverse events such as soft stool and diarrhea 45.7% vs 23.5%
    Certainty: Stopped at interim analysis for futility; dose 10 mmol twice daily.
    Cephalalgia, 1996 · checked 2026-10-06 · we read the abstract
  12. ev-mgha-12 · Randomized controlled trial(s) · randomized double-blind placebo-controlled parallel-group trial, 16 weeks · n = 118
    By intention-to-treat analysis, we found a statistically significant decrease over time in headache frequency in the magnesium oxide group (P =.0037) but not in the placebo group (P =.086), although the slopes of these 2 lines were not statistically significantly different from each other (P =.88).
    Who: 118 children aged 3 to 17 with at least weekly migrainous headache, 7 Kaiser Permanente sites
    Effect: headache days fell over time on magnesium (P=.0037) but slopes vs placebo not different (P=.88); severity lower on magnesium (P=.0029)
    Certainty: Dose 9 mg/kg per day; 27% dropped out; authors call the result not unequivocal.
    Headache, 2003 · checked 2026-10-06 · we read the abstract
  13. ev-mgha-13 · Randomized controlled trial(s) · randomized double-blind placebo-controlled trial · n = 1028
    Success was more frequent in the MgSO4 (78.9 %) versus placebo group (65.1%) (difference 13.8%; 95% confidence interval [CI] 8 to 19); however, all timed numerical rating s̶cale differences were below the 1.3-point accepted threshold for clinical importance.
    Who: adults with acute nontraumatic headache in the emergency department, all given 1 g oral paracetamol
    Effect: success 78.9% vs 65.1% (difference 13.8%, 95% CI 8 to 19); rescue analgesia 7.1% vs 15.3%; adverse events 15.4% vs 11.1% (difference 4.3%, 0.1 to 8.4)
    Certainty: Large trial; pain score differences below 1.3-point clinical threshold.
    Ann Emerg Med, 2026 · checked 2026-10-06 · we read the abstract
  14. ev-mgha-14 · Randomized controlled trial(s) · randomized double-blind parallel-group controlled trial, 3 months · n = 222
    On the other hand, group C could not effectively reduce measured parameters in the patients, compared to groups A and B after 3 months (P < 0.001).
    Who: migraine patients aged 18 to 65 with at least four attacks a month, single center
    Effect: magnesium alone less effective than valproate or the combination after 3 months (P<0.001); combination better than valproate on severity, duration and painkiller use
    Certainty: Active-controlled; no placebo arm; single center.
    J Headache Pain, 2021 · checked 2026-10-06 · we read the abstract
  15. ev-mgha-15 · Position of an expert body · evidence-based practice guideline · n = —
    Fenoprofen, ibuprofen, ketoprofen, naproxen, naproxen sodium, MIG-99 (feverfew), magnesium, riboflavin, and subcutaneous histamine are probably effective for migraine prevention (Level B).
    Who: adults with episodic migraine
    Effect: Level B: probably effective for migraine prevention
    Certainty: Evidence reviewed to May 2009; NIH ODS still cites this guideline.
    Neurology, 2012 · checked 2026-10-06 · we read the abstract
  16. ev-mgha-16 · Position of an expert body · evidence-based practice guideline using GRADE · n = —
    Based on our review, 11 prophylactic drugs received a strong recommendation for use (topiramate, propranolol, nadolol, metoprolol, amitriptyline, gabapentin, candesartan, butterbur, riboflavin, coenzyme Q10, and magnesium citrate) and 6 received a weak recommendation (divalproex sodium, flunarizine, pizotifen, venlafaxine, verapamil, and lisinopril).
    Who: patients with episodic migraine, headache on 14 days a month or fewer
    Effect: strong recommendation for magnesium citrate among 11 prophylactic drugs
    Certainty: Guideline from 2012.
    Can J Neurol Sci, 2012 · checked 2026-10-06 · we read the abstract
  17. ev-mgha-17 · Position of an expert body · agency fact sheet · n = —
    Because the typical dose of magnesium that is used for migraine prevention exceeds the UL, this treatment should be used only under the direction and supervision of a health care provider.
    Who: people using magnesium supplements to prevent migraine
    Effect: typical migraine dose (up to 600 mg/day) exceeds the 350 mg UL for supplemental magnesium
    Certainty: General agency caution.
    NIH Office of Dietary Supplements, Magnesium fact sheet for health professionals · checked 2026-10-06 · we read the section
  18. ev-mgha-18 · Position of an expert body · agency fact sheet · n = —
    The Tolerable Upper Intake Level for supplemental magnesium is 350 mg for adults, and it ranges from 65 to 350 mg for children and adolescents, depending on age.
    Who: Adults; children and adolescents 65 to 350 mg depending on age
    Effect: UL for supplemental magnesium 350 mg/day (adults); food magnesium not counted
    Certainty: Migraine trials used 500 to 600 mg a day, above the UL.
    NIH Office of Dietary Supplements, Magnesium fact sheet for health professionals · checked 2026-10-06 · we read the section
  19. ev-mgha-19 · Position of an expert body · agency fact sheet · n = —
    The risk of magnesium toxicity increases with impaired renal function or kidney failure because the ability to remove excess magnesium is reduced or lost
    Who: People with impaired renal function or kidney failure
    Effect: higher risk of magnesium toxicity
    Certainty: Emergency department trials excluded people with renal impairment.
    NIH Office of Dietary Supplements, Magnesium fact sheet for health professionals · checked 2026-10-06 · we read the section
  20. ev-mgha-20 · Observational data · systematic review of mostly nonrandomised studies and reviews of harms · n = 14185
    Antiepileptics, venlafaxine, tricyclic antidepressants, benzodiazepines, β-blockers, prednisolone, and oral magnesium may be associated with fetal/child adverse effects, but calcium channel blockers and antihistamines may not be (1 single-group study and 11 SRs; low-to-moderate SoE).
    Who: women who are pregnant, trying to conceive, postpartum or breastfeeding with primary headache; harms data from pregnant women regardless of indication
    Effect: oral magnesium may be associated with fetal or child adverse effects; low to moderate strength of evidence
    Certainty: Indirect harms evidence, largely from high-dose obstetric magnesium sulfate.
    Headache, 2021 · checked 2026-10-06 · we read the abstract
  21. ev-mgha-21 · Position of an expert body · systematic review with Delphi consensus statement · n = —
    Expert consensus emphasizes the influence of hormonal transitions on migraine expression across sexes and supports the use of acetaminophen, antiemetics, magnesium, NSAIDs, steroids, beta-blockers, amitriptyline, and calcium channel blockers as generally safe in WOCBP and during pregnancy, although some agents have trimester-specific limitations.
    Who: women of childbearing potential, pregnant and breastfeeding women with migraine
    Effect: expert consensus: magnesium generally safe in pregnancy, with trimester-specific limits for some agents; considered safe during breastfeeding
    Certainty: Expert consensus where data are lacking; disagrees with 33433020 on pregnancy safety.
    J Headache Pain, 2026 · checked 2026-10-06 · we read the abstract
  22. mg-08 · Randomized controlled trial(s)
    Three out of four small, short-term, placebo-controlled trials found modest reductions in the frequency of migraines in patients who were given up to 600 mg/day magnesium.
    Who: people with migraine
    Effect: modest reduction in frequency
    NIH Office of Dietary Supplements, Health Professional Fact Sheet: Magnesium · checked 2026-09-15

How this page was made. Evidence was extracted from primary sources into cards, every number was re-checked against the source, and the text was written from those cards. Bioma Learn has no human medical reviewer at this time, and we say so rather than invent one. Methodology. This is information, not medical advice.