What Vitamins Help With Migraines and How They Work

Several vitamins and supplements have meaningful evidence behind them for reducing migraine frequency, with magnesium and riboflavin (vitamin B2) carrying the strongest support. Others, including CoQ10, vitamin D, and melatonin, show promising results in clinical trials. None of these work overnight: most need at least three months of consistent use before you can fairly judge whether they’re helping.

Magnesium

Magnesium is the most widely recommended supplement for migraine prevention. The American Migraine Foundation notes that magnesium oxide is the form most commonly used, typically at a dose of 400 to 600 mg per day. Low magnesium levels are common in people with migraines, and supplementation appears to reduce both the frequency and severity of attacks.

The main downside of magnesium oxide is that it can cause loose stools or diarrhea, especially at higher doses. Some people tolerate other forms like magnesium glycinate or citrate better, though magnesium oxide remains the most studied form specifically for migraines. Starting at the lower end of the dose range and increasing gradually can help your gut adjust.

Riboflavin (Vitamin B2)

Riboflavin at 400 mg per day is one of the best-studied vitamins for migraine prevention. In a randomized controlled trial published in Neurology, 59% of participants taking riboflavin experienced at least a 50% reduction in migraine frequency, compared to just 15% on placebo. That’s a large and clinically meaningful difference.

The proposed reason it works: migraines may involve a deficit in how your brain cells produce energy. Riboflavin plays a central role in that energy production process, and high doses appear to compensate for the deficit. The supplement is well tolerated, with virtually no side effects beyond turning your urine bright yellow, which is harmless and expected at this dose.

Coenzyme Q10 (CoQ10)

CoQ10 works through a similar energy-production pathway as riboflavin. A double-blind, placebo-controlled study in women with episodic migraine found that 400 mg per day of CoQ10 reduced migraine frequency by about 57%, severity by 47%, and attack duration by 60%. All three improvements were significantly better than what the placebo group experienced.

CoQ10 is generally well tolerated. Some people experience mild stomach upset, but serious side effects are rare. Because CoQ10 and riboflavin both target cellular energy production, some headache specialists recommend trying them together, though research on the combination is limited.

Vitamin D

People with migraines are more likely to have low vitamin D levels, and a large population-based analysis found that those with the highest vitamin D levels had a 16% lower prevalence of severe headache or migraine compared to those with the lowest levels. Multiple clinical investigations suggest that supplementing vitamin D can reduce both the frequency and intensity of attacks, though the evidence isn’t as robust as it is for magnesium or riboflavin.

If you haven’t had your vitamin D level checked recently, it’s worth doing. Correcting a genuine deficiency is straightforward and inexpensive, and the potential benefits extend well beyond migraines.

Melatonin

Melatonin isn’t a vitamin, but it shows up frequently in migraine prevention research and is worth knowing about. A randomized clinical trial compared 3 mg of melatonin at bedtime against amitriptyline, a commonly prescribed migraine preventative. Melatonin reduced migraine frequency by an average of 2.7 days per month (compared to 1.1 for placebo), and a higher percentage of melatonin users achieved at least a 50% reduction in attacks than those on amitriptyline.

The tolerability advantage was notable. Melatonin’s side effect profile was essentially the same as placebo, while amitriptyline caused significantly more adverse events. People in the melatonin group actually lost a small amount of weight, while those on amitriptyline gained. For people who want to avoid prescription side effects, melatonin at 3 mg is a reasonable option to discuss with their provider.

How Long Before They Work

This is where most people get frustrated and give up too early. Clinical trials consistently show that supplements for migraine prevention need at least 12 weeks of daily use before you can expect to see a difference. Some studies have noted improvements as early as 8 weeks, but 3 months is the standard benchmark researchers use to evaluate whether a supplement is working.

Keeping a simple headache diary during this period helps. Track your migraine days per month so you can compare the first month to the third. Without a record, it’s easy to forget how often you were getting attacks before you started.

A Note on Butterbur

Butterbur is an herbal extract that has shown migraine prevention benefits in some studies, but it comes with an important safety caveat. The butterbur plant contains pyrrolizidine alkaloids, substances that can damage the liver and lungs and may cause cancer. The National Institutes of Health states that only butterbur products processed to remove these compounds and labeled or certified as PA-free should be considered. Because PA-free products have become harder to find in some markets, many headache specialists have moved away from recommending butterbur altogether.

What the Guidelines Say

Official treatment guidelines are more cautious than the individual studies might suggest. The 2023 VA/DoD Clinical Practice Guideline for headache management concluded there is “insufficient evidence to recommend for or against” CoQ10, melatonin, riboflavin, or vitamin B6 for headache prevention. That doesn’t mean these supplements don’t work. It means the overall body of evidence hasn’t yet met the high bar these guidelines require, partly because supplement research gets far less funding than pharmaceutical research, and study sizes tend to be smaller.

In practice, many neurologists and headache specialists recommend magnesium and riboflavin as first-line options precisely because they’re inexpensive, safe, and backed by enough trial data to justify trying them before moving to prescription medications. The gap between guideline language and clinical practice reflects the reality that waiting for perfect evidence isn’t always practical when low-risk options are available.

Combining Supplements

Many people with migraines take more than one of these supplements simultaneously. A common starting combination is magnesium (400 mg) plus riboflavin (400 mg) daily, sometimes with CoQ10 (400 mg) added. There are no known dangerous interactions between these supplements, and their mechanisms of action are complementary rather than redundant.

If you’re taking prescription migraine preventatives, check with your pharmacist about potential interactions before adding supplements. Magnesium, for instance, can affect the absorption of certain antibiotics and blood pressure medications if taken at the same time of day.