Foods That Help Headaches and Why They Work

Several types of food can help reduce the frequency and intensity of headaches, primarily by supplying nutrients your body uses to regulate pain signaling, maintain steady blood sugar, and stay hydrated. The most evidence-backed options are foods rich in magnesium, omega-3 fatty acids, potassium, and B vitamins, along with simple strategies like drinking more water and eating low-glycemic carbohydrates.

Magnesium-Rich Foods

Magnesium plays a central role in nerve function and blood vessel regulation, both of which are involved in headache development. People who get migraines frequently tend to have lower magnesium levels, and supplementing with around 600 mg daily has been shown to reduce migraine frequency in clinical trials. The American Headache Society recommends 400 to 500 mg per day for prevention.

You don’t necessarily need a supplement to increase your intake. Dark leafy greens like spinach and Swiss chard, pumpkin seeds, almonds, cashews, black beans, and dark chocolate (70% cacao or higher) are all concentrated sources. A single ounce of pumpkin seeds delivers roughly 150 mg of magnesium, and a cup of cooked spinach provides about 160 mg. Building these into your regular meals, rather than eating them only when a headache strikes, is the more effective strategy since magnesium works as a preventive measure over time.

Fatty Fish and Omega-3s

Your body converts omega-3 fatty acids from food into compounds called oxylipins, some of which actively reduce pain. Omega-6 fatty acids, found heavily in vegetable oils and processed foods, get converted into oxylipins that do the opposite. The balance between these two types of fat in your diet directly influences how your body processes pain signals.

A National Institutes of Health-funded study found that people with frequent migraines who ate a diet higher in omega-3s and lower in omega-6s experienced meaningful reductions in headache frequency and severity. The best food sources are fatty fish: salmon, mackerel, sardines, herring, and anchovies. Aim for two to three servings per week. Plant sources like flaxseeds, chia seeds, and walnuts provide a different form of omega-3 that your body converts less efficiently, but they still contribute to the overall balance.

Potassium From Fruits and Vegetables

A large population study found an L-shaped relationship between potassium intake and migraine risk. For every 100 mg increase in daily potassium, migraine occurrence dropped by about 4.8%, up to a threshold of roughly 1,440 mg per day. Beyond that point, additional potassium didn’t provide extra benefit. This means people with low potassium intake stand to gain the most from adding potassium-rich foods to their diet.

Western diets that lean heavily on grains and processed foods often fall short on potassium. The fix is straightforward: eat more fruits and vegetables. A medium banana has about 420 mg, a medium avocado around 700 mg, and a medium baked potato with skin delivers roughly 900 mg. Sweet potatoes, white beans, and coconut water are also excellent sources. If your diet already includes several servings of produce daily, you’re likely above the threshold where potassium makes a difference for headaches.

Ginger for Acute Relief

Most foods on this list work as long-term prevention. Ginger is the notable exception. In a randomized controlled trial comparing ginger powder to sumatriptan (a common prescription migraine drug), both reduced headache severity by a similar amount within two hours. Patients reported comparable satisfaction with both treatments, and ginger caused fewer side effects.

The study used about 250 mg of ginger powder taken at the onset of a migraine. You can get a similar dose from a quarter teaspoon of ground ginger stirred into hot water or tea. Fresh ginger works too: grate about a thumb-sized piece into hot water and steep for five to ten minutes. Keeping ginger tea on hand gives you a practical option for the early stages of a headache before reaching for medication.

Water and Hydrating Foods

Dehydration is one of the most common and most overlooked headache triggers. In a pilot clinical trial, people who increased their daily water intake by about 1.5 liters experienced 21 fewer hours of headache over a two-week period, along with a noticeable drop in pain intensity. That’s roughly six extra glasses of water per day.

If you struggle to drink enough plain water, high-water-content foods help bridge the gap. Cucumber, watermelon, strawberries, celery, and oranges are all over 85% water by weight. Soups and broths count too, with the added benefit of providing sodium and other electrolytes that help your body retain the water you take in. Caffeinated drinks are a mixed bag: small amounts of caffeine can actually relieve headaches by narrowing blood vessels, but regular overconsumption (and the withdrawal that follows skipping a day) is a well-known headache trigger.

Steady Blood Sugar With Low-Glycemic Foods

Skipping meals or eating foods that spike and crash your blood sugar can trigger headaches directly. When blood sugar drops too fast, your brain responds by releasing stress hormones and dilating blood vessels, both of which can set off a headache. This is why some people get headaches in the late afternoon if they skipped lunch or ate a sugary snack instead of a real meal.

Low-glycemic foods release glucose slowly and keep your energy stable for hours. Lentils, oats, nonstarchy vegetables, sweet potatoes, and whole intact grains (like quinoa or barley) are good choices. Pairing carbohydrates with protein or fat slows digestion even further. A handful of almonds with an apple, or eggs with whole grain toast, will keep blood sugar far more stable than cereal or a pastry. If you notice a pattern of headaches at predictable times of day, irregular meals or blood sugar dips are worth investigating before anything else.

B Vitamins From Whole Foods

Riboflavin (vitamin B2) has some of the strongest evidence among vitamins for migraine prevention. The amounts used in clinical research, typically 400 mg per day, are far higher than what you’d get from food alone. But regularly eating riboflavin-rich foods still supports your baseline levels and overall nerve health. Good sources include eggs, lean beef, mushrooms, fortified cereals, and dairy products like yogurt and milk.

Other B vitamins, particularly B6 and B12, also play roles in neurotransmitter production and inflammation control. Poultry, fish, potatoes, and chickpeas are rich in B6, while B12 comes almost exclusively from animal products. If you follow a plant-based diet, B12 supplementation is worth considering independently of headaches, since deficiency is common and can cause neurological symptoms including headaches.

Putting It Together

No single food is a magic fix for headaches, but the pattern in the research points clearly in one direction: a diet built around vegetables, fruits, fatty fish, nuts, seeds, legumes, and plenty of water covers nearly every nutrient linked to headache prevention. Magnesium, potassium, omega-3s, B vitamins, and stable blood sugar all come naturally from this kind of eating pattern. At the same time, reducing processed foods cuts down on omega-6 fatty acids, excess sodium, and blood sugar spikes that can make headaches worse.

Keep ginger on hand for acute episodes. Stay consistent with water intake rather than chugging it only when a headache starts. And pay attention to meal timing, since for many people, the most effective dietary change isn’t adding a superfood but simply eating regular meals that include protein, healthy fat, and slow-digesting carbohydrates.