What Foods Help Migraines and Which to Avoid

Several categories of foods can help reduce migraine frequency and severity, primarily by supplying nutrients that calm overexcitable nerve cells and reduce inflammation in the brain. The most impactful are foods rich in magnesium, riboflavin (vitamin B2), omega-3 fatty acids, and coenzyme Q10. Beyond adding helpful foods, avoiding high-tyramine foods and staying well hydrated also play a meaningful role.

Magnesium-Rich Foods Calm Nerve Excitability

Magnesium is one of the most studied nutrients in migraine prevention, and for good reason. In the nervous system, magnesium acts as a gatekeeper on nerve cell receptors, blocking calcium from flooding into neurons unchecked. When magnesium levels drop, nerve cells become hyperexcitable and more vulnerable to the wave of abnormal electrical activity that triggers migraine aura and pain. Low magnesium also amplifies the effects of glutamate, the brain’s main excitatory chemical, which can lead to oxidative stress in brain tissue.

People with migraines tend to have lower magnesium levels in the brain than people without them. Loading up on magnesium-rich foods is a practical first step: dark leafy greens like spinach and Swiss chard, pumpkin seeds, almonds, cashews, black beans, avocados, and dark chocolate (in moderation). Whole grains like brown rice and quinoa are also solid sources. These foods won’t deliver the high doses used in clinical supplement trials, but they help maintain the baseline your nervous system needs to stay stable.

Riboflavin Fuels Brain Energy Production

Riboflavin, or vitamin B2, supports the mitochondria, the energy-producing structures inside every cell. Migraine brains appear to have impaired energy metabolism, and riboflavin helps mitochondria generate fuel more efficiently. In a randomized trial of 55 adults with migraines, 400 mg per day of riboflavin reduced migraine frequency by about two attacks per month compared to placebo. The Canadian Headache Society recommends this same dose for migraine prevention, noting that side effects are minimal (mainly discolored urine).

Getting 400 mg purely from food is difficult, since even rich dietary sources contain far less per serving. But regularly eating riboflavin-rich foods still contributes to your overall intake and supports mitochondrial health. The best food sources include eggs, liver and organ meats, lean meats, milk, yogurt, and fortified cereals and breads. If you eat dairy and eggs regularly, you’re already getting a reasonable baseline. For people interested in hitting the therapeutic 400 mg dose, a supplement is typically necessary, but the dietary foundation still matters.

Omega-3 Fatty Acids Reduce Headache Days

A well-designed study funded by the National Institutes of Health tracked 182 people who experienced migraines 5 to 20 days per month. Over 16 weeks, participants who ate diets higher in omega-3 fatty acids (EPA and DHA) had fewer headache days per month, fewer total hours of headache, and fewer hours of moderate-to-severe pain compared to those eating a typical American diet. The best results came from combining higher omega-3 intake with lower intake of omega-6 fatty acids, the type found in vegetable oils like soybean, corn, and sunflower oil.

To put this into practice, eat more fatty fish like salmon, sardines, mackerel, and herring, ideally two to three servings per week. Walnuts, flaxseeds, chia seeds, and hemp seeds provide a plant-based form of omega-3, though the conversion to EPA and DHA in the body is limited. At the same time, reducing your use of highly processed vegetable oils and fried foods helps shift the omega-6 to omega-3 ratio in your favor.

CoQ10 Foods Support Mitochondrial Function

Coenzyme Q10 works alongside riboflavin to keep mitochondria running smoothly. It plays a direct role in producing ATP, the energy currency of cells, and improving mitochondrial function can help supply brain cells with the energy they need to resist migraine triggers. CoQ10 also helps regulate calcium levels inside neurons and supports the release of nitric oxide, which affects blood vessel function.

Dietary sources of CoQ10 include beef, pork, chicken, fatty fish (especially sardines and mackerel), eggs, nuts (particularly peanuts and pistachios), broccoli, cauliflower, and plant oils like soybean and canola oil. As with riboflavin, the amounts in food are much lower than supplement doses used in research, but consistent intake from a varied diet supports your body’s own production of this compound.

Ginger for Acute Migraine Relief

Most migraine-friendly foods work preventively over weeks or months. Ginger is a notable exception. In a randomized, double-blind trial of 100 people experiencing acute migraine without aura, ginger powder performed comparably to sumatriptan, a standard migraine medication. Two hours after taking either treatment, headache severity dropped significantly in both groups. Ginger also caused fewer side effects, and patients were equally willing to continue using it.

Fresh ginger in tea, grated into food, or even as a dried powder stirred into water is a reasonable option to try at the first sign of an attack. It won’t replace prescription treatment for everyone, but for mild to moderate migraines, it offers real relief with very little downside.

Foods to Limit: Tyramine and Common Triggers

What you avoid can matter as much as what you eat. Tyramine, a compound that builds up naturally in aged and fermented foods, is a well-known migraine trigger for sensitive individuals. The American Headache Society estimates that roughly 10% or fewer of people with migraines are genuinely sensitive to specific food triggers, but for those who are, the effect can be pronounced.

High-tyramine foods to watch include aged cheeses (cheddar, blue cheese, Parmesan, Gruyère), cured and fermented meats (salami, pepperoni, sausage), fermented soy products like miso and soy sauce, sauerkraut, and kimchi. Overripe fruit, leftover protein-rich foods that have sat in the fridge for days, and foods past their expiration date also accumulate tyramine. Safe swaps include fresh meats and fish (eaten promptly after cooking), cottage cheese, ricotta, cream cheese, milk, yogurt, eggs, and all fresh or frozen fruits and vegetables.

A few practical storage habits help too: eat leftovers within 48 hours or freeze them, open canned fish or poultry and eat it right away, and keep protein-rich foods properly refrigerated.

Potassium and Hydration

Dehydration is one of the most common and most overlooked migraine triggers. Electrolyte balance, particularly the relationship between sodium and potassium, plays a role in how nerve cells transmit signals. Population-level research has found associations between dietary potassium intake and headache prevalence, and early clinical observations noted that migraine sufferers excrete elevated levels of both sodium and potassium during attacks.

Potassium-rich foods include bananas, sweet potatoes, white beans, spinach, avocados, coconut water, and plain yogurt. Pairing consistent water intake with these foods helps maintain the cellular stability your nervous system depends on. If you notice that your migraines tend to strike on days when you’ve eaten poorly or skipped meals, stabilizing hydration and electrolytes is a low-effort, high-impact change.

The Ketogenic Approach

A ketogenic diet, very low in carbohydrates and high in fat, forces the brain to run on ketone bodies instead of glucose. This metabolic shift has several effects relevant to migraines. Ketone bodies reduce the production of damaging reactive oxygen species in mitochondria, improving the brain’s redox balance. They also modulate nerve cell excitability by influencing potassium channels and glutamate signaling, which may raise the threshold for the electrical wave that initiates migraine aura. On top of that, the primary ketone body (beta-hydroxybutyrate) inhibits a key inflammatory pathway, reducing production of inflammatory signaling molecules linked to migraine pain.

This is a more intensive dietary strategy than simply adding magnesium-rich foods, and it requires careful planning. But for people with frequent, difficult-to-treat migraines who haven’t responded well to other approaches, it represents a biologically plausible option with growing clinical interest.

Putting It Together

The most practical approach combines several of these strategies rather than relying on a single food. A diet built around fatty fish, leafy greens, nuts, seeds, eggs, and fresh fruits and vegetables covers magnesium, riboflavin, omega-3s, CoQ10, and potassium simultaneously. Minimizing processed and aged foods reduces tyramine exposure and excess omega-6 intake. Keeping ginger on hand gives you something to reach for when a migraine starts. These aren’t dramatic changes individually, but stacked together over weeks, they address multiple biological pathways involved in migraine, from nerve excitability and brain energy production to inflammation and oxidative stress.