Magnesium, omega-3 fatty acids, and keto-friendly foods may all help relieve or prevent migraine attacks. Consider adding foods like dark leafy greens, avocado, and fish to your diet.

Nearly everyone has a headache from time to time. But for people with migraine, the pain can be much more severe and occur with other symptoms.

An estimated 1.1 billion people experience migraine attacks, making it the second leading cause of disability globally.

Recent research suggests that food and diet may play a part in managing migraine. Making changes to your diet may help prevent migraine attacks or reduce their frequency.

Keep reading for more on how this works and which foods to eat or avoid.

Certain foods contain high amounts of minerals, vitamins, and fatty acids that may help prevent migraine attacks. Some drinks may also ease symptoms or prevent migraine triggers.

Magnesium-rich foods

Research from 2021 discovered a link between migraine frequency and U.S. adults ages 20 to 50 years who weren’t getting enough magnesium in their diet. Other research from 2021 involving mostly white females suggests that magnesium may offer migraine relief.

  • dark leafy greens
  • avocado
  • tuna
  • bananas

Dark chocolate is also rich in magnesium, but there’s some debate over whether other components in it may trigger migraine attacks. According to a 2020 review, there’s not enough evidence to suggest that it does, but everyone’s experience is different.

Omega-3 fatty acids

Research indicates that increasing omega-3 fatty acids may help people with migraine. Foods rich in omega-3 fatty acids include:

  • fish such as mackerel and salmon
  • seeds
  • legumes

Fiber-rich foods

A 2022 study found that an increase in dietary fiber correlated with a decrease in frequency of severe headaches or migraine attacks.

The study authors stressed the need for more research before making universal dietary recommendations, but the potential role of dietary fiber is noteworthy.

High fiber foods include:

  • whole grains
  • fruits
  • vegetables
  • potatoes
  • beans

Water

Staying hydrated may help prevent migraine and reduce symptoms, as dehydration can be a migraine trigger.

A 2020 study involving 256 adult women ages 45 years and under found that drinking more water each day decreased both the severity and frequency of migraine headaches.

Certain teas may also have additional benefits, such as reducing nausea or headache symptoms.

Whole foods

Avoiding processed foods in favor of whole, unprocessed foods is generally good advice for everyone. Whole, unprocessed foods include fruits, vegetables, grains, legumes, and nuts and seeds.

Still, it’s challenging to avoid processed foods entirely. If you find that additives like artificial flavorings, sweeteners, or preservatives are migraine triggers for you, try to avoid them in the bulk of your diet.

Food and the chemicals in it may trigger migraine attacks. Right now, there’s no definite list of foods or beverages that do or don’t cause a migraine attack. Migraine triggers and food sensitivities may differ for people.

However, many people anecdotally claim that certain foods and drinks trigger their migraine attacks. Some foods and drinks noted in research include:

  • nitrate-rich foods, such as cured meats and hot dogs
  • monosodium glutamate (MSG), an additive often found in processed foods
  • artificial sweeteners, especially aspartame and sucralose
  • tyramine, a chemical found in fermented foods, aged cheeses, and some kinds of fresh-baked bread
  • phenylethylamine, an amino acid found in chocolate, nuts, citrus fruits, soy foods, and vinegar
  • alcoholic beverages like wine and beer
  • dairy products and ice cream
  • caffeine-containing beverages like coffee
  • certain vegetables, including tomatoes and onions
  • histamine-containing foods, including alcohol, fermented foods, dried fruits, and others
  • gluten, a protein found in wheat

Some studies suggest that the foods themselves might not be the problem. Instead, food cravings and hunger may be the real root of the trigger.

When people have food cravings due to low blood sugar and then eat something, it’s often too late — they may already be beginning to experience the symptoms of a migraine attack.

More research is needed to understand if hunger, food, or a combination of these is the actual cause.

About caffeine and migraine

Caffeine is a tricky one when it comes to migraine. Some people believe it to be a trigger.

But caffeine may also help, at least in limited amounts. Caffeine is an active ingredient in several headache medications, including Excedrin, Midol, Darvon Compound, and Migranal.

Research shows that caffeine can provide relief in acute situations. But proceed with caution, as daily caffeine intake can dull its helpful effects. Talk with a doctor about your caffeine intake for the best advice.

Some people with migraine keep a journal to track what foods they eat and when migraine attacks occur. Some apps can also help you do this.

A migraine attack may occur minutes to hours after ingesting a particular food. A journal can help you identify patterns as to when attacks occur after eating certain foods.

If you’ve identified a potential trigger food or beverage, try removing it from your diet to see if migraine attacks still occur. If you notice an improvement in your symptoms, it may be a trigger food.

There’s no one diet that’s best for people with migraine. However, research suggests that several different types of eating plans may help reduce the frequency of migraine attacks. Examples include:

Keto and modified Atkins diets may help reduce migraine attacks compared with a standard diet.

Ketosis, the process of fueling the brain with ketones instead of glucose (sugar), may be responsible for this protective effect. These diets involve eating foods low in carbohydrates and high in fat, like seafood, nonstarchy vegetables, and eggs.

Be careful, though: Some keto-friendly foods may trigger migraine attacks. Always speak with a doctor or a registered dietitian before starting a keto diet, as there are risks.

Keto diets may not be an option for people concerned about their heart health. However, heart-healthy diets like the Mediterranean and DASH diets may also help reduce migraine symptoms, according to 2022 research. However, research is limited.

There’s also increasing evidence that plant-based diets, like a vegan diet, may help with migraine. A 2023 study found a link between plant-based diets and lower migraine headache frequency. Still, more research is needed.

Regardless of which diet you choose, it’s important to make sure you’re still consuming enough calories to meet your daily energy needs. Some diets, including many of the diets mentioned above, can often be too restrictive and prevent you from getting enough nutrition. Be sure to talk with a doctor about an eating plan that’s right for you.

About elimination diets

If you experience migraine attacks, you may be curious about trying an elimination diet (like tyramine-free or keto diets) to relieve symptoms.

Elimination diets that cut out entire classes of food can lead to malnutrition. In some cases, this may cause more harm than good.

According to a 2020 study: “The downside of an elimination diet is the long-term negative effect of undernutrition — a form of malnutrition.”

It’s important not to start any kind of diet without talking with a doctor or a registered dietitian first. They can help you find the right eating plan and make any dietary changes to improve your health safely.

Treating and preventing migraine attacks often includes medication or other therapies to reduce the frequency and severity of episodes. However, dietary changes may also help significantly.

Certain dietary patterns, like keto and plant-based diets, may help prevent migraine attacks. Dietary behaviors like choosing unprocessed foods and drinking lots of water can also help.

If you think that specific foods or drinks may contribute to your migraine attacks, keeping a food journal to track what may be triggering attacks can help. Share it with a doctor so you can work together on a more personalized treatment plan.

If you’re looking to connect with other people with migraine, resources like Healthline’s Bezzy Migraine offer an online safe space for community, peer and expert guidance, and support.