Skip to content
Vitamins & Minerals

Magnesium: The Mineral Behind Sleep, Muscles and Mood

Magnesium participates in over 300 enzyme reactions. Low intake is common, and the symptoms are surprisingly wide ranging.

nutrihave 8 min read Updated November 5, 2026
Magnesium-rich foods including pumpkin seeds, almonds, spinach, black beans and dark chocolate

Magnesium rarely gets the spotlight. Yet this quiet mineral is involved in more than 300 enzyme reactions in your body — the chemical steps behind turning food into energy, contracting and relaxing your muscles, keeping your heartbeat steady, and building bone. When you do not get enough of it, the effects can show up in surprisingly ordinary ways: a restless night, a twitching eyelid, a cramp that wakes you at 3 a.m.

The good news is that magnesium is not hard to get from food. It hides in foods many of us already like — nuts, seeds, beans, leafy greens, whole grains, and even dark chocolate. The harder part is knowing how much you need, when a supplement makes sense, and when the claims on a bottle outrun the evidence. This guide sorts that out, with the numbers checked against the National Institutes of Health (NIH) and other primary sources.

What magnesium actually does in your body

Think of magnesium as a backstage worker. It helps stabilise ATP, the molecule your cells use for energy. It works alongside calcium: calcium helps a muscle contract, and magnesium helps it relax afterwards. That partnership is one reason low magnesium is linked to twitches, cramps, and a restless, wired feeling at night.

Magnesium also helps move potassium and calcium across cell membranes, which keeps your heart rhythm steady, and it plays a role in blood sugar control and blood pressure regulation. About half to three-fifths of your body’s magnesium is stored in your bones. None of this makes magnesium a cure for anything on its own — it makes it a foundation, and when the foundation is low, a lot of small things can feel off.

How much magnesium do you need?

The NIH Office of Dietary Supplements sets the recommended dietary allowance (RDA) for adults at 400–420 mg per day for men and 310–320 mg per day for women. Men aged 19–30 need 400 mg and men over 30 need 420 mg; women aged 19–30 need 310 mg and women over 30 need 320 mg. During pregnancy the RDA rises to 350–360 mg. These figures cover total intake from food, drinks, and supplements combined.

There is a second number worth knowing: the tolerable upper intake level (UL) is 350 mg per day — but only for magnesium from supplements and medicines. Magnesium from food has no upper limit for healthy people, because your kidneys remove any excess. So magnesium-rich meals adding up to 500 mg are not a problem; a supplement adding 500 mg on top of your diet is where side effects start to appear.

How common is low intake? The NIH notes that nearly half of Americans consume less magnesium from food than recommended. True deficiency is uncommon in healthy people, because the kidneys conserve magnesium well — but a lot of us run on less than the ideal amount, often because refined grains have replaced whole ones and processed meals crowd out beans, greens, and seeds.

The best food sources of magnesium

Food first is the sensible default, and the numbers make it easy to see why. A single ounce (a small handful) of roasted pumpkin seeds provides roughly 150 mg — nearly half the daily target for many women and more than a third for men. Other everyday sources, from USDA nutrient data:

  • Pumpkin seeds, 1 oz: about 150 mg
  • Cooked spinach, 1 cup: about 157 mg
  • Cooked quinoa, 1 cup: about 118 mg
  • Black beans, 1 cup cooked: about 120 mg
  • Almonds, 1 oz (about 23 nuts): about 80 mg
  • Cashews, 1 oz: about 74 mg
  • Dark chocolate, 1 oz: about 64 mg
Bowl of leafy greens, pumpkin seeds and almonds rich in magnesium

Notice the pattern: the richest sources are plants. Magnesium sits at the centre of the chlorophyll molecule that makes leaves green, so leafy greens are naturally well supplied — and refining grains strips magnesium away, because the bran and germ where most of it lives are removed to make white flour and white rice.

A practical day might look like this: oatmeal with peanut butter at breakfast, a spinach and black bean salad with pumpkin seeds at lunch, and a square or two of dark chocolate after dinner. Add a handful of almonds as a snack and you are already close to the RDA without thinking about supplements.

Read also: Electrolytes Explained: Sodium, Potassium and Magnesium

What low magnesium feels like — and who is most at risk

Early signs of deficiency are frustratingly vague: loss of appetite, nausea, fatigue, and weakness. More severe deficiency can bring numbness and tingling, muscle cramps, and abnormal heart rhythms. None of these symptoms is specific to magnesium, so symptoms alone should never be used to diagnose a deficiency — a clinician can check blood levels and look for an underlying cause instead.

Some people are more likely to run low. Digestive conditions such as Crohn’s disease and coeliac disease reduce absorption, as can intestinal surgery. Type 2 diabetes increases magnesium loss in urine, and regular heavy alcohol use is another common cause. Older adults face a triple hit: they eat less, absorb less, and excrete more. Certain medicines, including some diuretics and long-term proton pump inhibitors, can also lower levels. If any of these apply to you, raise magnesium at your next check-up rather than self-prescribing a high dose.

Magnesium and sleep: what the evidence really shows

Search for magnesium and sleep online and you will find confident promises. The research is more modest than the marketing. Magnesium helps regulate neurotransmitters involved in calming the nervous system, including GABA, and plays a role in melatonin regulation — a plausible mechanism, but plausible is not proven.

The best summary so far is a 2021 systematic review and meta-analysis of three randomised trials in 151 older adults with insomnia. People taking magnesium fell asleep about 17 minutes faster than those on placebo, while total sleep time improved by about 16 minutes — a difference that was not statistically significant. Evidence quality was rated low to very low. In plain terms: magnesium may help some people fall asleep a little faster, especially if they were low to begin with, but it is not a reliable insomnia treatment, and it cannot fix sleep problems caused by late caffeine, an irregular schedule, or chronic stress.

If your diet is low in magnesium and your sleep is light, correcting the gap is a reasonable step alongside basic sleep habits. If your diet already covers magnesium well and you still sleep badly, a supplement is unlikely to be the missing piece.

Calm evening scene with herbal tea and a book, supporting restful sleep

Magnesium, muscles, and cramps

The muscle story follows a similar pattern: real biology, uneven evidence. Because magnesium helps muscles relax after contraction, it is a natural candidate for cramps. But a Cochrane review found magnesium unlikely to provide meaningful relief for leg cramps in older adults, and the evidence for night cramps is weaker than advertising suggests. Cramps have many triggers — dehydration, overuse, prolonged sitting, and certain medicines — and magnesium only helps when low magnesium is actually part of the cause.

That does not make magnesium useless for muscles: people who are genuinely deficient can develop cramps that improve when levels are restored. The honest rule is to check the simple causes first — fluids, stretching, reviewing medicines with your clinician — and not assume a capsule will sort it. Severe, frequent cramps, or cramps with weakness or swelling, should be checked promptly rather than self-treated.

Migraine prevention: the strongest case for a supplement

If one area has the strongest clinical support for magnesium supplementation, it is migraine prevention. The American Academy of Neurology and the American Headache Society rate magnesium as “probably effective” for preventing migraine, at a commonly studied dose of 400–600 mg per day. Small trials have found modest reductions in attack frequency, though results vary.

That dose exceeds the 350 mg supplement upper limit, so it should only be used under a clinician’s supervision. Magnesium is not a substitute for prescribed migraine prevention, and anyone with kidney disease should not self-dose at all, because impaired kidneys cannot clear excess magnesium safely.

Read also: Vitamin D: How Much Do You Actually Need?

Choosing a supplement (if you need one)

Walk into a pharmacy and you will face a wall of forms: oxide, citrate, glycinate, malate, threonate, and more. Magnesium oxide is cheap and widely available, but it is poorly absorbed and the form most often reported to cause diarrhoea. Citrate and glycinate are generally better tolerated and better absorbed, which is why they are the usual recommendations. Threonate is marketed for brain health but has no stronger evidence base for general use, and it costs considerably more.

A few practical rules beat chasing the newest form. First, check the label for elemental magnesium — the actual magnesium, not the compound weight. A 700 mg magnesium glycinate tablet may contain only around 100 mg of elemental magnesium. Second, add up every source: multivitamins, sleep blends, electrolyte powders, and antacids can all contain magnesium, and it is easy to pass the 350 mg supplement limit without realising it. Third, start low and split the dose, since smaller doses are easier on digestion. Finally, separate magnesium from bisphosphonates, levothyroxine, and some antibiotics by at least two hours, because it can block their absorption.

Who should skip self-supplementing? People with kidney disease, anyone taking medicines that affect magnesium levels, and anyone considering a dose above 350 mg a day should talk to a clinician first. Very high doses — typically above 5,000 mg a day from laxatives or antacids — can cause toxicity, so high-dose self-treatment is never casual.

Frequently asked questions

Can I get too much magnesium from food? For healthy people, no. Your kidneys remove excess magnesium from food efficiently, which is why the upper limit applies only to supplements and medicines.

Does magnesium help you sleep? It may help you fall asleep a little faster, particularly if your intake has been low, but the evidence is low quality and the effect is modest — about 17 minutes faster in trials of older adults with insomnia. It is not a proven insomnia treatment.

Should I take magnesium for muscle cramps? Only if low magnesium is likely part of the cause. Evidence that magnesium relieves leg cramps in older adults is weak, so check hydration, stretching, and medicines first, and see a clinician for frequent or severe cramps.

Sources

Disclaimer: This article is for general information only and is not medical advice. If you have kidney disease, take regular medicines, or are considering a magnesium supplement above 350 mg a day, talk to a healthcare professional first.

Written by

nutrihave

Nutrihave contributor focused on evidence-based nutrition education.

View all articles

Leave a comment

Your email address will not be published. Required fields are marked *

Weekly newsletter

One email, one nutrition insight you can use right away

Latest research summaries, practical guides and healthy eating tips. No spam.

<