Nearly everyone has a headache from time to time. But for people with migraine, the pain can be much more serious.

An estimated 1 billion people experience migraine attacks, making it the third most common illness and the most common neurological condition in the world.

Recent studies and research suggest food and diet play a part 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.

Migraine episodes are different from regular headaches. They tend to last longer, be more painful, and have more physical effects, including:

Migraine pain can be on one side of the head or both. Some people experience migraine aura, a warning sign that an attack is coming. Aura may mean:

  • flashes or sparks of light
  • tingling in the body
  • difficulty speaking clearly or finding the right words (transient aphasia)

Anyone of any age can get migraine — even children. Certain factors can make you more prone to them:

  • Age. Migraine happens most often to people between the ages of 18 and 44.
  • Sex. Approximately 3 out of 4 people with migraine are those assigned female at birth.
  • Genetics. Around 90 percent of people who have migraine attacks have a family history of them.

Doctors know that certain things can trigger migraine attacks, though not every person reacts the same way to triggers. Potential triggers include:

  • stress and anxiety
  • hormone changes
  • certain medications or overuse of medications, including hormonal birth control, steroids, and prescription pain killers
  • poor sleep quality or a sleep disorder (e.g., insomnia, sleep apnea)
  • changes in weather

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. However, many people anecdotally claim that certain things they eat or drink trigger migraine. These include:

Some studies indicate 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, by the time they eat something, it’s too late — the migraine attack may already be coming.

More research is needed to understand if the true culprit is the hunger, the food, or a combination of these. Another possible culprit could be food temperatures. Eating or drinking something that is too hot or too cold may trigger a migraine attack. So be careful when enjoying hot and cold treats.

Eating and drinking certain things may help prevent migraine attacks. Changes in eating habits also help, such as limiting sodium and fat or trying a low glycemic diet. The National Headache Foundation also suggests trying a low tyramine diet. Their website has a detailed list of what to eat and what to avoid.

Avoiding processed foods in favor of whole, unprocessed foods is generally good advice for everyone, though it’s hard to avoid processed foods entirely. If you find additives like artificial flavorings, sweeteners, or preservatives to be migraine triggers for you, try to avoid them in the bulk of your diet.

Certain foods contain high amounts of minerals, vitamins, and fatty acids that may help prevent migraine. Here’s a list of what you can add to your diet:

  • Magnesium-rich foods. Research on mostly white females indicates that magnesium may offer migraine relief. Foods rich in magnesium include dark leafy greens, avocado, and tuna.
  • 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, and seeds and legumes.
  • Ketogenic foods. It may not be for everyone, but research shows that going keto may help reduce migraine attacks. This means eating foods that are low in carbohydrates and high in fat, like seafood, non-starchy vegetables, and eggs. Be careful, though: Some keto-friendly foods may trigger migraine attacks. Always speak with your doctor or a registered dietitian before starting a keto diet, as there are risks.

Some over-the-counter headache medications can help with the pain, such as Tylenol (acetaminophen) or Excedrin (acetaminophen and aspirin). If your migraine attacks are more severe or frequent, your doctor may prescribe medications or other treatments for you.

For relief without pills, your doctor may suggest trying Botox injections or using a neuromodulation device like the Cefaly Dual.

Resting in a dark, quiet room helps some people. For extra help, a cold compress on the head can have a numbing effect. There are also natural remedies you can try, including supplements like:

Always speak with your doctor before incorporating any new supplements to your diet as interactions can occur.

Research is ongoing when it comes to migraine treatments. Stay in touch with your doctor to learn about new therapies or clinical trials that may help you.

If you have migraine or think you have migraine symptoms, reach out to your doctor. They may suggest tests such as a CT scan or a blood panel to get a proper diagnosis, which is the key to treatment.

Consider a food journal to keep track of foods that may be triggering as well as foods that seem to help. Share it with your doctor so you can work on a more personalized treatment plan. Don’t be afraid to ask for help when you need it.

If your migraine attacks are affecting your mental health, talk with a professional counselor, therapist, or psychologist. Consider support groups as well. Talking to people who know what you are going through can help with feelings of isolation.

Healthline even has a free migraine app to keep you connected to a community of people who understand.