Key takeaways:
Certain foods may help lower your chances of getting headaches or migraines.
Research shows that some foods may help to reduce inflammation and keep blood vessels from enlarging, which may help to prevent or even treat headaches and migraines.
Foods rich in antioxidants might also help to get rid of free radicals, which can irritate nerves and contribute to headaches.
For some people, certain foods seem to trigger a headache or a migraine. Think red wine, monosodium glutamate (MSG), and aged cheeses. But there are also foods that may help to protect you from headaches or migraines — and even a few that may help relieve your pain in the moment.
Foods give us nutrients and energy. But they also contain other components that can affect our bodies in a range of ways — including some that might potentially raise or lower your chances of getting a headache. These components might affect the brain chemical serotonin or block pain chemicals. They can also decrease inflammation, impact blood vessels, and provide antioxidants that neutralize free radicals (reactive molecules that can inflict damage on our cells).
Let’s take a closer look at which foods might help with headache and migraines.
1. Seeds and nuts
Seeds and nuts are rich in magnesium, a mineral that’s known to help prevent headaches and migraines. Magnesium may be especially helpful for people with migraine with aura or menstrual migraines.
The American Migraine Foundation recommends that people with migraines consider taking magnesium supplements. But you can also increase your magnesium levels by eating more nuts and seeds.
Top options include:
Pumpkin seeds
Chia seeds
Almonds
Cashews
But keep in mind: Nuts and seeds also contain a substance called tyramine. This may actually be a headache or migraine trigger for some people.
2. Berries
Berries contain tons of antioxidants, which can neutralize free radicals. These highly reactive molecules can cause what’s known as oxidative stress. In your brain, this stress can cause nerve inflammation, which may set you up for a headache or migraine.
Eating foods rich in antioxidants may help stop this inflammation. But the research on this is somewhat limited. Berries are always nutritious, so it’s always good to eat more of them.
What type of migraines do you have? Here’s everything you need to know about the eight different types of migraines, their symptoms, and treatments.
Could medication be causing your headaches? Learn about 11 common medications that can cause headaches.
Migraine vs. headache: What’s the difference? Here’s how to understand how migraines are different from other types of headaches, so you can get the treatment that’s right for you.
Berries bursting with antioxidants include:
Blueberries
Cranberries
Blackberries
3. Citrus fruits
Citrus fruits — like oranges, clementines, and grapefruits — are packed with vitamin C, a potent antioxidant. There’s some evidence that vitamin C can help reduce the risk of having migraines or severe headaches.
Read more like this
Explore these related articles, suggested for readers like you.
But just like nuts and seeds, be aware: Citrus can also be a migraine trigger for some people.
4. Leafy greens
Dark leafy greens, like spinach and kale, are rich in magnesium and antioxidants. So, they may help reduce headaches by chasing down free radicals and lowering inflammation.
5. Fatty fish
All fish have healthy fats. But some contain a lot of omega-3 fatty acids, a type of fat that helps lower inflammation in your body. Studies have found that having more omega-3 fatty acids and fewer omega-6 fatty acids (a less healthy fat) can reduce how often and how severe headaches are. Along with fatty fish, chia seeds and flax seeds are also high in omega-3s.
Fish rich in omega-3 fatty acids include:
Salmon
Mackerel
Tuna
Herring
Sardines
6. Fiber
Eating fiber has many health benefits. And there’s some evidence that eating more fiber may help to reduce severe headache and migraine frequency. Adults should consume at least 20 g to 30 g of fiber each day. And some people may need even more depending on their age and sex.
Top sources of fiber include:
Whole vegetables and fruits
Beans and lentils
Whole grains
Nuts and seeds
What foods can trigger migraines?
It’s hard to say. Many people with migraines say that certain foods and drinks can trigger an attack. These include:
Cheese
Chocolate
Alcohol
Processed meats
Monosodium glutamate (MSG)
Caffeine
Gluten
Artificial sweeteners
But in reality, there’s not a lot of evidence that these foods trigger migraine attacks in most people. Experts also believe that foods that seem to trigger migraines might actually be cravings that happen before the actual headache begins, during what’s called the “prodrome” phase.
What’s the best diet for migraine headaches?
In research studies, certain diets seemed to be especially helpful for people with migraines:
Ketogenic diet (keto)
If you get headaches or migraines, it can also be important to eat regular meals and not let too much time pass between them. Missing meals can cause a drop in blood sugar, which can trigger headaches or migraines in some people. Eating at regular times throughout the day can help prevent this.
Lastly, be sure to drink enough water. Dehydration is a known trigger for many types of headaches. Try to drink about 1.5 L of water a day. This is like drinking an 8-oz glass of water, 6 times throughout your day.
Frequently asked questions
If you’re dealing with headaches or migraines, it’s a good idea to keep a “headache diary.” This can help you keep track of how often you’re having headaches and can also help you identify patterns or triggers. Use an app on your smartphone or computer, or write on a paper headache log.
Yes, iron deficiency can cause many symptoms, including headaches.
Yes, as your body transitions to ketosis, it’s common to have headaches and other symptoms (known as the “keto flu”). These symptoms usually go away within the first week.
Low blood sugar (hypoglycemia) can cause many symptoms, including headaches. If your blood sugar is low, eating a fast-acting carb like fruit juice, honey, or sugar can help.
If you’re concerned about hypoglycemia, talk to a healthcare professional. They can help you figure out if you’re experiencing low blood sugar episodes and the best way to manage them.
If you’re dealing with headaches or migraines, it’s a good idea to keep a “headache diary.” This can help you keep track of how often you’re having headaches and can also help you identify patterns or triggers. Use an app on your smartphone or computer, or write on a paper headache log.
Yes, iron deficiency can cause many symptoms, including headaches.
Yes, as your body transitions to ketosis, it’s common to have headaches and other symptoms (known as the “keto flu”). These symptoms usually go away within the first week.
Low blood sugar (hypoglycemia) can cause many symptoms, including headaches. If your blood sugar is low, eating a fast-acting carb like fruit juice, honey, or sugar can help.
If you’re concerned about hypoglycemia, talk to a healthcare professional. They can help you figure out if you’re experiencing low blood sugar episodes and the best way to manage them.
The bottom line
Foods contain a range of nutrients that can affect your body — and your headaches. If you have headaches or migraines, consider adding nutritious foods like berries, leafy greens, and fatty fish. And remember: If you’re looking for more guidance, consider checking in with a healthcare professional or dietician. They can help you understand how food might be affecting your headaches and migraines and guide you toward the best eating plan for your needs.
Why trust our experts?



References
American Diabetes Association. (n.d.). Signs, symptoms, and treatment for hypoglycemia (low blood glucose).
American Migraine Foundation. (2021). Magnesium and migraine.
American Migraine Foundation. (2022). Migraine prodrome: Symptoms and prevention.
American Migraine Foundation. (2024). Migraine and diet.
Arca, K. N., et al. (2021). Dehydration and headache. Current Pain and Headache Reports.
Goschorska, M., et al. (2020). The use of antioxidants in the treatment of migraine. Antioxidants.
Hindiyeh, N. A., et al. (2020). The role of diet and nutrition in migraine triggers and treatment: A systematic literature review. Headache.
Huang, H., et al. (2023). The association between dietary fiber intake and severe headaches or migraine in US adults. Frontiers in Nutrition.
Khorsha, F., et al. (2020). Association of drinking water and migraine headache severity. Journal of Clinical Neuroscience.
National Headache Foundation. (n.d.). Headache diary.
National Headache Foundation. (n.d.). Low-tyramine diet for individuals with headache or migraine.
Office of Dietary Supplements. (2022). Magnesium: Fact sheet for health professionals. National Institutes of Health.
Smith, L. (2025). Migraine safe foods and potential triggers by category. Association of Migraine Disorders.
Zheng, Y., et al. (2024). Association of dietary vitamin C consumption with severe headache or migraine among adults: A cross-sectional study of NHANES 1999–2004. Frontiers in Nutrition.














