What Food Is Good for Migraines and Why It Works

Several nutrients found in everyday foods can reduce how often migraines strike and how severe they feel. Magnesium, riboflavin, and omega-3 fatty acids have the strongest evidence behind them, and you can get meaningful amounts of each through diet. Beyond individual nutrients, the overall pattern of what you eat matters too: keeping blood sugar steady, choosing fresh over aged and processed foods, and shifting the balance of fats in your diet all play a role.

Magnesium-Rich Foods

Magnesium is one of the most studied nutrients for migraine prevention, and many people with migraines have lower-than-normal levels. Clinical trials using up to 600 mg of supplemental magnesium per day found modest reductions in migraine frequency. You likely can’t hit therapeutic supplement doses through food alone, but building magnesium-rich foods into your routine raises your baseline and supports the broader goal of prevention.

The richest dietary sources, per serving:

  • Pumpkin seeds (1 oz, roasted): 156 mg
  • Chia seeds (1 oz): 111 mg
  • Almonds (1 oz): 80 mg
  • Spinach (½ cup, cooked): 78 mg
  • Cashews (1 oz): 74 mg
  • Black beans (½ cup, cooked): 60 mg

A handful of pumpkin seeds on a salad plus a half cup of cooked spinach at dinner gets you past 230 mg from just two foods. Pair that with whole grains and legumes throughout the day, and you’re covering a significant share of your daily needs. Most adults need 310 to 420 mg per day depending on age and sex.

Fatty Fish and Omega-3s

A well-designed trial published through the National Institutes of Health assigned 182 people who had migraines 5 to 20 days per month to one of three diets for 16 weeks. Those who ate more omega-3 fatty acids from fish had fewer total headache hours, fewer hours of moderate-to-severe headache per day, and fewer headache days per month compared to people eating a typical American diet. The best results came from the group that increased omega-3s while also cutting back on omega-6 fatty acids, the kind found heavily in vegetable oils like corn, soybean, and sunflower oil.

Salmon, mackerel, sardines, herring, and trout are the densest sources of the two omega-3s that matter here: EPA and DHA. Aiming for two to three servings of fatty fish per week is a reasonable target. At the same time, reducing your intake of fried foods, processed snacks, and dishes cooked in high-omega-6 oils amplifies the benefit. This isn’t about eliminating all vegetable oil. It’s about shifting the ratio so omega-3s get a larger share.

Riboflavin (Vitamin B2) Sources

The Canadian Headache Society recommends 400 mg per day of riboflavin for migraine prevention. In a randomized trial of 55 adults, that dose reduced migraine attacks by two per month compared to placebo. That’s a supplement-level dose, far more than you’d get from food (the daily value is only 1.3 mg). Still, riboflavin-rich foods contribute to your overall intake and support cellular energy production, which is thought to be part of how the vitamin helps.

Top food sources include beef liver (2.9 mg per 3 oz), fortified cereals (up to 1.3 mg per serving), fortified instant oats (1.1 mg per cup), plain yogurt (0.6 mg per cup), and milk (0.5 mg per cup). Eggs, lean beef, clams, almonds, and Swiss cheese also contribute smaller amounts. If you eat dairy and fortified grains regularly, you’ll at least cover the basic daily requirement, even if reaching the therapeutic 400 mg requires a supplement.

Foods That Keep Blood Sugar Steady

Skipping meals and blood sugar crashes are well-known migraine triggers. When your blood sugar drops sharply, it can set off a cascade that ends in head pain. The fix is less about any single superfood and more about eating consistently and choosing foods that release energy slowly.

Beans, lentils, and chickpeas are particularly useful here. They combine protein, fiber, and magnesium, all of which help regulate blood sugar. Whole grains like oats, quinoa, and barley digest more slowly than refined carbs. Pairing carbohydrates with protein or fat (an apple with almond butter, oatmeal with eggs) blunts the blood sugar spike you’d get from carbs alone. If you notice migraines tend to hit in the late afternoon or after long gaps between meals, this pattern of eating is one of the most practical changes you can make.

Fresh Foods Over Aged and Processed

Some of the most important dietary changes for migraine aren’t about adding foods but avoiding ones that trigger attacks. Tyramine, a compound that builds up as protein-rich foods age, is a common culprit. Histamine and certain additives like MSG can also provoke migraines in sensitive people.

The general rule: eat young, fresh, natural foods and avoid over-ripe or heavily processed ones. Foods more likely to trigger migraines include aged cheeses (cheddar, brie, blue cheese), cured and processed meats (salami, hot dogs, bacon), fermented foods (sauerkraut, kimchi, soy sauce), and overripe bananas, avocados, and citrus. Red wine and beer are common triggers too, with vodka being the best-tolerated alcohol if you drink at all.

Safe swaps that let you keep variety in your diet:

  • Instead of aged cheese: cottage cheese, ricotta, or cream cheese
  • Instead of processed meats: fresh chicken, turkey, or fish
  • Instead of soy sauce: herbs, spices, and fresh garlic for flavor
  • Instead of dried fruits and nuts: fresh fruits and seeds (sunflower, pumpkin, chia)

Not everyone with migraines is sensitive to the same triggers. An elimination approach, where you remove the most common offenders for a few weeks and reintroduce them one at a time, can help you identify your personal triggers without unnecessarily restricting your diet.

The Mediterranean Pattern

Rather than fixating on individual foods, a Mediterranean-style eating pattern ties many of these threads together. It emphasizes fish, vegetables, legumes, whole grains, olive oil, nuts, and seeds while limiting processed food and red meat. A pilot study on chronic migraine patients found that a Mediterranean-based diet significantly reduced both migraine frequency and intensity within just four weeks.

This makes sense when you look at what the diet provides: high magnesium from greens and seeds, omega-3s from fish, riboflavin from dairy and lean meats, steady blood sugar from whole grains and legumes, and very little of the processed, aged, or additive-heavy food that tends to trigger attacks. You don’t need to follow a rigid plan. Even shifting a few meals per week toward this pattern, more fish, more vegetables, fewer packaged foods, moves the needle.

Caffeine: A Double-Edged Trigger

Caffeine deserves its own mention because it can both help and hurt. Small amounts can relieve a headache in progress, which is why it’s included in some migraine medications. But regular caffeine use creates dependency, and withdrawal (even from sleeping later than usual on a weekend) is a reliable migraine trigger. If you consume caffeine daily and get migraines, consider gradually tapering to a low, consistent amount or switching to caffeine-free herbal teas. The key is consistency: your brain adapts to whatever caffeine level you give it, and sudden changes cause problems.