What Foods Help With Migraines and Why They Work

Several nutrients have strong evidence for reducing migraine frequency and severity, and you can get most of them through everyday foods. Magnesium, omega-3 fatty acids, riboflavin (vitamin B2), and coenzyme Q10 are the most well-studied, each working through different biological pathways to calm the overexcitable nerve signaling that triggers migraine attacks. Building meals around these nutrients won’t replace treatment for severe migraines, but it can meaningfully reduce how often they strike.

Magnesium-Rich Foods

Magnesium is the single most studied mineral for migraine prevention. It helps regulate nerve signaling and blood vessel tone, both of which go haywire during a migraine. The American Migraine Foundation notes that supplemental magnesium oxide at 400 to 600 mg per day is frequently used to prevent attacks, but dietary magnesium builds a foundation that supplements alone can’t replace.

The richest food sources include pumpkin seeds (about 150 mg per ounce), almonds (80 mg per ounce), spinach (156 mg per cooked cup), black beans (120 mg per cup), and dark chocolate (65 mg per ounce). Swiss chard, avocado, and cashews are also reliable sources. Many people with migraines have lower magnesium levels than average, so consistently eating these foods can help close that gap. Spreading magnesium-rich foods across your meals rather than loading up at dinner gives your body a steadier supply.

Fatty Fish and Omega-3s

A major randomized trial published in The BMJ tested what happens when people with migraines increase omega-3 fatty acids while cutting back on omega-6 fatty acids (the type dominant in vegetable oils and processed foods). The results were striking: participants who boosted their omega-3 intake to about 1.5 grams per day of EPA and DHA while lowering omega-6 intake experienced four fewer headache days per month compared to the control group.

That’s a clinically meaningful difference, roughly comparable to some preventive medications. The key wasn’t just adding omega-3s. Reducing omega-6 intake provided additional benefit, cutting an extra two headache days per month beyond omega-3s alone. In practical terms, this means both eating more fatty fish and cutting back on corn oil, soybean oil, and fried or heavily processed foods.

Salmon, mackerel, sardines, herring, and anchovies are the best food sources of EPA and DHA. Two to three servings per week gets most people into the range tested in the trial. Walnuts and flaxseed provide a plant-based omega-3 (ALA), though the body converts only a small fraction of ALA into the EPA and DHA that were directly studied.

Foods High in Riboflavin (Vitamin B2)

Riboflavin plays a critical role in how your cells produce energy, and that process tends to be impaired in people with migraines. A landmark trial published in Neurology found that 400 mg of riboflavin daily for three months turned 59% of migraine patients into “responders,” meaning their attack frequency dropped by at least half. Only 15% of the placebo group saw the same improvement.

You can’t easily reach 400 mg through food alone (that’s a supplemental dose), but regularly eating riboflavin-rich foods supports the same energy pathways at a lower level. Beef liver is the most concentrated source, followed by fortified cereals, yogurt, milk, eggs, lean beef, mushrooms, and almonds. A breakfast built around eggs, yogurt, and fortified cereal covers a significant portion of your daily riboflavin needs. If your migraines are frequent, a supplement on top of dietary sources is worth discussing with your provider.

CoQ10 From Meat and Seafood

Coenzyme Q10 is a compound your cells use to generate energy inside their mitochondria. Research from the American Academy of Neurology found that migraine patients who took 100 mg of CoQ10 three times daily had fewer attacks over three months compared to placebo. The connection makes sense: migraines are partly a disorder of brain energy metabolism, and CoQ10 keeps that system running efficiently.

CoQ10 is found naturally in meat and seafood, though at lower concentrations than what was used in clinical trials. Beef heart, pork, chicken, trout, sardines, and mackerel are the best dietary sources. Peanuts, broccoli, and cauliflower contain smaller amounts. As with riboflavin, food sources build your baseline, and a supplement may be needed to reach therapeutic levels if your migraines are frequent.

Steady Blood Sugar Through Whole Foods

Skipping meals is one of the most common and most preventable migraine triggers. When you miss a meal, especially breakfast, your body ramps up low-grade inflammation and disrupts how it processes glucose. That metabolic stress also saps your energy and reduces physical activity, creating a cascade of compounding triggers that lower your migraine threshold, essentially making your brain more vulnerable to the next attack.

Eating at regular intervals with foods that release energy slowly is the practical fix. Low-glycemic foods like oats, sweet potatoes, lentils, chickpeas, quinoa, and most non-starchy vegetables keep blood sugar from spiking and crashing. Pairing carbohydrates with protein or fat (an apple with almond butter, oatmeal with eggs) slows digestion further. If you notice migraines hitting in the late afternoon or on days you’ve eaten erratically, blood sugar instability is a likely contributor.

Ginger for Active Migraines

Most foods work as prevention, but ginger has evidence for acute relief during an active attack. A clinical trial compared 250 mg of powdered ginger to 50 mg of sumatriptan (a standard migraine medication) and found remarkably similar results: at two hours after treatment, pain dropped by 4.6 points on a 10-point scale with ginger versus 4.7 points with sumatriptan. Ginger also produced far fewer side effects, with only about 1 in 34 people experiencing any adverse reaction.

Fresh ginger tea is the easiest way to use this during an attack. Slice about an inch of fresh ginger root, steep it in hot water for 10 minutes, and drink it at the first sign of symptoms. Powdered ginger in capsule form is another option. Ginger also helps with the nausea that accompanies many migraines, giving it a dual benefit that most medications don’t offer.

Hydration and Electrolyte Balance

Dehydration is a well-known migraine trigger, but the mechanism goes deeper than simply not drinking enough water. Sodium and potassium levels directly affect how easily your brain cells fire. Elevated sodium outside nerve cells lowers the threshold for repetitive neuronal firing, essentially making your brain trigger-happy. This is one reason salty processed foods and dehydration (which concentrates sodium in your blood) can set off an attack.

Potassium-rich foods help counterbalance this effect. Bananas, potatoes, spinach, coconut water, oranges, and beans are excellent sources. Rather than obsessing over water intake alone, focus on staying consistently hydrated throughout the day and eating whole foods that naturally contain both water and potassium. If you exercise heavily or live in a hot climate, adding a pinch of salt and some citrus to your water can help maintain the right electrolyte balance without overloading on sodium.

Dietary Patterns That Tie It Together

Individual nutrients matter, but the overall pattern of your diet may matter more. Research on ketogenic diets (very low carbohydrate, high fat) shows that the state of ketosis can affect migraines through multiple pathways at once: replacing the brain’s primary fuel from glucose to ketone bodies, improving mitochondrial function, reducing oxidative stress, lowering systemic inflammation, and even altering the gut microbiome. These changes collectively reduce the brain excitability that underlies migraine attacks.

A strict ketogenic diet isn’t realistic or necessary for most people, but the principle it illustrates is useful. Diets built around whole, unprocessed foods with adequate healthy fats, lean proteins, and complex carbohydrates hit many of the same targets. The Mediterranean diet, which emphasizes fatty fish, olive oil, nuts, vegetables, and legumes, naturally delivers high levels of magnesium, omega-3s, riboflavin, and CoQ10 while keeping processed omega-6 oils and refined sugars low.

The strongest version of a migraine-friendly eating pattern combines several strategies: regular meal timing to stabilize blood sugar, fatty fish two to three times per week, daily servings of dark leafy greens and nuts for magnesium, eggs and dairy for riboflavin, minimal processed and fried foods to keep omega-6 intake down, and consistent hydration with potassium-rich whole foods. None of these changes work overnight. Most clinical trials show meaningful improvements at the two- to three-month mark, so consistency matters more than perfection.