Certain foods can help ease a headache, while others can make it worse. What you eat during a headache matters because your brain is sensitive to changes in hydration, blood sugar, inflammation, and specific chemicals found in food. The right choices can shorten a headache or take the edge off, and the wrong ones can drag it out for hours.
Start With Water and Electrolytes
Dehydration is one of the most common and overlooked headache triggers. Even mild fluid loss reduces blood volume, which means less oxygen reaching your brain. Before reaching for food, drink a tall glass of water. If you’ve been sweating, skipping meals, or drinking alcohol, plain water alone may not be enough because you’ve also lost sodium and potassium.
A simple rehydration drink can help: mix four cups of water with a quarter teaspoon of salt and the juice of half a lemon or orange. The salt replaces sodium, the citrus adds potassium, and the combination helps your body absorb the fluid faster than water alone. Coconut water works similarly if you’d rather grab something ready-made.
Magnesium-Rich Foods
Magnesium plays a direct role in headache relief. It helps prevent the wave of abnormal brain signaling that causes aura and sensory changes during migraines. It also blocks pain-transmitting chemicals in the brain, improves blood flow by preventing blood vessels from narrowing, and supports healthy platelet function. Many people with frequent headaches have low magnesium levels without realizing it.
Good sources to reach for during a headache include pumpkin seeds, almonds, cashews, dark chocolate (in small amounts), spinach, black beans, and avocado. A handful of pumpkin seeds delivers roughly 150 mg of magnesium, about 35% of the daily value. Pairing these with a meal or snack helps your body absorb the mineral more effectively.
Foods High in Omega-3 Fats
Omega-3 fatty acids reduce neuroinflammation, which is a key driver of headache pain. A meta-analysis of randomized trials published in the journal Neurology found that people consuming higher levels of omega-3s experienced about two fewer headache days per month and roughly 1.6 fewer hours of headache per day compared to control groups. The intensity of attacks also dropped significantly.
Salmon, sardines, mackerel, and trout are the richest dietary sources. If you’re mid-headache and don’t feel like cooking fish, walnuts, chia seeds, and flaxseeds are convenient alternatives. Even something as simple as a piece of toast with smoked salmon or a handful of walnuts can contribute meaningful amounts of omega-3s.
Ginger for Acute Pain
Ginger has real evidence behind it for headache relief, not just folk tradition. In clinical trials, ginger powder reduced migraine pain to mild or no pain within two hours, performing on par with sumatriptan, one of the most commonly prescribed migraine medications. People taking ginger also experienced significantly fewer side effects.
You can grate fresh ginger into hot water for tea, or stir a half teaspoon of ground ginger into warm water with honey. The studies used roughly 400 to 500 mg of dry ginger extract, which is close to half a teaspoon of powdered ginger. Repeat every four hours if needed, up to about 1.5 grams per day.
Steady Blood Sugar Matters
Low blood sugar triggers headaches by starving your brain of its primary fuel. If your headache started after skipping a meal or eating mostly sugar, your first priority is a balanced snack that combines protein, fat, and complex carbohydrates. This combination stabilizes blood sugar without the spike-and-crash cycle that can make things worse.
Practical options include oatmeal with almond butter and banana slices, eggs on whole grain toast, a small bowl of lentil soup, or Greek yogurt with berries and seeds. The goal is something easy to digest that delivers sustained energy. Avoid eating a large, heavy meal, which diverts blood flow to your gut and can intensify head pain.
The Caffeine Question
Caffeine is tricky. In small, occasional doses, it narrows dilated blood vessels and can relieve a headache quickly. That’s why it’s an ingredient in many over-the-counter pain relievers. But the window between helpful and harmful is narrow.
Consuming 100 mg of caffeine daily (roughly one cup of coffee) nearly triples the likelihood of developing chronic daily headaches. Caffeine dependency can develop after just seven days of regular use. The American Migraine Foundation recommends limiting caffeine as a headache treatment to no more than two days per week. If you drink three or more caffeinated beverages per week already, adding more during a headache is more likely to feed a rebound cycle than help.
If you rarely drink caffeine, a small cup of green tea or half a cup of coffee alongside a meal can help. If you’re a daily coffee drinker, stick to your usual amount. Cutting it suddenly will trigger a withdrawal headache on top of the one you already have.
Foods That Can Make a Headache Worse
Some foods contain chemicals that actively trigger or worsen headaches. The main culprits are tyramine, histamine, nitrites, sulfites, and MSG. When you already have a headache, these compounds can amplify the pain or extend its duration.
- Aged cheeses: The older the cheese, the higher the tyramine content. Parmesan, blue cheese, cheddar, and brie are the worst offenders. Pizza is a common hidden source because it combines aged cheese with processed meat.
- Processed and cured meats: Hot dogs, salami, pepperoni, bacon, beef jerky, and deli meats preserved with nitrites or nitrates are well-documented headache triggers.
- Fermented and pickled foods: Sauerkraut, kimchi, pickled fish, soy sauce, and miso are high in both tyramine and histamine.
- Certain fruits: Overripe bananas, dried fruits like raisins (which contain both tyramine and sulfites), raspberries, red plums, papayas, figs, and dates can worsen symptoms.
- Aged dairy: Yogurt, sour cream, and buttermilk contain enough tyramine to be problematic for sensitive individuals.
- Alcohol: Red wine is the most commonly reported trigger, combining histamine, tyramine, and sulfites in one glass. Beer and champagne are close behind.
You don’t necessarily need to avoid all of these forever. But when you’re in the middle of a headache, steering clear of them gives your brain one less thing to react to.
A Simple Headache Meal Plan
If you’re mid-headache and need a straightforward plan, here’s what a good day of eating looks like. Start with a glass of water with a pinch of salt and lemon juice. For breakfast or a snack, try oatmeal topped with walnuts and fresh berries. At lunch, have grilled salmon or a sardine salad with leafy greens and pumpkin seeds. For a snack, reach for a small square of dark chocolate and a handful of almonds. Sip ginger tea throughout the day.
The pattern is simple: hydrate well, eat regularly, choose anti-inflammatory fats and magnesium-rich foods, avoid aged and processed items, and keep caffeine minimal. For people with frequent headaches, making these choices a habit rather than a one-time response can reduce how often headaches show up in the first place. A diet rich in omega-3s, adequate in magnesium, and low in processed triggers works both as relief and prevention.