While food triggers get most of the attention, research has also identified nutrients that may help reduce migraine frequency when intake is consistently adequate. Magnesium is the most studied: a deficiency has been linked to migraine in multiple studies, and the American Migraine Foundation notes that magnesium supplementation is sometimes recommended as part of a prevention plan for people with frequent migraines. Riboflavin, or vitamin B2, has similar research support at higher doses studied clinically. Staying hydrated and eating regularly, avoiding long gaps between meals that can trigger a drop in blood sugar, also matters as much as any specific nutrient.
Best Foods for Migraine Prevention
1. Spinach and Leafy Greens: A Top Magnesium Source
Leafy greens are one of the most concentrated food sources of magnesium, the mineral most consistently studied in relation to migraine frequency.
| Nutrient | Per 1 Cup Cooked Spinach |
|---|---|
| Calories | 41 |
| Magnesium | 39% DV |
| Iron | 36% DV |
| Riboflavin | 23% DV |
Best eaten: lightly steamed or sauteed, which shrinks the volume so you can eat more in one sitting than raw.
2. Almonds and Pumpkin Seeds: A Portable Magnesium Snack
Nuts and seeds, pumpkin seeds especially, are among the richest snack-friendly sources of magnesium, making them an easy daily habit to build.
| Nutrient | Per 1 oz Pumpkin Seeds |
|---|---|
| Calories | 151 |
| Magnesium | 37% DV |
| Zinc | 14% DV |
| Protein | 7g |
Best eaten: as a small handful snack, or sprinkled on salads and oatmeal.
3. Fatty Fish: An Omega-3 Source Studied for Headache Frequency
Some clinical trials have found that increasing omega-3 fatty acid intake while reducing omega-6 intake is associated with fewer migraine days, likely related to omega-3’s role in lowering inflammation.
| Nutrient | Per 3 oz Salmon |
|---|---|
| Calories | 175 |
| Omega-3s | 1.8g |
| Vitamin D | 71% DV |
| Protein | 19g |
Best eaten: 2 to 3 times a week, baked or grilled rather than fried.
4. Eggs: A Riboflavin and Choline Source
Eggs supply riboflavin, the nutrient studied at higher clinical doses for migraine prevention, along with choline, which supports normal brain and nervous system function.
| Nutrient | Per 2 Large Eggs |
|---|---|
| Calories | 140 |
| Riboflavin | 30% DV |
| Choline | 27% DV |
| Protein | 12g |
Best eaten: at breakfast, which also supports steady blood sugar through the morning, another factor tied to migraine onset.
5. Avocado: A Magnesium and Healthy Fat Source
Avocado combines magnesium with potassium and monounsaturated fat, and its steady, slow-digesting calorie profile can help avoid the blood sugar swings that sometimes precede a migraine.
| Nutrient | Per 1/2 Avocado |
|---|---|
| Calories | 160 |
| Magnesium | 10% DV |
| Potassium | 14% DV |
| Fiber | 7g |
Best eaten: on whole grain toast, or sliced into a salad.
6. Ginger: Studied for Acute Nausea Relief During Migraine
Ginger has been studied specifically for reducing nausea, a common migraine symptom, and some small clinical trials have looked at ginger’s potential to reduce migraine intensity when taken early in an attack.
| Nutrient | Per 1 tsp Fresh Grated |
|---|---|
| Calories | 2 |
| Gingerol content | High |
| Manganese | Small amount |
Best eaten: steeped as tea at the first sign of a migraine, or grated into food regularly as a preventive habit.
7. Watermelon and Water-Rich Foods: Supporting Hydration-Related Prevention
Dehydration is a well-established migraine trigger, and water-rich foods like watermelon and cucumber support fluid intake alongside plain water.
| Nutrient | Per 1 Cup Watermelon |
|---|---|
| Calories | 46 |
| Water content | 92% |
| Potassium | 5% DV |
Best eaten: as a snack throughout the day, particularly in hot weather or after exercise.
8. Whole Grains: A Steady Blood Sugar Source
Skipping meals and the resulting blood sugar dips are a commonly reported migraine trigger. Whole grains digest slowly and help maintain steadier blood sugar between meals than refined carbohydrates.
| Nutrient | Per 1 Cup Cooked Oats |
|---|---|
| Calories | 166 |
| Fiber | 4g |
| Magnesium | 14% DV |
Best eaten: at consistent times through the day, avoiding long gaps of 4 hours or more without eating.
Quick Reference: All 8 Foods at a Glance
| Food | Serving Size | Key Nutrient |
|---|---|---|
| Spinach/leafy greens | 1 cup cooked | Magnesium |
| Almonds/pumpkin seeds | 1 oz | Magnesium |
| Fatty fish | 3 oz | Omega-3s |
| Eggs | 2 large | Riboflavin |
| Avocado | 1/2 fruit | Magnesium, potassium |
| Ginger | 1 tsp fresh | Gingerol |
| Watermelon | 1 cup | Hydration |
| Whole grains | 1 cup cooked | Steady blood sugar |
5 Evidence-Based Habits for Migraine Prevention
- Eat on a regular schedule and avoid skipping meals, since blood sugar dips are one of the most common and preventable migraine triggers.
- Stay consistently hydrated throughout the day rather than drinking a large amount at once.
- Keep caffeine intake steady day to day rather than alternating between heavy use and none.
- Prioritize regular sleep timing, since irregular sleep is one of the strongest known migraine triggers, arguably more consistent than any single food.
- If magnesium or riboflavin supplementation is something you’re considering, talk to your doctor first, since clinical studies use specific doses that are higher than what’s typically found in a multivitamin.

The Bottom Line
Magnesium- and riboflavin-rich foods, along with steady hydration and regular meal timing, have the strongest research support among dietary approaches to migraine prevention. These foods are a reasonable place to start, alongside the other lifestyle habits known to matter just as much.
This article is for informational purposes and is not a substitute for personalized medical advice. If you experience frequent or severe migraines, talk with a doctor or headache specialist about a full prevention and treatment plan.



