Magnesium is good for inflammation and pain, but it is not a cure-all. Research shows that magnesium plays a real role in how your body regulates inflammation, and low levels are linked to higher levels of inflammatory markers. For pain, the evidence is strongest for specific conditions like migraines and menstrual cramps, where magnesium supplementation has shown measurable benefits. For other types of pain, the picture is more mixed, and magnesium works best as part of a broader treatment plan rather than a standalone fix.
How Does Magnesium Affect Inflammation in the Body?
Magnesium is involved in hundreds of biochemical reactions, and several of them directly influence inflammation. One of the clearest links is through the stress hormone cortisol. When magnesium levels are low, cortisol can rise, which triggers a cascade of inflammatory activity.
Research consistently shows that people with low magnesium levels tend to have higher blood levels of inflammatory markers like C-reactive protein (CRP). CRP is a protein your liver makes in response to inflammation, and it is one of the most commonly measured markers in clinical medicine. Some studies have found that correcting a magnesium deficiency can lower CRP levels, though the effect is modest.
There is also a connection between magnesium and a molecule called nuclear factor kappa B, or NF-κB. This molecule acts like a switch that turns on inflammatory genes in your cells. In laboratory studies, higher magnesium levels appear to keep that switch from flipping on as easily. This is a well-established mechanism in cell biology, though it is important to note that laboratory findings do not always translate directly to dramatic clinical effects in humans.
What this means in practical terms is that if you are deficient in magnesium, correcting that deficiency may help reduce background inflammation. If your magnesium levels are already normal, taking more is unlikely to produce a large additional anti-inflammatory effect.
What Types of Pain Does Magnesium Help With?
The strongest clinical evidence for magnesium and pain relief is in two specific areas: migraines and menstrual cramps.
For migraines, magnesium has been studied for decades. Some research suggests that people who get migraines are more likely to have low magnesium levels, and that supplementation can reduce the frequency of migraine attacks. The American Headache Society includes magnesium in its list of preventive treatments for migraine, though it is not the first-line therapy for everyone. The evidence is strongest for a specific form called magnesium oxide, though other forms have also been studied.
For menstrual cramps, known medically as dysmenorrhea, magnesium appears to help by relaxing the smooth muscle of the uterus. Several clinical trials have found that magnesium supplementation reduces pain intensity in women with menstrual cramps, though the effect varies between studies. Some research suggests magnesium works best when combined with other treatments like nonsteroidal anti-inflammatory drugs (NSAIDs).
For other types of pain, the evidence is weaker. Studies on magnesium for chronic low back pain, fibromyalgia, and arthritis have produced mixed results. Some patients report improvement, but clinical trials have not consistently confirmed a strong benefit. This does not mean magnesium does not help some people with these conditions, but it means the evidence does not support recommending it as a primary treatment.
Is Magnesium Deficiency Common?
Magnesium deficiency is more common than most people realize, but true severe deficiency is rare. The distinction matters because the health effects are different.
Severe magnesium deficiency, defined as blood levels below roughly 1.7 mg/dL, can cause muscle spasms, abnormal heart rhythms, and seizures. This requires medical attention and is usually related to a specific medical condition or medication, not just diet.
Marginal or subclinical deficiency is much more common. Many experts estimate that a significant portion of the US population does not meet the recommended daily intake for magnesium, which is 400–420 mg per day for adult men and 310–320 mg per day for adult women. The National Health and Nutrition Examination Survey (NHANES) data has consistently shown that many Americans fall short of these targets.
Several factors make deficiency more likely. Gastrointestinal conditions like Crohn’s disease and celiac disease impair absorption. Type 2 diabetes increases magnesium loss through urine. Certain medications, including proton pump inhibitors used for acid reflux and some diuretics, can also deplete magnesium over time. Older adults tend to absorb less magnesium and excrete more, which is why deficiency becomes more common with age.
Alcohol use is another major factor. Alcohol increases magnesium excretion through the kidneys, and people with alcohol use disorder frequently have low magnesium levels.
What Is the Best Form of Magnesium to Take?
If you decide to supplement, the form matters. Magnesium is always bound to another molecule, and that molecule affects both absorption and tolerability.
Magnesium citrate is one of the most common forms and is generally well absorbed. It has a mild laxative effect, which some people find helpful and others find unpleasant. Magnesium glycinate is bound to the amino acid glycine and is often better tolerated, with less digestive upset. It is frequently recommended for people using magnesium for sleep or anxiety-related issues, though the evidence for these uses is not as strong as the evidence for migraines.
Magnesium oxide is the form most often used in migraine studies, but it is poorly absorbed compared to other forms. It is also the form most likely to cause digestive side effects. Magnesium chloride is well absorbed and is sometimes used in topical products, though there is limited evidence that topical magnesium is absorbed well enough to raise blood levels significantly.
Magnesium L-threonate is a newer form that has been studied for its ability to cross the blood-brain barrier. Some research suggests it may be beneficial for cognitive function, but the evidence for pain and inflammation is limited.
For most people, magnesium citrate or glycinate at a dose of 200–400 mg per day is a reasonable starting point. It is generally best to start at a lower dose and increase gradually to minimize digestive side effects. Taking magnesium with food can also reduce stomach upset.
Can You Get Enough Magnesium From Food?
Yes, but it takes intention. The foods highest in magnesium are not the foods most Americans eat regularly.
Pumpkin seeds are one of the richest sources, providing roughly 150 mg per ounce. Almonds, cashews, and peanuts are also good sources. Dark leafy greens like spinach and Swiss chard are high in magnesium, though the amount varies based on soil quality and preparation. Cooking spinach reduces its volume significantly, so a cup of cooked spinach contains more magnesium than a cup of raw spinach.
Other good sources include black beans, edamame, and other legumes. Whole grains like quinoa and brown rice contain magnesium, but refined grains lose most of their magnesium during processing. This is why the shift toward refined carbohydrates in the American diet is one reason magnesium intake has declined over time.
Dark chocolate is also a legitimate source, with about 65 mg per ounce in 70–85% cacao varieties. It is not a primary source, but it can contribute to daily intake.
Hard water can also contain magnesium, which is one reason tap water can be a meaningful source in some areas. Bottled and filtered water often removes these minerals.
Are There Risks to Taking Magnesium Supplements?
Magnesium is generally safe for healthy people, but there are important precautions.
The most common side effects are digestive: diarrhea, nausea, and cramping. These are more likely with poorly absorbed forms like magnesium oxide and at higher doses. The National Institutes of Health notes that diarrhea is the most common adverse effect of oral magnesium supplements.
More serious risks are rare but real. People with kidney disease cannot excrete magnesium normally, and supplementation can lead to dangerously high blood levels. People with heart block or other conduction disorders should also be cautious, as magnesium can affect heart rhythm.
Magnesium can interact with several medications. It can reduce the absorption of certain antibiotics, including tetracyclines and fluoroquinolones, so it should be taken at least two hours apart from these drugs. It can also interfere with bisphosphonates used for osteoporosis and with some thyroid medications. People taking medications for high blood pressure should monitor their blood pressure carefully, as magnesium can add to the blood pressure-lowering effect.
There is a specific concern about magnesium and muscle relaxants. Magnesium can enhance the effects of these drugs, potentially causing excessive muscle weakness. This is why magnesium sulfate is sometimes used intravenously in hospitals to treat severe muscle spasms.
The upper limit for magnesium from supplements is 350 mg per day for adults, according to the National Institutes of Health. This limit applies only to supplements, not to magnesium from food. Exceeding this limit without medical supervision increases the risk of side effects.
Should You Get Your Magnesium Levels Tested?
Standard blood tests for magnesium are not always reliable. Most magnesium in the body is stored inside cells or in bone, and only about 1% is in the blood. A standard serum magnesium test can miss a deficiency because blood levels are maintained at the expense of cellular stores.
More sensitive tests, like the red blood cell magnesium test or the magnesium load test, can provide a better picture, but they are not routinely ordered. They are also not covered by all insurance plans.
For most people, the more practical approach is to look at symptoms and risk factors. Chronic fatigue, muscle cramps, and poor sleep are sometimes associated with low magnesium, but these symptoms are nonspecific and can have many causes. A better approach is to assess your dietary intake and your risk factors for deficiency, then decide whether supplementation is worth trying.
If you have kidney disease, heart problems, or take medications that interact with magnesium, talk to your doctor before supplementing. For everyone else, a trial of 200–400 mg per day for several weeks is a reasonable approach, with attention to whether symptoms improve.
Frequently Asked Questions
How long does magnesium take to reduce inflammation?
There is no fixed timeline because the evidence does not support a specific duration. Some studies show changes in inflammatory markers within weeks, but the effect is modest and varies by individual.
Is magnesium better for muscle pain or joint pain?
The evidence is stronger for muscle-related pain, particularly muscle cramps, than for joint pain from arthritis. Joint pain involves different inflammatory pathways that magnesium does not directly target as effectively.
Can I take magnesium with ibuprofen for pain?
Yes, magnesium and ibuprofen are generally safe to take together, though they should be taken at different times to avoid digestive upset. Some research even suggests magnesium may enhance the pain-relieving effects of NSAIDs, but this is not firmly established.
What is the best time of day to take magnesium?
There is no strong evidence that timing matters for inflammation or pain. Taking it with food in the evening is a common recommendation because it may help with sleep and reduces the chance of digestive side effects.

