Several vitamins and minerals have solid evidence behind them for reducing headache frequency, particularly for migraines. The most studied are vitamin B2 (riboflavin), magnesium, and coenzyme Q10, all of which have been evaluated in clinical trials and recognized by neurological associations. Vitamin D and other B vitamins also play supporting roles, especially when levels are low.
Vitamin B2 (Riboflavin)
Riboflavin is one of the best-supported vitamins for migraine prevention. The American Academy of Neurology classifies it as “probably effective,” giving it Level B evidence. The standard dose used in studies is 400 milligrams per day, which is far above what you’d get from food alone.
The mechanism appears to involve energy production inside cells. Imaging studies suggest that people with migraines may have impaired energy metabolism in the brain, and riboflavin is a key player in that process. By improving how brain cells generate energy, it may reduce the conditions that trigger attacks.
Riboflavin leaves the body quickly, with a half-life of about two hours, so splitting the dose across two or three meals tends to work better than taking it all at once. It should be taken with food. The most noticeable side effect is bright yellow urine, which is harmless and expected at higher doses. Beyond that, riboflavin rarely causes problems.
Magnesium
Magnesium is another supplement with Level B evidence for migraine prevention. It’s particularly well-studied for people who get migraines with aura and for menstrual migraines. The American Migraine Foundation recommends magnesium oxide at 400 to 600 mg per day for prevention.
The most common complaint with magnesium supplements is digestive upset, including diarrhea and cramping. Chelated forms of magnesium (like magnesium glycinate) are better absorbed in the gut and tend to cause fewer of these side effects than magnesium oxide. If you’ve tried magnesium oxide and couldn’t tolerate it, switching forms is worth considering.
Coenzyme Q10
CoQ10 is a compound your body produces naturally that helps cells convert food into energy. In a randomized controlled trial published in the journal Neurology, 300 mg of CoQ10 per day (split into three 100 mg doses) significantly outperformed a placebo. Nearly 48% of people taking CoQ10 saw their migraine frequency drop by at least half, compared to just 14% in the placebo group. That’s a meaningful difference, and the number-needed-to-treat was only three, meaning for every three people who try it, one will see a substantial benefit.
CoQ10 is generally well tolerated at moderate doses and is considered safe for both adults and children.
Vitamin D
Low vitamin D levels have been linked to higher rates of both migraines and chronic tension-type headaches, though the research is less definitive than for riboflavin or magnesium. The connection makes biological sense: vitamin D is involved in inflammation regulation and nerve function, both of which play roles in headache disorders.
If you’re getting frequent headaches, it’s reasonable to have your vitamin D level checked. Correcting a deficiency won’t necessarily stop headaches on its own, but it removes one potential contributing factor. The recommended daily allowance is 600 IU, though many people with deficiency need higher doses to restore normal levels.
B12 and Folate
Vitamins B12 and folate work together to break down homocysteine, an amino acid that can build up in the blood. Elevated homocysteine levels have been observed in people with chronic migraines, particularly those who overuse pain medications. Folate is directly involved in converting homocysteine into a harmless amino acid, and this reaction requires B12 as a helper.
Supplementing with these vitamins is most useful if your levels are actually low. A blood test can reveal both your B12/folate status and your homocysteine level, which gives a clearer picture of whether this pathway is relevant to your headaches.
Melatonin for Cluster Headaches
Melatonin occupies a different category because it primarily helps with cluster headaches rather than migraines or tension-type headaches. Cluster headaches are intensely painful, often strike at night, and tend to occur in seasonal patterns. Melatonin at 10 mg taken in the evening can help prevent attacks of episodic cluster headache, with doses ranging from 10 to 25 mg in clinical use. Its mild side-effect profile makes it a practical option alongside other cluster headache treatments.
Supplements for Children With Headaches
Children with recurring migraines can also benefit from supplements, though at adjusted doses. Guidelines from Texas Children’s Hospital suggest magnesium at 9 mg per kilogram of body weight per day (up to a maximum of 500 mg), using a chelated form to minimize stomach issues. Riboflavin is dosed at 100 mg twice daily for children under 40 kg, and 200 mg twice daily for those over 40 kg. CoQ10 follows a similar weight-based approach: 50 mg twice daily under 40 kg, 100 mg twice daily above.
Vitamin D at 600 to 1,000 IU per day and melatonin at 3 to 9 mg before bedtime are also used in pediatric settings. One important caution: butterbur root extract, which once carried strong evidence for migraine prevention, is no longer recommended because generic forms have been found to contain liver-damaging chemicals and carcinogens.
How Long Before They Work
The most common frustration with vitamin-based approaches is the timeline. Unlike pain relievers, which work within an hour, these supplements are preventive. You’re changing baseline chemistry, not treating individual headaches. It typically takes 8 to 12 weeks of consistent daily use before you can judge whether a supplement is reducing your attacks. Starting multiple supplements at once makes it harder to tell which one is helping, so adding them one at a time with a two- to three-month trial period for each gives you the clearest signal.
Combining Supplements
Many headache specialists recommend trying riboflavin, magnesium, and CoQ10 together because they target overlapping but distinct aspects of brain cell energy metabolism. All three have favorable safety profiles and minimal interactions with each other. The combined daily routine would look like 400 mg riboflavin, 400 to 600 mg magnesium, and 300 mg CoQ10, taken with meals. This combination is sometimes called a “mitochondrial cocktail” in headache clinics because all three ingredients support the energy-producing structures inside cells.
These supplements work best as part of a broader strategy that includes identifying personal triggers, maintaining consistent sleep, staying hydrated, and managing stress. They aren’t a replacement for prescription treatments in people with severe or frequent migraines, but for many people they meaningfully reduce how often headaches occur.

