Magnesium can do both, depending on dose, form, and timing: at normal supplemental doses (200–400 mg daily) it prevents migraine in some people, while excessive intake or a poorly absorbed form can trigger headache through dehydration, blood-pressure drops, or gut-driven fluid loss. The evidence for prevention is strongest in migraine, with roughly a 20–40% reduction in attack frequency in trials of 400–600 mg daily magnesium. The "magnesium causes headaches" claim is real but uncommon, and usually traceable to osmotic diarrhea, low blood pressure, or interactions with other medications rather than the mineral itself.

The mechanism: why a mineral changes headache threshold

Magnesium is the body's fourth most abundant cation and a cofactor in more than 600 enzymatic reactions. Two of those reactions sit directly on the migraine pathway. First, magnesium gates the NMDA receptor, the brain's main excitatory glutamate channel. When brain magnesium falls, NMDA signaling becomes easier to trigger, and cortical spreading depression, the slow wave that underlies migraine aura, fires at a lower threshold. Second, magnesium is required for endothelial nitric oxide production and for normal vascular tone, so low levels promote the vasoconstriction phase that precedes many migraine attacks.

The "magnesium deficiency" finding in migraine is not universal, which is where most explainers overreach. Serum magnesium is a poor marker because only about 1% of body magnesium circulates in blood; the rest sits in bone and intracellular space. Studies using ionized or intracellular magnesium find lower levels in migraine sufferers than controls, but many migraine patients have completely normal serum values. In plain terms: low brain magnesium can matter even when a standard blood test looks fine.

The reverse mechanism explains magnesium-induced headache. A large supplemental dose draws water into the intestine, causing osmotic diarrhea and mild volume depletion. A 400 mg dose of magnesium oxide can pull several hundred milliliters of fluid into the colon in sensitive people. The resulting low-grade dehydration and electrolyte shift is a well-recognized headache trigger, and it is dose- and form-dependent rather than intrinsic to magnesium.

Quantified context: how much prevention the trials actually show

The prevention evidence is real but modest, and it clusters around migraine rather than tension-type or cluster headache.

In randomized trials, 400–600 mg of elemental magnesium daily reduced migraine attack frequency by roughly 20–40% compared with placebo over 8–12 weeks. A commonly cited figure from pooled trials is about a 22% reduction in attack frequency with 600 mg daily. That is meaningful but smaller than the 50% or greater reduction seen with prescription preventives such as topiramate or the CGRP monoclonal antibodies. Magnesium is best framed as a low-risk adjunct, not a replacement for proven prophylaxis in high-frequency migraine.

The headache-type spread matters for anyone searching this question. For menstrual migraine, 360 mg daily taken in the luteal phase showed benefit in a small trial. For pediatric migraine, a commonly used dose is 9 mg per kg per day, capped at 400 mg. For tension-type headache, the trial data are thin and inconsistent, and no major guideline endorses magnesium as first-line. For cluster headache, there is no convincing prevention evidence at all.

The dose ceiling is where the "causes headaches" side becomes concrete. The tolerable upper intake level for supplemental magnesium in adults is 350 mg per day per the 2005 Institute of Medicine dietary guidance, a limit set for supplement sources only, not food. Food magnesium has no upper limit because the kidney clears the excess. So a 400–600 mg supplemental dose used in migraine trials actually sits above the general upper limit, which is precisely why form and kidney function matter.

Magnesium form Elemental yield per dose Absorption Typical GI side-effect risk Best fit
Magnesium oxide ~60% elemental by weight Poor, 4–10% High, laxative Constipation relief, not prevention
Magnesium citrate ~16% elemental Good, 25–30% Moderate, osmotic Prevention at lower doses
Magnesium glycinate ~14% elemental Good Low Prevention, sensitive gut
Magnesium taurate ~8% elemental Good Low Prevention, cardiac focus
Magnesium threonate ~8% elemental Good, brain-penetrant claim unproven Low Cognitive marketing, weak headache data
Magnesium sulfate (IV) 100% elemental Complete, IV only Rapid blood-pressure drop Acute attack in clinic settings

Read the label carefully, because the numbers above are the reconciliation point: a "400 mg magnesium oxide" capsule delivers about 240 mg elemental magnesium, while a "400 mg magnesium glycinate" capsule delivers only about 56 mg elemental. Those are not the same dose, and the trial doses refer to elemental magnesium.

The time course: what happens hour by hour and week by week

Headache response to magnesium has two distinct clocks, one for acute effect and one for prevention, and confusing them is the most common source of disappointment.

Time after dose or start What is happening What you may notice
15–60 minutes Serum magnesium peaks; mild vasodilation and blood-pressure dip Relaxation, occasionally a dull pressure headache at high doses
2–6 hours Osmotic fluid shift into the bowel begins with oxide and citrate Loose stool, cramping, dehydration-linked headache
24–72 hours Renal clearance restores baseline in healthy kidneys Side effects fade if dose is tolerated
1–2 weeks Tissue and intracellular magnesium begins to rise Little change in attack frequency yet
4–8 weeks Steady-state intracellular loading First measurable drop in attack frequency in responders
8–12 weeks Full trial-equivalent window The 20–40% reduction becomes assessable
12+ weeks Maintenance phase Decide whether benefit justifies continued dose

The practical takeaway from the timeline is that a single dose will not prevent tomorrow's migraine, and judging prevention at two weeks is premature. Conversely, a headache that appears 2–6 hours after a large oxide or citrate dose is most likely the osmotic-dehydration mechanism, not a sign that magnesium "doesn't work" for you.

Who gets headaches from magnesium: edge cases and red flags

Most people tolerate supplemental magnesium without incident, but several groups are at elevated risk of a magnesium-triggered headache or a more serious reaction.

  • Kidney impairment: reduced clearance lets magnesium accumulate, and hypermagnesemia can cause lethargy, flushing, and headache before more serious effects.
  • High-dose oxide or citrate on an empty stomach: the fastest route to osmotic diarrhea and dehydration headache.
  • Concurrent diuretics or proton-pump inhibitors: both alter magnesium handling and can amplify swings.
  • Low baseline blood pressure: magnesium's vasodilatory effect can drop pressure enough to trigger a orthostatic headache.
  • Intravenous magnesium in a clinic: infusion-rate-dependent flushing, warmth, and headache are common and usually rate-related.

Stop magnesium and seek medical advice if you develop muscle weakness, confusion, a slow heartbeat, or a headache that is sudden and severe. Those are not typical supplement side effects and warrant urgent evaluation.

Correcting the misconceptions on both sides

Three claims circulate widely and each is partly wrong.

The first is that everyone with migraine is magnesium deficient. Intracellular magnesium does trend lower in migraine populations, but the overlap with normal controls is large, which is why response to supplementation is partial, not universal.

The second is that magnesium is a proven migraine cure. The trial effect sizes are real but modest, roughly 20–40% fewer attacks, and the strongest guidelines list it as a second-tier or adjunct option rather than first-line monotherapy. Framing it as a cure sets up the disappointment that fuels the "it gave me a headache" reports.

The third is the counterintuitive one: the form marketed as "most absorbable" is not automatically the best headache choice. Magnesium oxide is cheap and poorly absorbed, which sounds bad, yet its poor absorption is exactly why it works for constipation and why it causes diarrhea-linked headaches at high doses. Glycinate absorbs well with less osmotic load, which makes it the better pick for prevention in a sensitive gut, even though its elemental yield per capsule is lower.

What to actually do: a dose and form protocol

If you want to test magnesium for prevention, treat it as a structured 8–12 week trial rather than an open-ended supplement habit.

  1. Choose a well-absorbed form: magnesium glycinate or citrate, targeting 200–400 mg elemental magnesium daily, split into two doses with food.
  2. Read the elemental yield on the label, not the compound weight, and adjust so the total elemental dose matches your target.
  3. Start at half the target dose for the first week to let the gut adapt, then increase.
  4. Track attack frequency and severity in a simple log for 8–12 weeks before judging benefit.
  5. Keep total supplemental intake below 350 mg daily unless a clinician has specifically recommended a higher migraine dose, and never exceed it with kidney disease.
  6. Separate magnesium from high-dose calcium or iron supplements by two hours, since they compete for absorption.

For acute attacks, oral magnesium is not a reliable rescue treatment; the evidence for acute relief is weak and inconsistent. Intravenous magnesium in an emergency or infusion setting is a different intervention with its own rate-dependent side effects.

Limits of the evidence and what remains uncertain

The honest position is that magnesium prevention is plausible, mechanistically supported, and modestly effective in trials, but the evidence base has real gaps. Many trials are small, use different forms and doses, and rely on self-reported attack diaries. The elemental-versus-compound dose confusion makes cross-trial comparison unreliable. Brain magnesium measurement is not clinically available, so we cannot easily identify who will respond.

What is well established: magnesium is essential, low intake is common in Western diets, food sources carry no upper limit risk, and supplemental doses above 350 mg daily raise the risk of GI side effects that can themselves trigger headache. What remains hypothesis: that magnesium threonate meaningfully raises brain magnesium, that magnesium prevents tension-type or cluster headache, and that it outperforms prescription prophylaxis in any subgroup. Until those are settled, magnesium belongs in the adjunct column, dosed by elemental content, trialed for at least 8 weeks, and stopped if GI symptoms or new headaches appear.