What supplements, such as magnesium (Mg) and vitamin B2 (Riboflavin), can help prevent headaches?

Medical Advisory BoardAll articles are reviewed for accuracy by our Medical Advisory Board
Educational purpose only • Exercise caution as content is pending human review
Article Review Status
Submitted
Under Review
Approved

Last updated: December 13, 2025View editorial policy

Personalize

Help us tailor your experience

Which best describes you? Your choice helps us use language that's most understandable for you.

Supplements for Headache Prevention: Magnesium and Vitamin B2

Magnesium and vitamin B2 (riboflavin) are both recommended supplements for migraine prevention, with magnesium having stronger guideline support and vitamin B2 showing efficacy particularly at 400 mg daily for 3 months. 1, 2

Magnesium for Migraine Prevention

The 2023 VA/DoD guidelines suggest oral magnesium for prevention of episodic migraine, though this carries a weak recommendation based on limited quality evidence rather than lack of efficacy 1, 2. Magnesium represents a reasonable option particularly when first-line preventive agents (such as CGRP monoclonal antibodies or angiotensin-receptor blockers) are contraindicated or poorly tolerated 2, 3.

Dosing and Duration

  • Continue oral magnesium for a minimum of 3 months before assessing efficacy—clinical benefits may not become apparent immediately 2, 3
  • Premature discontinuation is a critical pitfall; allow the full 2-3 month trial period before declaring treatment failure 3

Safety Profile

  • Oral magnesium is extremely well-tolerated with minimal adverse effects 2
  • The most commonly reported side effects are mild gastrointestinal symptoms (nausea, diarrhea), not headaches 4

Position in Treatment Algorithm

  • Magnesium sits among other weak recommendations including topiramate, propranolol, and valproate for episodic migraine prevention 3
  • It ranks below strong recommendations for CGRP antagonists and ARBs 3
  • Consider magnesium as first-line when traditional agents are contraindicated, during pregnancy, in patients with cardiovascular disease, or when seeking a low-cost option 3

Vitamin B2 (Riboflavin) for Migraine Prevention

Daily intake of 400 mg riboflavin for 3 months resulted in more than 50% reduction in migraine attacks in over half of consumers 5. Riboflavin plays a crucial role in mitochondrial energy production, addressing the energy deficit hypothesis in migraine pathophysiology 6, 5.

Clinical Evidence

  • Riboflavin is recommended in decreasing order of preference after magnesium and Petasites hybridus (butterbur) for migraine prevention 7
  • Studies support beneficial effects in controlling migraine headache symptoms through its function in mitochondrial energy metabolism 5
  • The mechanism involves helping convert food into energy and supporting cellular functions essential for preventing migraine attacks 6, 5

Combined Supplementation Approach

A fixed combination of magnesium, vitamin B2, feverfew, coenzyme Q10, and andrographis paniculata showed significant efficacy in a prospective study, with 56.6% of patients achieving ≥50% reduction in monthly migraine days after 3 months 8. The mean number of migraine days decreased from 9.4 to 6.1 per month (p < 0.001) 8.

Additional Supplements with Evidence

  • Coenzyme Q10: Well-known for mitochondrial energy metabolism function; has excellent safety profile with minimal side effects 4, 5
  • Vitamin D and Omega-3: Every 5 ng/ml rise in serum vitamin D was associated with 22% reduction in migraine occurrence 5

Critical Clinical Pitfalls to Avoid

  • Do not discontinue magnesium before 3 months—this is the most common error leading to perceived treatment failure 2, 3
  • Do not use intravenous magnesium routinely for acute migraine—there is insufficient guideline support despite some research evidence 2
  • Non-responders to IV magnesium often have normal or elevated ionized magnesium levels; consider alternative acute treatments (triptans, NSAIDs) in these patients 3
  • Do not expect immediate results—allow 2-3 months at therapeutic dosing before declaring treatment failure 3

Practical Implementation Algorithm

  1. Start with oral magnesium as first-line supplement when traditional preventive medications are contraindicated, poorly tolerated, or patient prefers natural options 2, 3
  2. Add riboflavin 400 mg daily if magnesium alone provides insufficient benefit after 3 months 7, 5
  3. Consider combination supplementation (magnesium + riboflavin + CoQ10) for patients with frequent episodic migraine seeking comprehensive natural prevention 8
  4. Reassess at 3 months minimum—measure reduction in monthly migraine days, headache intensity, and days requiring acute medications 8
  5. Continue indefinitely if effective (≥50% reduction in migraine days), as these supplements have excellent long-term safety profiles 2, 4

References

Guideline

Guideline Directed Topic Overview

Dr.Oracle Medical Advisory Board & Editors, 2025

Guideline

Magnesium for Migraine Prevention and Treatment

Praxis Medical Insights: Practical Summaries of Clinical Guidelines, 2025

Guideline

Magnesium in Migraine Treatment

Praxis Medical Insights: Practical Summaries of Clinical Guidelines, 2025

Guideline

CoQ10 Safety and Efficacy in Headache Prevention

Praxis Medical Insights: Practical Summaries of Clinical Guidelines, 2025

Research

Review on Headache Related to Dietary Supplements.

Current pain and headache reports, 2022

Research

Foods and supplements in the management of migraine headaches.

The Clinical journal of pain, 2009

Professional Medical Disclaimer

This information is intended for healthcare professionals. Any medical decision-making should rely on clinical judgment and independently verified information. The content provided herein does not replace professional discretion and should be considered supplementary to established clinical guidelines. Healthcare providers should verify all information against primary literature and current practice standards before application in patient care. Dr.Oracle assumes no liability for clinical decisions based on this content.

Have a follow-up question?

Our Medical A.I. is used by practicing medical doctors at top research institutions around the world. Ask any follow up question and get world-class guideline-backed answers instantly.