Researchers followed over 200,000 people for more than 13 years to see if eating foods rich in specific nutrients could help prevent migraines. They found that people who ate more niacin (vitamin B3) and vitamin B12 had fewer migraines. The study also looked at magnesium, riboflavin, thiamine, vitamin B6, and folate—all nutrients that help your body’s cells produce energy. While the risk reduction was modest (3-4%), the findings suggest that eating more of these nutrients might be a simple way to help prevent migraines. However, more research is needed before doctors recommend specific amounts.
The Quick Take
- What they studied: Whether eating foods with certain B vitamins and magnesium—nutrients that help cells make energy—could reduce the chances of getting migraines
- Who participated: Over 202,000 adults from the UK Biobank study who were tracked for an average of 13 years. About 0.9% (roughly 1,844 people) developed migraines during the study
- Key finding: People who ate more niacin (vitamin B3) and vitamin B12 had about 3-4% lower risk of developing migraines. People with migraines generally ate less of all these nutrients compared to those without migraines
- What it means for you: Eating more foods rich in B vitamins and magnesium may help reduce migraine risk, though the protection is modest. This is not a cure or guaranteed prevention, but it’s a simple dietary change worth discussing with your doctor, especially if you get frequent migraines
The Research Details
This was a prospective cohort study, which means researchers followed the same large group of people over time and tracked what they ate and whether they developed migraines. The study used data from the UK Biobank, a huge health database with information from over 200,000 people. Researchers asked participants about their diet and then followed them for an average of 13.25 years to see who developed migraines. They used statistical tools called Cox regression models to figure out if eating more of certain nutrients was connected to fewer migraines, while accounting for other factors like age, gender, and overall diet quality.
The nutrients they studied were all related to how cells produce energy: magnesium, thiamine (vitamin B1), riboflavin (vitamin B2), niacin (vitamin B3), vitamin B6, vitamin B12, and folate (vitamin B9). Scientists chose these because recent research suggests that problems with how cells make energy might be involved in migraines. By studying a huge group over many years, researchers could see real-world patterns that might not show up in shorter studies.
This type of long-term study is valuable because it shows what actually happens in real life, not just in a controlled lab setting. By following hundreds of thousands of people, researchers can spot patterns that might be too small to notice in smaller studies. The long follow-up period (over 13 years) means the findings are based on what people actually ate and experienced over many years, making the results more reliable than studies that only look at one moment in time.
This study has several strengths: it included a very large number of people, followed them for many years, and used careful statistical methods. However, the study only tracked what people reported eating, which can be less accurate than measuring actual food intake. The study also couldn’t prove that these nutrients directly cause fewer migraines—only that people who eat more of them tend to get fewer migraines. The effect size was small (3-4% reduction), which means while it’s real, it’s not a dramatic change. The researchers did sensitivity analyses to check if their findings held up under different conditions, which is a good sign of reliability.
What the Results Show
The main finding was that people who ate more niacin (vitamin B3) and vitamin B12 had lower migraine risk. Specifically, for every standard increase in niacin intake, migraine risk dropped by 3%, and for every standard increase in vitamin B12 intake, risk dropped by 4%. These reductions were small but statistically significant, meaning they’re unlikely to be due to chance.
The study also found that magnesium showed a protective effect, though the relationship wasn’t perfectly linear (meaning more wasn’t always better in a straight line). People who developed migraines during the study had eaten significantly less of all these nutrients compared to people who didn’t develop migraines.
Interestingly, the protective effects were similar for both men and women and across different age groups, suggesting these nutrients might help prevent migraines in many different people. The researchers also tested whether their findings were stable by running additional analyses, and the results held up, which increases confidence in the findings.
The study looked at other B vitamins (thiamine, riboflavin, vitamin B6, and folate) and found they were also lower in people with migraines, but the protective effect wasn’t as clear or strong as with niacin and vitamin B12. The relationship between these nutrients and migraine risk appeared to be nonlinear for magnesium and niacin, meaning that very high intakes didn’t necessarily provide extra protection beyond a certain point. The study found no major differences in how these nutrients affected different groups of people based on age or gender.
This study builds on earlier research showing that mitochondrial dysfunction (problems with how cells make energy) might be involved in migraines. Previous smaller studies and lab research suggested that B vitamins and magnesium might help, but this is one of the first large, long-term studies in real people to confirm this connection. The findings align with what scientists know about how these nutrients help cells produce energy, supporting the theory that energy problems in the brain might contribute to migraines.
The study has several important limitations. First, it relied on people reporting what they ate, which can be inaccurate—people might forget foods or not know exact amounts. Second, the study couldn’t prove that eating more of these nutrients directly causes fewer migraines; it only shows they’re connected. Other factors like exercise, stress, sleep, or genetics might explain the connection. Third, the study only included people from the UK, so findings might not apply to other populations with different diets or genetics. Fourth, only 0.9% of participants developed migraines, which is lower than the general population rate, possibly because the study participants were generally healthier. Finally, the protective effect was small (3-4%), so while real, it’s not a dramatic change.
The Bottom Line
Based on this research, eating more foods rich in niacin (vitamin B3) and vitamin B12 may help reduce migraine risk. Good sources include chicken, tuna, turkey, eggs, dairy products, mushrooms, and fortified cereals. Magnesium-rich foods like almonds, spinach, pumpkin seeds, and dark chocolate may also help. However, this research suggests dietary changes as a complementary approach, not a replacement for medical treatment. If you get frequent migraines, talk to your doctor about whether increasing these nutrients makes sense for you. The evidence is moderate—these nutrients appear helpful, but they’re not a guaranteed cure. Confidence level: Moderate (the study is large and long-term, but the effect size is small and causation isn’t proven).
This research is most relevant for people who experience migraines and want to try dietary approaches to reduce their frequency. It may be especially helpful for people who prefer natural approaches or want to complement medical treatment. People with nutritional deficiencies might benefit most. However, this study doesn’t apply to people who don’t get migraines (it won’t prevent something you don’t have) or to people whose migraines are caused by specific triggers like hormones or medications. If your migraines are severe or frequent, you should still see a doctor—dietary changes alone may not be enough.
If you increase your intake of these nutrients, don’t expect immediate results. The study followed people over 13 years, so benefits develop over months to years of consistent eating habits. You might notice changes in migraine frequency after several weeks to months of dietary changes, but individual results vary widely. Some people may see benefits quickly, while others may need longer to notice a difference.
Want to Apply This Research?
- Track daily intake of niacin and vitamin B12 sources (servings of chicken, fish, eggs, dairy, fortified cereals) alongside migraine frequency and severity. Log migraines with date, duration, and intensity on a 1-10 scale to see if patterns emerge over 8-12 weeks.
- Add one niacin or B12-rich food to your daily routine: eat an egg at breakfast, add chicken to lunch, or snack on almonds. Use the app to set reminders to include magnesium-rich foods like spinach or pumpkin seeds. Track which foods you eat and how you feel to identify personal patterns.
- Create a 12-week tracking period where you log daily nutrient intake and migraine occurrences. Use the app’s trend analysis to see if increasing these nutrients correlates with fewer migraines. Share results with your doctor to determine if dietary changes are helping or if additional treatment is needed. Adjust intake based on what you observe and medical guidance.
This research suggests an association between certain nutrients and migraine risk, but it does not prove that increasing these nutrients will prevent or cure migraines. Individual results vary significantly. This information is for educational purposes and should not replace professional medical advice. If you experience frequent or severe migraines, consult with a healthcare provider before making significant dietary changes or stopping any migraine medications. Some people may have nutrient absorption issues or take medications that interact with supplements, so medical guidance is important. This study was observational and cannot establish direct cause-and-effect relationships.
