Several nutrient deficiencies are linked to migraines, but the strongest evidence points to magnesium, vitamin B2 (riboflavin), vitamin B12, folate, and vitamin D. Low levels of these nutrients don’t just correlate with migraine diagnosis; they appear to directly fuel the biological mechanisms that trigger attacks. People with chronic migraine (15 or more headache days per month) are especially likely to be deficient in one or more of them.
Magnesium: The Most Studied Link
Magnesium is involved in nerve signaling, blood vessel regulation, and controlling how excitable your brain cells are. When magnesium drops too low, neurons become hyperexcitable, meaning they fire more easily and in response to smaller triggers. This sets the stage for a phenomenon called cortical spreading depression, a slow wave of intense electrical activity across the brain’s surface that is the main driver behind migraine aura and, likely, the pain phase that follows. Magnesium helps block the receptor (NMDA) that allows calcium to flood into nerve cells and kick off this cascade. Without enough magnesium acting as a brake, the cascade starts more easily.
Studies consistently find that people with migraines have lower magnesium levels than people without them, and that levels drop even further during an active attack. In one controlled trial, 600 mg of magnesium citrate daily reduced migraine attack frequency by about 42%, compared to roughly 16% in the placebo group. The catch: the form of magnesium matters. A separate trial using a poorly absorbed magnesium salt showed no benefit at all, likely because nearly half the participants developed diarrhea before absorbing enough to help.
Chelated forms of magnesium (like magnesium citrate or magnesium glycinate) are generally better absorbed and easier on the stomach. Magnesium oxide is cheaper and widely available but more likely to cause digestive issues. Diarrhea and abdominal pain are the main side effects at higher doses, which can actually limit how much you absorb. A typical starting dose in migraine research is 400 to 600 mg per day.
Vitamin B12 and Folate: The Homocysteine Connection
Vitamin B12 and folate work together to convert an amino acid called homocysteine into methionine, a harmless and useful building block. When you’re low in either vitamin, homocysteine builds up. High homocysteine is a problem for your brain because it activates the same NMDA receptors that magnesium normally keeps in check. The result is a sustained rush of calcium into neurons, oxidative stress, and a lower threshold for the electrical wave that triggers migraine. In other words, B12 and folate deficiency primes your brain to have migraines through the same pathway magnesium deficiency does.
The clinical data backs this up. One study found that people with chronic migraine had significantly lower B12 levels than those with less frequent attacks (averaging about 198 ng/L versus 279 ng/L). Low B12 increased the likelihood of chronic migraine 3.6-fold. In children with migraines who also carried a common gene variant (MTHFR) that impairs folate metabolism, three months of folate supplementation reduced migraine frequency and brought homocysteine levels down.
B12 deficiency also causes problems on its own, independent of homocysteine. B12 is a key player in the energy production cycle inside mitochondria, the power generators in every cell. Without it, an intermediate molecule called methylmalonyl-CoA accumulates, energy output drops, and mitochondria start to malfunction. Mitochondrial dysfunction is increasingly recognized as a contributing factor in migraine, which is why several migraine-targeted supplements (including CoQ10 and riboflavin) work by supporting mitochondrial energy production.
Vitamin B2 (Riboflavin) and Energy Production
Riboflavin, or vitamin B2, is essential for the mitochondrial energy chain. The theory behind its use in migraine prevention is straightforward: if migraine brains have impaired energy metabolism, boosting riboflavin should help mitochondria produce energy more efficiently and reduce attack frequency. The evidence supports this. In trials using 400 mg per day of riboflavin (far above the typical dietary intake of 1 to 2 mg), patients experienced a significant reduction in monthly migraine attacks. The effect took time to build, with meaningful improvement appearing around the third to fourth month of consistent use.
Riboflavin is water-soluble, inexpensive, and has very few side effects. The most common one is bright yellow urine, which is harmless. It’s one of the better-tolerated options for people looking to reduce migraine frequency without prescription medication.
Vitamin D and Chronic Migraine
Vitamin D deficiency (defined as blood levels below 20 ng/mL) is common in the general population and even more common among people with migraines. In one study, having chronic migraine made you about four times more likely to be vitamin D deficient compared to people with less frequent attacks. Younger adults were also at higher risk.
The proposed mechanism centers on inflammation. Vitamin D helps regulate the immune system by reducing the release of inflammatory signaling molecules and calming overactive immune responses. Since migraine involves neurogenic inflammation (inflammation triggered by nerve activity in and around the brain’s blood vessels), low vitamin D may allow that inflammation to persist or intensify more easily. The evidence for vitamin D as a standalone migraine treatment is less robust than for magnesium or riboflavin, but correcting a deficiency is worth doing for many reasons beyond headaches.
CoQ10 and Mitochondrial Support
Coenzyme Q10 is a naturally occurring compound that sits at the heart of your cells’ energy production machinery. It’s not a vitamin in the traditional sense, but low levels have been found in people with migraines, and supplementation has shown promise. In one pilot study, 25 out of 40 migraine patients experienced a greater than 50% reduction in both the frequency and intensity of attacks after CoQ10 supplementation. Another 10 patients saw meaningful improvement in intensity but not frequency. The remaining five saw no change.
CoQ10 fits the same mitochondrial dysfunction theory as riboflavin and B12. When mitochondria can’t produce enough energy, neurons and the cells supporting them become vulnerable to the electrical and chemical events that trigger migraine. Supporting the energy chain at multiple points, whether through CoQ10, riboflavin, or B12, may explain why combination approaches sometimes work better than single supplements.
How to Know If You’re Deficient
Standard blood tests can measure vitamin D, B12, and folate levels with reasonable accuracy. Magnesium is trickier. The standard serum magnesium test measures what’s floating in your blood, but only about 1% of your body’s magnesium is in the bloodstream. You can have a normal serum reading while your cells are running low. Some clinicians use a red blood cell (RBC) magnesium test, which better reflects what’s stored inside cells, though it’s not routinely ordered. If you have symptoms that suggest low magnesium (leg cramps, cold hands and feet, premenstrual symptoms), a trial of supplementation is sometimes more practical than testing.
For B12 and folate, homocysteine levels can serve as a functional marker. If homocysteine is elevated, it suggests that one or both vitamins aren’t present in sufficient amounts to do their job, even if the individual vitamin levels appear borderline normal. This is especially relevant for people who carry MTHFR gene variants, which reduce the body’s ability to activate folate.
Putting It Together
Multiple nutrient deficiencies can converge on the same migraine pathways. Low magnesium and high homocysteine (from B12 or folate deficiency) both lead to overactivation of NMDA receptors and excessive calcium flooding into neurons. Poor riboflavin, B12, and CoQ10 status all impair mitochondrial energy production. Low vitamin D may amplify the inflammatory component. This overlap means that someone with migraines could have one dominant deficiency or several working together.
Most of the supplements studied for migraine prevention take two to three months of daily use before results become clear. Magnesium citrate at 400 to 600 mg, riboflavin at 400 mg, CoQ10 at 100 to 300 mg, and correcting any measured B12, folate, or vitamin D deficiency represent the best-supported nutritional strategies. None of these replace a full evaluation if your migraines are frequent or worsening, but they address real biological mechanisms rather than just masking symptoms.

