Magnesium is an essential mineral, but as a supplement it does less for sleep, muscle cramps and exercise than its reputation suggests. For sleep, small trials show a modest benefit at best: older adults with insomnia fell asleep about 17 minutes faster in a pooled analysis of three low-quality trials, and a 2025 trial in adults with poor sleep found a small improvement in insomnia scores. For leg cramps, a Cochrane review concluded that magnesium is unlikely to help older adults with night cramps, and it found no trials at all for exercise-related cramps. For athletes who already get enough, a meta-analysis found no gain in strength or power.
Plenty of Americans still fall short on magnesium from food, and fixing that through diet is a sound goal. This guide covers what the research actually shows, how much you need, the best food sources, how the supplement forms differ, the safe upper limit for supplements, and who should talk to a clinician before taking one.
The evidence at a glance
| Claim | Best evidence | What it found |
|---|---|---|
| Helps you fall asleep | Meta-analysis of 3 trials, 151 older adults with insomnia (2021) | Fell asleep about 17 minutes faster than with placebo; evidence rated low to very low quality |
| Improves poor sleep in younger adults | One randomized trial, 155 adults aged 18–65 (2025) | Small extra improvement in insomnia score after 4 weeks; effect size described as small |
| Prevents night leg cramps | Cochrane review, 11 trials (2020) | No meaningful benefit for older adults; pregnancy results conflicting |
| Prevents exercise cramps | Same Cochrane review | No randomized trials found |
| Boosts strength or power | Meta-analysis of 14 trials (2017) | No significant gains in athletes or active people; possible benefit in people likely to be low |
| Reduces muscle soreness | Systematic review of 4 studies (2024) | Positive findings, but too few small studies to be confident |
Does magnesium help you sleep?
Magnesium is involved in nerve function and muscle contraction, so the idea that it might calm the body before bed is plausible. The question is whether taking a supplement makes a difference you can notice. Here is what the controlled trials show.
Older adults with insomnia
A 2021 systematic review and meta-analysis by Mah and Pitre found only three randomized trials comparing oral magnesium with placebo in older adults with insomnia, with 151 people in total. In the pooled analysis, people taking magnesium fell asleep 17.36 minutes faster than those taking placebo. Total sleep time rose by about 16 minutes, but that difference was not statistically significant.
The authors were blunt about the limits. All three trials were at moderate to high risk of bias, and the evidence was rated low to very low quality. They concluded that the research is "substandard for physicians to make well-informed recommendations," while noting that magnesium is cheap and widely available.
Adults with poor sleep: the 2025 magnesium bisglycinate trial
The largest recent trial tested magnesium bisglycinate, the form often sold as "magnesium glycinate." Schuster and colleagues randomly assigned 155 adults aged 18 to 65 in Germany who reported poor sleep to take either 250 mg of elemental magnesium a day or a placebo for four weeks. Participants took the capsules 30 to 60 minutes before bed.
- Insomnia Severity Index scores fell by 3.9 points with magnesium and 2.3 points with placebo, a difference of 1.6 points on a 28-point scale.
- The authors described the effect as small and the benefit as modest. On average, the magnesium group's scores at week 4 were still in the mild, "subthreshold" insomnia range.
- No other sleep or mood measure differed between the groups, and all outcomes were self-reported. There was no sleep lab or wearable data.
- The daily dose also contained 1,523 mg of glycine, so the trial cannot fully separate the effect of the magnesium from that of the glycine.
An exploratory analysis hinted that people who ate less magnesium-rich food improved more, but the diet question was not validated. That idea still needs testing.
What this means for you
A 2023 systematic review in Biological Trace Element Research sums it up. Observational studies link better magnesium status with better sleep, but randomized trials of supplements show "an uncertain association." Magnesium might nudge sleep a little, especially if your diet is low in it. It is not a substitute for the basics: a consistent schedule, a dark and cool room, and less caffeine late in the day. Our guide on how to sleep better at night naturally covers those habits, and if you train in the afternoon, see how pre-workout caffeine affects your sleep. For chronic insomnia, the 2025 trial's authors note that cognitive behavioral therapy for insomnia (CBT-I) is considered the most effective treatment.
Does magnesium help muscle cramps?
Muscle cramps are one of the most common reasons people buy magnesium. Low magnesium can cause cramps, but that is not the same as supplements preventing everyday cramps in people who are not deficient. The best summary of the evidence is a 2020 Cochrane review by Garrison and colleagues, which included 11 randomized trials with 735 participants.
Night leg cramps in older adults
For cramps with no obvious cause, mostly nighttime leg cramps in people with an average age in their 60s, magnesium did no better than placebo. After four weeks, the number of cramps per week differed by only 0.18 (moderate-certainty evidence). The share of people whose cramps dropped by at least 25% was the same in both groups (high-certainty evidence). Cramp intensity and duration did not differ either. The reviewers concluded it is "unlikely that magnesium supplementation provides clinically meaningful cramp prophylaxis to older adults experiencing skeletal muscle cramps."
Leg cramps in pregnancy
Five trials looked at pregnancy-related leg cramps, but all five were judged at high risk of bias and could not be combined. One found no benefit, one found a benefit, and one had inconsistent results. The review calls this evidence conflicting. Pregnant people should ask their obstetric clinician before taking any supplement.
Cramps during exercise
The review found no randomized trials of magnesium for exercise-associated muscle cramps. So there is no controlled evidence either way for the runner who cramps late in a marathon or the player who cramps in overtime. Magnesium may still be worth trying for some people, but any claim that it prevents exercise cramps goes beyond the evidence.

Side effects in the cramp trials were mostly digestive. Diarrhea and other stomach complaints affected 11% to 37% of people taking oral magnesium, compared with 10% to 14% of people on placebo.
Does magnesium improve exercise performance or recovery?
Magnesium helps produce energy and is needed for normal muscle contraction, so a true deficiency can hurt performance. Extra magnesium on top of an adequate intake is a different question.
- Strength and power: A 2017 meta-analysis of 14 randomized trials (Wang and colleagues) found no significant improvement in peak torque, muscle strength or muscle power. Benefits "were not apparent in athletes and physically active individuals." Any benefit appeared mainly in older adults and people with alcohol dependence, groups more likely to be low in magnesium.
- Soreness and recovery: A 2024 systematic review (Tarsitano and colleagues) reported less muscle soreness and better recovery with magnesium. However, it included only four studies, so it is a weak basis for buying a recovery supplement. For managing soreness, see our guide on whether to work out when you're sore.
The practical takeaway for active people is to make sure your diet covers the recommended amount, because that is where the evidence for benefit lies. Magnesium is not a proven performance booster.
How much magnesium do you need?
The Recommended Dietary Allowance (RDA) covers magnesium from all sources: food, drinks, supplements and medicines. These figures come from the Food and Nutrition Board, as listed in the NIH Office of Dietary Supplements fact sheet.
| Age | Men | Women | Pregnancy | Breastfeeding |
|---|---|---|---|---|
| 14–18 years | 410 mg | 360 mg | 400 mg | 360 mg |
| 19–30 years | 400 mg | 310 mg | 350 mg | 310 mg |
| 31–50 years | 420 mg | 320 mg | 360 mg | 320 mg |
| 51 years and older | 420 mg | 320 mg | – | – |
For children, the RDA is 80 mg at ages 1 to 3, 130 mg at ages 4 to 8 and 240 mg at ages 9 to 13. The Daily Value (DV) on US food and supplement labels is 420 mg for adults and children 4 and older.
Many Americans fall short. In national survey data from 2013 to 2016, 48% of Americans ate and drank less magnesium than their estimated average requirement. Adolescents and men aged 71 and older were the most likely to have low intakes. Older adults, people with type 2 diabetes, people with gut conditions such as Crohn's or celiac disease, and people with alcohol dependence are also at higher risk of running low, according to NIH.
The upper limit for supplements: 350 mg
The Tolerable Upper Intake Level (UL) for adults and teens 14 and older is 350 mg a day from supplements and medicines. It is 65 mg at ages 1 to 3, 110 mg at ages 4 to 8 and 350 mg at ages 9 to 13. The UL does not include magnesium naturally present in food and drinks. That is why the UL can be lower than the RDA: healthy kidneys clear extra magnesium from food, but large supplemental doses cause diarrhea.
Count everything you take. Some laxatives and antacids contain magnesium, and some multivitamins and "sleep" or "recovery" blends do too.
Best food sources of magnesium
Green leafy vegetables, legumes, nuts, seeds and whole grains are the best sources. In general, foods with fiber tend to contain magnesium, while refining grains strips much of it out. The amounts below come from the NIH fact sheet, which uses USDA FoodData Central data.
| Food and serving | Magnesium | % Daily Value |
|---|---|---|
| Pumpkin seeds, roasted, 1 ounce | 156 mg | 37% |
| Chia seeds, 1 ounce | 111 mg | 26% |
| Almonds, dry roasted, 1 ounce | 80 mg | 19% |
| Spinach, boiled, ½ cup | 78 mg | 19% |
| Cashews, dry roasted, 1 ounce | 74 mg | 18% |
| Peanuts, oil roasted, ¼ cup | 63 mg | 15% |
| Shredded wheat cereal, 2 large biscuits | 61 mg | 15% |
| Soymilk, plain or vanilla, 1 cup | 61 mg | 15% |
| Black beans, cooked, ½ cup | 60 mg | 14% |
| Edamame, shelled, cooked, ½ cup | 50 mg | 12% |
| Peanut butter, smooth, 2 tablespoons | 49 mg | 12% |
| Potato, baked with skin, 3.5 ounces | 43 mg | 10% |
| Brown rice, cooked, ½ cup | 42 mg | 10% |
| Yogurt, plain, low fat, 8 ounces | 42 mg | 10% |
| Banana, 1 medium | 32 mg | 8% |
| White rice, cooked, ½ cup | 10 mg | 2% |
A day that includes an ounce of pumpkin seeds, half a cup of black beans, a cup of soymilk and a serving of brown rice adds up to about 319 mg, before counting anything else you eat. Tap, mineral and bottled water can add more. NIH says the amount varies widely, from 1 mg to more than 120 mg per liter depending on the source. About 30% to 40% of the magnesium in food is absorbed.

For more on these foods, see our guides to pumpkin seed nutrition and micronutrients and what they do.
Magnesium glycinate vs citrate vs oxide: does the form matter?
Supplements pair magnesium with another compound, and the Supplement Facts label lists the amount of elemental magnesium, not the weight of the whole compound. Compare products by that number.
- Absorption: NIH says forms that dissolve well in liquid are absorbed more completely. Small studies found the aspartate, citrate, lactate and chloride forms more bioavailable than magnesium oxide and sulfate.
- Stomach upset: NIH lists magnesium carbonate, chloride, gluconate and oxide as the forms most often reported to cause diarrhea.
- Glycinate (bisglycinate): The NIH fact sheet does not rate this form. It is the form used in the 2025 sleep trial above, where it was well tolerated: participants reported 2 adverse events with magnesium and 7 with placebo, and none were serious. We found no head-to-head trial showing that glycinate improves sleep more than other forms, so claims that one form is "best for sleep" go beyond the research.
Better absorption is not automatically better. A form that is absorbed well also puts more magnesium into your bloodstream, which matters if your kidneys do not work well.
Side effects and who should talk to a clinician first
Magnesium from food is not a concern for healthy people. Supplements and medicines are different:
- Common side effects: High doses from supplements or medicines often cause diarrhea, sometimes with nausea and stomach cramps.
- Toxicity: Very large doses, usually from laxatives and antacids that provide more than 5,000 mg a day, have caused magnesium toxicity. Symptoms include low blood pressure, nausea, vomiting, facial flushing, muscle weakness, difficulty breathing and irregular heartbeat, and deaths have been reported.
- Kidney disease: The risk of toxicity rises when kidney function is reduced, because the kidneys are what remove extra magnesium. Don't take magnesium supplements without your doctor's advice if you have kidney disease.
NIH lists these medication interactions. If you take any of these drugs regularly, talk to your doctor or pharmacist before adding magnesium:
| Medicine | Examples | What NIH says |
|---|---|---|
| Oral bisphosphonates (osteoporosis) | Alendronate | Magnesium can reduce absorption; separate doses by at least 2 hours |
| Tetracycline and quinolone antibiotics | Doxycycline, ciprofloxacin, levofloxacin | Take the antibiotic at least 2 hours before or 4 to 6 hours after magnesium |
| Loop and thiazide diuretics | Furosemide, bumetanide, hydrochlorothiazide | Long-term use can deplete magnesium |
| Potassium-sparing diuretics | Amiloride, spironolactone | Reduce magnesium loss in urine |
| Proton pump inhibitors (long-term) | Esomeprazole, lansoprazole | Use for more than about a year can cause low magnesium; FDA advises clinicians to consider checking levels |
Also check with a clinician if you are pregnant or breastfeeding, or if cramps are frequent or severe or come with weakness, swelling or numbness. A supplement won't fix those problems. And if you are thinking about the higher doses sometimes used for migraine prevention, note that they exceed the UL. NIH says that kind of use should be supervised by a health care provider.
If you want to try magnesium: a practical checklist
- Start with food. Check your diet against the table above. Seeds, nuts, beans, leafy greens and whole grains are the low-risk way to close a gap.
- Stay at or under 350 mg from supplements unless a clinician advises otherwise, and add up every product that contains magnesium.
- Read the elemental magnesium amount on the Supplement Facts panel, not the compound weight.
- Set realistic expectations. In the best trials, the sleep benefit was modest and showed up over weeks, not overnight. Don't expect it to stop exercise cramps.
- Back off if you get diarrhea. It is the most common sign that the dose is too high or the form doesn't suit you.
- Check with a clinician or pharmacist first if you have kidney disease, take any of the medicines above, or are pregnant.
FAQ
Is it safe to take magnesium every night?
For most healthy adults, a supplement that keeps total supplemental magnesium at or below 350 mg a day is within the upper limit set for daily use. The 2025 sleep trial gave 250 mg nightly for four weeks without serious side effects. People with kidney disease, or who take the interacting medicines listed above, should ask a clinician first.
Is magnesium glycinate better for sleep than magnesium citrate?
There is no head-to-head evidence to say so. The most recent positive sleep trial used bisglycinate, but it did not compare forms, and its dose included a large amount of glycine. Citrate is among the forms NIH describes as better absorbed than oxide, but no trial has shown that this translates into better sleep.
Should athletes take magnesium?
Athletes should meet the RDA, ideally through food. Trials have not shown that extra magnesium boosts strength or power in active people who already get enough. Heavy training, restrictive diets or medical conditions can change that picture, so talk to a sports dietitian or physician if you think you are low. Standard blood tests don't reliably show total body magnesium, so it is not a simple thing to check.
Why do I get leg cramps at night?
Muscle cramps are common and often linked with older age, pregnancy or exercise. Most have no obvious underlying cause, and the Cochrane review suggests magnesium is unlikely to prevent night cramps in older adults. If cramps are frequent or disrupt your sleep, ask your doctor to look for a cause.
This article is general information, not medical advice. It isn't a substitute for advice from a doctor, pharmacist or other qualified health professional, especially if you have a medical condition, take prescription medicines, or are pregnant.
Sources
- NIH Office of Dietary Supplements: Magnesium Fact Sheet for Health Professionals (updated January 6, 2026).
- Garrison SR, Korownyk CS, Kolber MR, et al. Magnesium for skeletal muscle cramps, Cochrane Database of Systematic Reviews 2020;9:CD009402 (full text).
- Mah J, Pitre T. Oral magnesium supplementation for insomnia in older adults: a Systematic Review & Meta-Analysis, BMC Complementary Medicine and Therapies 2021;21:125 (full text).
- Schuster J, Cycelskij I, Lopresti A, Hahn A. Magnesium Bisglycinate Supplementation in Healthy Adults Reporting Poor Sleep: A Randomized, Placebo-Controlled Trial, Nature and Science of Sleep 2025;17:2027–2040 (full text).
- Arab A, Rafie N, Amani R, Shirani F. The Role of Magnesium in Sleep Health: a Systematic Review of Available Literature, Biological Trace Element Research 2023;201(1):121–128.
- Wang R, Chen C, Liu W, et al. The effect of magnesium supplementation on muscle fitness: a meta-analysis and systematic review, Magnesium Research 2017;30(4):120–132.
- Tarsitano MG, Quinzi F, Folino K, et al. Effects of magnesium supplementation on muscle soreness in different type of physical activities: a systematic review, Journal of Translational Medicine 2024;22:629.
- Banner photo: Nuts on Spice Bazaar in Istanbul 01.jpg by Miomir Magdevski, CC BY-SA 4.0, via Wikimedia Commons (cropped).
- Photo: 091025-M-1318S-2686 (4044132405).jpg by U.S. Marine Corps (Marines from Arlington, VA), public domain, via Wikimedia Commons (cropped).
- Photo: Portrait of a Bowl of Pumpkin Seeds.jpg by Christopher Sessums, CC BY-SA 2.0, via Wikimedia Commons (cropped).