What Foods Relieve Headaches

Several foods can help relieve headaches by targeting the most common underlying causes: inflammation, dehydration, low blood sugar, and nutrient deficiencies. The best options depend on what’s driving your headache, but magnesium-rich foods, hydrating fruits and vegetables, omega-3 fatty acids, and ginger have the strongest evidence behind them.

Magnesium-Rich Foods

Magnesium is one of the most studied nutrients for headache relief. It works by blocking pain-transmitting chemicals in the brain, including a compound called Substance P, and by preventing the narrowing of blood vessels that serotonin can trigger during a migraine. People who get frequent headaches are more likely to have low magnesium levels, which makes dietary intake especially important.

The best food sources of magnesium include pumpkin seeds, almonds, spinach, black beans, dark chocolate (70% cacao or higher), avocado, and cashews. A single ounce of pumpkin seeds delivers around 150 mg of magnesium, roughly 35 to 40 percent of the daily recommended intake for most adults. Eating these foods regularly may reduce how often headaches occur in the first place, not just ease them once they start.

Water-Rich Fruits and Vegetables

Dehydration is one of the most common and overlooked headache triggers. Losing just 2% of your body’s water through sweating can cause headaches, fatigue, and low blood pressure. Drinking water helps, but pairing it with high-water-content foods speeds rehydration because those foods also deliver electrolytes and minerals.

Cucumbers top the list at 96% water, followed by iceberg lettuce (96%), celery and radishes (95%), tomatoes and zucchini (94%), and watermelon, strawberries, broccoli, and bell peppers (all 92%). Broth, at 92% water, is especially useful because it also replaces sodium lost through sweat. If your headaches tend to hit in the afternoon or after exercise, adding a few of these to your meals can make a noticeable difference.

Fatty Fish and Omega-3s

Omega-3 fatty acids found in salmon, mackerel, sardines, and herring are powerful anti-inflammatory compounds. They work by dampening the production of inflammatory signaling molecules, reducing the kind of widespread low-grade inflammation that contributes to chronic and recurring headaches. The two key omega-3s, EPA and DHA, are found almost exclusively in oily cold-water fish.

If you don’t eat fish regularly, canned sardines and canned salmon are affordable options that still deliver high levels of omega-3s. Walnuts, flaxseeds, and chia seeds contain a plant-based omega-3 (ALA), though your body converts it to EPA and DHA inefficiently. For headache prevention, prioritizing actual fish a few times per week gives you the most reliable benefit.

Ginger

Ginger has surprisingly strong evidence for acute migraine relief. A clinical trial of 100 migraine sufferers compared 250 mg of ginger powder to 50 mg of sumatriptan (a common prescription migraine drug) taken at headache onset. The results showed ginger was statistically comparable in effectiveness, with fewer side effects. That 250 mg is roughly a quarter teaspoon of ground ginger, which is easy to add to tea, smoothies, or stir-fries.

Fresh ginger steeped in hot water works well for a quick remedy. Grate about an inch of fresh ginger root into a mug of hot water, let it steep for 10 minutes, and drink it at the first sign of a headache. Ginger also settles nausea, which is a common companion to migraines.

Complex Carbs and Steady Blood Sugar

Skipping meals or eating refined carbohydrates that spike and crash your blood sugar is a reliable way to trigger a headache. When blood sugar drops, your brain loses its primary fuel source, and the resulting stress response can set off pain. The National Headache Foundation recommends eating a full meal every 3 to 4 hours and starting the day with 20 to 30 grams of protein at breakfast.

The best foods for keeping blood sugar stable are complex carbohydrates that digest slowly: brown rice, quinoa, lentils, beans, oats, and berries. Pairing them with protein (eggs, yogurt, tofu, chicken) and a healthy fat (avocado, olive oil, nuts) slows digestion further and prevents the blood sugar dips that lead to headaches. If you notice your headaches tend to hit before meals or in the late afternoon, unstable blood sugar is a likely culprit.

Caffeine: Help or Harm

Caffeine has a complicated relationship with headaches. At around 100 to 130 mg (roughly one small cup of coffee), it narrows dilated blood vessels and boosts the effectiveness of pain relievers. Some research suggests 130 mg per day is the most therapeutically beneficial dose. That’s why caffeine is an ingredient in many over-the-counter headache medications.

The problem is that regular high caffeine intake can itself contribute to chronic headaches, and withdrawal from caffeine after habitual use is a well-known headache trigger. If you don’t normally drink caffeine, a small cup of coffee or strong tea at headache onset can genuinely help. If you’re already a heavy coffee drinker, adding more won’t do much, and cutting back gradually may reduce headache frequency over time.

B Vitamins and CoQ10

Riboflavin (vitamin B2) has been studied as a migraine preventive because of its role in energy production within brain cells. Research suggests that people with migraines may have a brain energy deficit, and nutrients that support mitochondrial function (the energy-producing structures in cells) can help close that gap. Other nutrients in this category include CoQ10, thiamine (B1), and niacin (B3).

Good food sources of riboflavin include milk, yogurt, eggs, lean meats, salmon, almonds, and spinach. CoQ10 is found in organ meats, beef, chicken, trout, peanuts, and broccoli. You don’t need large amounts from any single food. A varied diet that includes dairy, leafy greens, nuts, and quality protein covers most of these nutrients naturally.

An Anti-Inflammatory Eating Pattern

Individual foods help, but overall dietary patterns matter more for people with frequent headaches. A pilot study on patients with chronic migraine found that following a Mediterranean-style diet led to significant reductions in both migraine frequency and intensity within just four weeks. The improvements were also linked to reductions in insulin levels and body fat, suggesting that metabolic health plays a role in headache patterns.

The Mediterranean diet emphasizes vegetables, fruits, whole grains, legumes, nuts, olive oil, and fish while limiting processed foods, refined sugar, and red meat. This pattern naturally delivers high levels of magnesium, omega-3s, B vitamins, and antioxidants while keeping blood sugar stable. Rather than focusing on a single “headache food,” building meals around these ingredients addresses multiple headache triggers at once.