Is Magnesium Good for Headaches? What Evidence Shows

Magnesium is one of the better-supported natural options for preventing headaches, particularly migraines. In a placebo-controlled trial of 81 migraine patients, taking 600 mg of magnesium daily reduced attack frequency by 41.6% over 12 weeks, compared to just 15.8% in the placebo group. The American Academy of Family Physicians lists oral magnesium among effective migraine preventive options, recommending 400 to 600 mg daily.

How Magnesium Works Against Headaches

Magnesium affects several pathways involved in headache pain, which is part of why it works for so many people. The most important mechanism involves a type of receptor in your brain that processes pain signals. When magnesium levels are adequate, magnesium ions block these receptors, preventing calcium from flooding into nerve cells and triggering the cascade of events that leads to head pain. When magnesium is low, those receptors become overactive.

Low magnesium also makes the brain more vulnerable to a phenomenon called cortical spreading depression, a slow wave of electrical activity across the brain’s surface that is closely linked to migraine with aura. Magnesium blocks this wave from being triggered, and the wave starts more easily when magnesium levels drop.

There’s a serotonin connection, too. During migraines, serotonin released from blood platelets causes blood vessels in the brain to constrict, contributing to pain, nausea, and vomiting. When magnesium levels fall, serotonin receptors on blood vessel walls become more sensitive, amplifying this constriction. Pretreatment with magnesium has been shown to reduce serotonin-driven vessel narrowing.

What the Clinical Evidence Shows

The strongest evidence for magnesium is in migraine prevention, not in stopping a headache once it’s already started. In the landmark trial using 600 mg of magnesium citrate daily, the number of migraine days and the amount of pain medication patients needed both dropped significantly compared to placebo. A separate trial of 30 migraine patients taking 600 mg of magnesium citrate daily found notable decreases in both attack frequency and severity over three months. Another trial using 500 mg of magnesium oxide daily for 12 weeks also showed significant reductions in how often migraines occurred and how severe they were.

For tension-type headaches and cluster headaches, the evidence is thinner. Magnesium’s pain-blocking mechanisms are relevant to all headache types, and a small pediatric case series found that 35% of adolescents with various acute headaches (including one patient with a tension-type headache) responded favorably to treatment. But dedicated large-scale trials for non-migraine headaches are lacking, so the clearest case for supplementation remains migraine prevention.

How Long Before You Notice Results

Don’t expect overnight relief. The clinical trials that showed meaningful migraine reduction ran for 12 weeks, and the most significant improvements appeared in the final month (weeks 9 through 12). One study noted improvements beginning in the second month. A reasonable expectation is to give magnesium supplementation at least two to three months before judging whether it’s working for you.

Which Form of Magnesium to Choose

This is where things get surprisingly complicated. Magnesium citrate has the best overall profile for supplementation: it’s well absorbed, stable, and soluble. Magnesium lactate is similarly well absorbed. Your body takes up magnesium from these forms far more efficiently than from magnesium oxide, which has a bioavailability of only about 4%.

Here’s the catch: several of the successful migraine trials actually used magnesium oxide, and it still worked. No head-to-head trials have directly compared different magnesium forms specifically for headache outcomes. In theory, citrate should be more effective milligram for milligram because your body absorbs so much more of it. In practice, oxide at higher doses has also shown benefit, possibly because the sheer amount compensates for poor absorption. If you want the best chance of getting adequate magnesium into your system without taking enormous doses, magnesium citrate is the most commonly recommended form.

Dosage and What to Expect

Clinical guidelines from the VA/DoD, endorsed by the American Academy of Family Physicians, recommend 400 to 600 mg of oral magnesium daily for migraine prevention. Most successful trials used 500 to 600 mg per day.

The main side effect is digestive upset. Diarrhea is the most common complaint at these doses, and it was frequent enough in studies that it was the primary factor limiting how much magnesium people could tolerate. In one study, 36% of participants reported diarrhea. Abdominal cramping and soft stools are also possible. Starting at a lower dose and gradually increasing can help your body adjust. If one form bothers your stomach, switching to another (for instance, from oxide to citrate or glycinate) sometimes helps, since different forms affect the gut differently.

For people with healthy kidneys, the risk of taking too much magnesium is low. Your kidneys are efficient at clearing excess magnesium from the blood, so even high oral doses rarely cause dangerous buildup in otherwise healthy individuals. People with impaired kidney function face a real risk of magnesium accumulating to harmful levels and should not supplement without medical guidance.

Medication Interactions to Watch For

Magnesium can interfere with the absorption of certain antibiotics. If you take tetracycline-type or fluoroquinolone-type antibiotics, take them at least two hours before or four to six hours after your magnesium supplement to avoid this problem.

The interaction works both ways with some medications. Certain drugs can deplete your magnesium levels, potentially making headaches worse. Loop and thiazide diuretics (commonly prescribed for blood pressure) increase magnesium loss through the kidneys. Proton pump inhibitors, the acid-reducing medications many people take daily for heartburn, can cause magnesium deficiency when used for a year or longer. If you take either of these medication types regularly and get frequent headaches, low magnesium could be a contributing factor worth investigating.

Magnesium During Pregnancy

One notable advantage of magnesium over many headache medications is its safety profile during pregnancy. The AAFP specifically highlights magnesium as a safe option for migraine prevention in pregnant individuals, a population for whom most preventive headache medications are off limits. Magnesium is already widely used in obstetric settings for other purposes, giving clinicians a long track record of safety data.

Getting Magnesium From Food

Supplementation is the most studied approach for headache prevention, but boosting your dietary magnesium is a reasonable foundation. The richest food sources include pumpkin seeds, almonds, spinach, cashews, black beans, edamame, dark chocolate, and avocados. A quarter cup of pumpkin seeds alone provides roughly 150 mg of magnesium. Whole grains, legumes, and leafy greens are consistently good sources.

That said, reaching the 400 to 600 mg range used in clinical trials through food alone is difficult for most people. The recommended daily intake for adults is already 310 to 420 mg depending on age and sex, and surveys consistently show that many people fall short of even that baseline. For headache prevention specifically, a supplement is the more practical path to hitting the doses that trials have shown to be effective.