Quick Answer
Magnesium deficiency is common and linked to migraine, anxiety, muscle cramps and poor sleep. Food sources and supplementation can help — here's what the evidence shows.
Medically reviewed by Dr. Jitendra Prasad Yadav • NMC 8029 • Kathmandu Neurology Clinic & Cognitive Center
Magnesium is involved in over 300 enzymatic reactions in the body, including nerve transmission, muscle contraction, and neurotransmitter regulation. Despite its importance, magnesium deficiency is remarkably common — especially in people with poor diet, diabetes, digestive disorders, or those taking certain medications.
Magnesium and the nervous system
Magnesium acts as a natural calcium channel blocker in neurons — it helps regulate the excitability of nerve cells. It is required for the production and function of neurotransmitters including serotonin, dopamine and GABA. Low magnesium increases neuronal excitability, which may contribute to migraine, anxiety, muscle cramps and even seizures in susceptible individuals.
Signs of magnesium deficiency
- Muscle cramps and spasms (especially at night)
- Twitching or eyelid spasms
- Fatigue and weakness
- Anxiety and irritability
- Poor sleep
- Headaches and migraines
- Numbness and tingling
- Irregular heartbeat
Magnesium and specific conditions
- Migraine: some evidence suggests magnesium supplementation may reduce migraine frequency — particularly for menstrual migraine and migraine with aura.
- Anxiety: magnesium has calming effects on the nervous system and may reduce anxiety symptoms.
- Sleep: magnesium supports GABA function and may improve sleep quality.
- RLS: magnesium deficiency is associated with restless legs syndrome.
- Epilepsy: severe magnesium deficiency can lower seizure threshold.
Food sources vs supplements
Good dietary sources include: leafy greens (spinach, kale), nuts and seeds (almonds, pumpkin seeds, cashews), legumes, whole grains, dark chocolate, avocados and bananas. For supplementation, magnesium glycinate or citrate are well-absorbed forms. Avoid magnesium oxide (poorly absorbed). Typical dose: 200–400mg elemental magnesium daily. High doses can cause diarrhea.
When to consider magnesium
If you have migraines, anxiety, muscle cramps, poor sleep or RLS — magnesium supplementation is a reasonable, low-risk intervention to discuss with your doctor. It's not a replacement for established treatments but may provide adjunctive benefit. At Kathmandu Neurology Clinic, we consider magnesium status in patients with relevant neurological symptoms.
When to seek professional evaluation
Magnesium supplementation is a reasonable adjunct for migraine, anxiety and sleep — discuss dosing with your doctor, especially if you take other medications.
This guide is educational and does not replace individual medical advice.
Frequently asked questions
Answers reviewed by Dr. Jitendra Prasad Yadav • MBBS, MD (Internal Medicine), FICN (Neurology), FCNV, FIHM • NMC 8029
Migraine is a neurological condition; headache is one feature. Associated symptoms and functional impact are important for diagnosis.
Aura refers to visual, sensory, or speech symptoms that precede the headache in some people. Both types are migraine; the presence of aura may influence management discussion.
Normal worry is proportional, time-limited, and about specific issues. In GAD, worry is excessive, persistent, and about multiple topics, and it causes significant distress or functional impairment.
Yes. CBT and SSRIs/SNRIs are effective treatments with response rates of 50-70%. Many individuals achieve substantial symptom reduction with appropriate care.
Migraine typically presents as moderate-severe throbbing headache with nausea and/or sensitivity to light or sound, worsened by routine activity. Duration 4–72 hours. Dr. Jitendra Prasad Yadav (NMC 8029) uses ICHD-3 criteria plus your headache diary (frequency, aura, medication days) and red-flag screen to distinguish …
Yes. Short or fragmented sleep impairs memory consolidation and lowers migraine threshold. Snoring with apneas fragments sleep and fragments cognition. Dr. Jitendra screens sleep duration, regularity, snoring and caffeine, and refers for sleep study when indicated — often before escalating headache or memory medicines.
More: All FAQs → · Ask Dr. Jitendra →
Related articles
Caffeine and Neurological Health: How Much Is Too Much?
Caffeine's effects on the brain: benefits for alertness, risks for migraine and anxiety, safe limits, and why withdrawal headaches happen.
Magnesium for Sleep and Brain Health: Forms, Doses and Evidence
Magnesium deficiency is common and affects sleep and brain function — which forms work best for sleep and neurological health.
Shift Work and Neurological Health: Managing Your Body Clock
How night and rotating shifts disrupt the brain and nervous system — and practical strategies to protect sleep, mood and headache control.
Medical Disclaimer
Content on this website is for general educational purposes only and does not constitute medical advice, diagnosis, or treatment. It is not a substitute for evaluation by a qualified healthcare professional. Always seek the advice of your physician or other qualified provider with any questions regarding a medical condition. Never disregard professional medical advice or delay seeking it because of something you have read on this website. In case of a medical emergency, contact emergency services immediately. No doctor–patient relationship is established by use of this site or by contacting the clinic through the site.
References & Review
Reviewed by Dr. Jitendra Prasad Yadav • Last reviewed: 2026-11-10
- International Classification of Headache Disorders, 3rd edition (ICHD-3).
- Harrison's Principles of Internal Medicine — Neurology sections.
- American Academy of Neurology guidelines for selected conditions (where applicable).
Content is educational and aligns with standard medical references; individual evaluation may vary. External links provide context and do not imply endorsement.