Skip to main content

Does magnesium help with headaches and migraines?

Medically reviewed by Kristianne Hannemann, PharmD. Last updated on March 28, 2025.

Official answer

by Drugs.com

Yes, magnesium can help with headaches and migraines. Current scientific evidence suggests a significant relationship between magnesium levels and headache disorders, particularly migraines. Research indicates that magnesium supplementation may serve as an effective preventive treatment for migraines and potentially provide relief during acute attacks.

What is Magnesium?

Magnesium is the fourth most abundant cation in the human body and plays crucial roles in numerous physiological functions, including enzyme activity, neuromuscular excitability, and cell signaling pathways. Its deficiency can occur due to inadequate dietary intake or increased losses through gastrointestinal or renal pathways, potentially contributing to headache vulnerability.

How Does Magnesium Help with Headaches?

People who experience migraines tend to have lower serum magnesium levels compared to those who don't suffer from headaches. Magnesium influences several neurological and vascular mechanisms implicated in headaches:

  • Neurological effects: Magnesium regulates glutamate activity in the brain by blocking N-methyl-D-aspartate (NMDA) receptors, which play a critical role in pain transmission within the nervous system.
  • Vascular and inflammatory effects: Magnesium helps regulate cerebral blood flow and vascular tone, which are often disrupted during migraine attacks. It’s thought to do this by decreasing levels of calcitonin gene-related peptide (CGRP), influencing nitric oxide circulation, and blocking certain potassium channels on smooth muscle cells.

Clinical Evidence: Efficacy of Magnesium in Headache Treatment

Prevention of Migraine

Multiple randomized, double-blind, placebo-controlled trials have evaluated magnesium supplementation for migraine prevention:

  • A systematic review from 2017 provided Grade C (possibly effective) evidence for prevention of migraine with magnesium supplementation.
  • In a study of women with menstrual migraine, 360 mg of magnesium pyrrolidone carboxylic acid taken daily from ovulation to menstruation significantly reduced headache frequency and total pain index.
  • A larger trial with 81 adult migraine patients showed that 600 mg of trimagnesium dicitrate daily reduced attack frequency by 41.6% compared to 15.8% in the placebo group.
  • A study involving 118 children receiving 9 mg/kg daily of magnesium oxide demonstrated significant reduction in headache days.
  • A 2016 meta-analysis of 10 randomized controlled trials on oral magnesium for migraine prophylaxis (involving 789 participants) found that oral magnesium significantly alleviated both the frequency (OR = 0.20) and intensity (OR = 0.27) of migraines.

Treatment of Migraine

Intravenous magnesium has been investigated for treating acute migraine attacks:

  • A meta-analysis of 11 studies (948 participants) found that intravenous magnesium significantly relieved acute migraine within 15-45 minutes (OR = 0.23), 120 minutes (OR = 0.20), and 24 hours (OR = 0.25) after initial infusion.
  • Intravenous magnesium appears most effective in patients with low serum magnesium levels.
  • While some systematic reviews have found varying results regarding immediate benefits after infusion, there appears to be potential for pain control beyond the first hour.

How Much Magnesium Should You Take?

Always consult with your healthcare provider before starting a magnesium supplement. It is possible to take too much, which can lead to side effects.

When used for migraine prevention, the American Headache Society recommends a dose of 400 mg to 500 mg a day of magnesium oxide. Magnesium is available in many forms, and your healthcare provider might recommend a different form or dose of magnesium.

For migraine treatment, 1 gram of magnesium sulfate has been given intravenously. Your healthcare provider can help you determine the best treatment options for your migraine attacks.

Where to Get Magnesium?

While supplementation may be necessary to achieve therapeutic doses, many foods provide significant magnesium:

  • Spinach and other leafy greens
  • Legumes
  • Nuts, especially almonds and cashews
  • Peanut butter
  • Whole grains

Regular consumption of magnesium-rich foods may help maintain adequate levels, though supplements are typically needed to achieve the doses used in clinical studies for headache prevention.

What Are The Side Effects of Magnesium?

Magnesium supplementation is generally considered safe, but can cause mild side effects:

  • Common side effects include diarrhea, nausea, and stomach cramps.
  • These gastrointestinal effects are typically dose-dependent and vary based on the magnesium formulation used.

Magnesium supplements may interact with medications for bone health, infections, and high blood pressure. Share a list of your medications with your healthcare provider before starting a magnesium supplement so they can check for potential interactions.

Summary

The current evidence supports a role for magnesium in both the prevention and treatment of headache disorders, particularly migraines. Multiple clinical trials and meta-analyses demonstrate that magnesium supplementation can reduce the frequency and intensity of migraine attacks, while intravenous magnesium shows promise for acute treatment.

The American Academy of Neurology, American Headache Society, and other international guidelines now include recommendations for magnesium in headache management. With its relatively benign side effect profile, magnesium represents an attractive option for many patients, especially those who prefer non-pharmaceutical approaches or who belong to sensitive populations such as children, pregnant women, and the elderly.

References
  1. American Headache Society. 2021. Incorporating Nutraceuticals for Migraine Prevention. Accessed March 28, 2025 at https://americanheadachesociety.org/news/incorporating-nutraceuticals-for-migraine-prevention
  2. Chiu, H. Y., et. al. 2016. Effects of Intravenous and Oral Magnesium on Reducing Migraine: A Meta-analysis ofRandomized Controlled Trials. In: Pain Physician. PMID: 26752497
  3. Domitrz, I., et. al. 2022. Magnesium as an Important Factor in the Pathogenesis and Treatment of Migraine-From Theory to Practice. In: Nutrients. DOI: https://doi.org/10.3390/nu14051089
  4. Facchinetti F, et. al. 1991. Magnesium prophylaxis of menstrual migraine: effects on intracellular magnesium. In: Headache. DOI: https://doi.org/10.1111/j.1526-4610.1991.hed3105298.x
  5. Maier J. A., et. al. 2020. Headaches and Magnesium: Mechanisms, Bioavailability, Therapeutic Efficacy and Potential Advantage of Magnesium Pidolate. In: Nutrients. DOI: https://doi.org/10.3390/nu12092660
  6. Root, A. W. 2021. Disorders of Mineral Metabolism: Normal Homeostasis. In: Sperling Pediatric Endocrinology (Fifth Edition). DOI: https://doi.org/10.1016/B978-0-323-62520-3.00009-9
  7. von Luckner, A., et. al. 2017. Magnesium in Migraine Prophylaxis—Is There an Evidence-Based Rationale? A Systematic Review. In: Headache: The Journal of Head and Face Pain. DOI: https://doi.org/10.1111/head.13217

Related medical questions

Related support groups