01 Nov calcium and magnesium balance
Updated April 3, 2026.
If you’ve been diagnosed with costochondritis, you’ve probably already discovered that conventional medicine doesn’t have a great deal to offer beyond rest, anti-inflammatories and reassurance that it will eventually pass. For some people it does pass quickly. For others — and I understand there are many of them — it lingers for months or years, cycling in and out, disrupting sleep, making breathing uncomfortable and generally making life harder than it needs to be.
As a nutritionist, I’m often asked about the role of magnesium and diet in managing costochondritis. It’s a question worth taking seriously, because the research — while not definitive — is genuinely interesting. This article is my attempt to give you an honest, evidence-based overview of what we know, what we don’t know, and what a nutritional approach to costochondritis actually looks like in practice.
Please note: this article is for informational purposes only and does not constitute medical advice. If you are experiencing chest pain, always seek medical assessment first to rule out cardiac causes. Work with your healthcare provider before making changes to supplements or medications.
Calcium and magnesium balance
Calcium and magnesium are both essential minerals that function as electrolytes within the body. This means they help transmit electrical impulses between nerve and muscle cells. They also help balance the amount of fluid inside and outside of cells. (1) Calcium orotate is thought to be a helpful treatment for costochondritis.
You are telling me!!! Have you ever suffered from costochondritis? It is the most bizarre kind of chest pain and electrical spasms in the chest area. Specifically the rib cage area on the onset of sleep. Last night I thought: ‘it is calcium’ however, I have since realised that it could also be magnesium, a deficiency of which may have been caused by taking a calcium supplement.
The aim of this post is to find out what the interaction between calcium and magnesium is and if this chest phenomenon which I assume is costochondritis is due to a lack of calcium or a lack of magnesium.
What is costochondritis?
Costochondritis is inflammation of the cartilage that connects the ribs to the breastbone (sternum). It causes chest pain — sometimes sharp, sometimes a dull ache — that typically worsens with movement, deep breathing, coughing or pressure on the chest. It’s more common than most people realise: research suggests that around 30% of people who present to emergency departments with chest pain are ultimately diagnosed with costochondritis.
The cause is often unknown. Strain, repetitive movement, viral infections, chronic inflammation and postural issues have all been proposed as contributing factors. What makes it particularly frustrating is that it can be difficult to treat, tends to recur, and is frequently dismissed as something that will simply go away on its own — which isn’t always true.
What causes costochondritis?
Firstly, most sources on the web suggest that this ailment does not have a cause. However, some medical professionals suggest that costochondritis can be caused by a lack of magnesium, and can be treated particularly well with magnesium orotate.
It did the trick for me last night. After ingesting the last of these supplements with a calcium supplement, the pain reduced to a slight buzzing sensation.
Other anecdotal evidence suggests that when you are not consuming enough calcium this can create pain in your sternum, especially before sleep. For this reason, you may want to monitor how much calcium you are getting in your food to make sure you are getting enough. (1000 g for adults under 50 years and 1300 mg per day for women over 50).
The Vitamin D Connection
One of the more compelling areas of research involves vitamin D deficiency and its relationship to costochondritis. This is an area where the evidence has grown steadily over the past decade.
A published case report proposed that vitamin D deficiency may be related to chest pain associated with costochondritis, and recommended that physicians consider testing and treating for vitamin D deficiency in patients with the condition. [2] This was followed by a larger observational study of 100 patients with costochondral tenderness which found that prolonged duration of chest pain was significantly associated with low vitamin D levels, with the association being statistically significant [3].
The biological mechanism makes sense. Vitamin D has an anti-inflammatory effect mediated by reduced cytokine and prostaglandin release, with effects on T-cell responses. In other words, vitamin D doesn’t just support bone health — it actively modulates the immune system’s inflammatory response. When levels are low, that modulating effect is reduced, and inflammation can become more persistent.
In patients with vitamin D deficiency, pain sensation increased due to a lack of the vitamin’s anti-inflammatory effect and its influence on nerve function.
For anyone living in southern Australia, vitamin D deficiency is more common than most people expect — particularly through the winter months when sun exposure is limited. If you have costochondritis and haven’t had your vitamin D levels tested, it’s a straightforward blood test worth requesting from your GP. If deficiency is identified, supplementation under medical supervision is a reasonable and well-supported intervention.
Magnesium for costochondritis
Magnesium’s role in muscle function is particularly relevant to costochondritis. Magnesium is well known for its ability to relax muscles and reduce tension and stiffness — which makes it potentially useful for costochondritis, a condition that often involves significant tension and discomfort in the chest area.
A 2025 systematic review and meta-analysis examining magnesium’s role in oxidative stress and inflammation found that magnesium plays a crucial role in over 300 enzymatic reactions related to energy production, muscle contraction and nerve function, and that supplementation showed measurable effects on inflammatory biomarkers. [4]
It’s important to be honest about the limits of the evidence here. There are no large randomised controlled trials specifically examining magnesium supplementation for costochondritis — the condition is simply not well-studied in this way. What we have is strong mechanistic evidence (magnesium reduces inflammation and muscle tension) and clinical observation (many practitioners report benefit in their patients) that magnesium for costochondritis is helpful. That’s worth something, but it’s not the same as definitive proof.
What we can say with confidence is that magnesium deficiency is common — driven by inadequate dietary intake, chronic diseases, medication use and lifestyle factors [5] — and that the consequences of deficiency include chronic inflammation and impaired muscle function. Correcting a deficiency is sensible regardless of whether costochondritis is your primary concern.
Food sources of magnesium include: dark leafy greens (spinach, silverbeet), pumpkin seeds, almonds, dark chocolate, legumes, whole grains, avocado and — conveniently — the fatty fish that also provide anti-inflammatory omega-3s.
What is the relationship between calcium and magnesium?
It would seem across the web literature at least that it is very important to make sure that you are getting enough magnesium if you plan on taking a calcium supplement. And that taking calcium without sufficient levels of magnesium can lead to worse problems.
Magnesium affects the transport of calcium across cell membranes. [1] Furthermore, studies have shown that if magnesium levels are low, taking a calcium supplement can reduce magnesium absorption and retention. [6]
How much magnesium do you need every day?
Adult men ages 19 to 30 need 400 mg of magnesium per day. While men 31 or older need 420 mg per day. Women between the ages of 19 and 30 should intake 310 mg of magnesium per day. While those over 30 should increase their intake to 320 mg per day. (1) Here are some ways to get magnesium from your diet.
Calcium and magnesium balance
One thing that is not commonly mentioned in the scientific literature, but which is extremely helpful in my experience is making sure that you have enough calcium in your diet. I would not recommend taking calcium supplements as these have risks that may outweigh the benefits, however, eating calcium rich foods such as fortified milks, yoghurt, cheeses such as Gouda and other cheeses as well as a whole plethora of plant based calcium sources may serve to provide relief from costochondritis.
Vitamin D also plays a part in calcium absorption. So , this may be another reason why it is important to get enough vitamin D, a mentioned above.
Anti-Inflammatory Eating and Costochondritis
Because costochondritis is fundamentally an inflammatory condition, an anti-inflammatory dietary approach makes intuitive sense — even if direct research on diet and costochondritis specifically is limited.
The general principles of anti-inflammatory eating are well-established and align closely with broader evidence for reducing systemic inflammation:
Prioritise omega-3 fatty acids. Fatty fish (salmon, sardines, mackerel, anchovies), walnuts, flaxseeds and chia seeds are all rich in omega-3s, which have well-documented anti-inflammatory properties. Sardines in particular are worth mentioning — cheap, sustainable, and genuinely one of the most anti-inflammatory foods available.
Include turmeric and ginger regularly. Curcumin, the active compound in turmeric, has strong evidence behind it as an anti-inflammatory agent. Ginger contains gingerols with similar properties. These aren’t miracle cures, but incorporating them into everyday cooking is a low-cost, low-risk intervention with good biological plausibility.
Eat plenty of colourful vegetables. Berries, leafy greens, broccoli, capsicum, tomatoes and beetroot all provide antioxidants that reduce oxidative stress — a key driver of chronic inflammation. Aim for variety and colour.
Reduce ultra-processed foods and refined sugars. These are consistent drivers of systemic inflammation and should be minimised. This doesn’t mean an all-or-nothing approach — but if your diet is high in processed foods, reducing them is likely to have a meaningful impact on your inflammatory load over time.
Consider gut health. The gut microbiome plays a significant role in immune regulation and systemic inflammation. Fermented foods (yoghurt, kefir, kimchi, sauerkraut), prebiotic-rich foods (oats, garlic, onion, leeks, asparagus) and a high-fibre diet all support a healthy microbiome.
What About Other Supplements?
Beyond magnesium and vitamin D, a few other nutrients are worth considering if you have costochondritis:
Omega-3 supplements (fish oil) — well-supported for reducing systemic inflammation. If you don’t eat fatty fish regularly, a quality fish oil supplement is reasonable.
Glucosamine and chondroitin — these compounds support cartilage health and joint integrity. Evidence for their effectiveness is mixed but some people with costochondritis report benefit, which makes sense given the cartilaginous nature of the condition.
Vitamin C — essential for collagen synthesis and cartilage repair. Found abundantly in capsicum, citrus, kiwi fruit and broccoli. Deficiency is uncommon in people eating a varied diet but worth considering.
Probiotics — emerging evidence links gut health to immune regulation and inflammation. If you’ve used antibiotics recently or have other signs of gut dysbiosis, a quality probiotic supplement may be supportive.
A Practical Starting Point
Rather than overhauling everything at once, here’s a simple starting framework:
Get your vitamin D, calcium and magnesium status assessed. A basic blood test through your GP will tell you whether deficiency is contributing to your symptoms. If it is, targeted supplementation under medical supervision is a well-evidenced first step.
Increase oily fish, leafy greens, nuts and seeds in your everyday eating. These provide both magnesium and anti-inflammatory omega-3s, and the cost is low — sardines on toast is genuinely one of the most nutritionally dense and affordable meals you can eat.
Reduce your intake of ultra-processed foods and refined sugars. Not perfectly, not immediately, but consistently over time.
Consider adding turmeric to your cooking daily. Golden milk, curries, scrambled eggs, soups — it’s versatile and the evidence for its anti-inflammatory effects is solid.
Keep a simple symptom diary. Nutritional interventions for inflammatory conditions often take weeks to show effect. Tracking your symptoms alongside dietary changes helps you see patterns that are otherwise easy to miss.
The Bottom Line
There is no nutritional cure for costochondritis, and anyone telling you otherwise is overstating the evidence. What the research does support is that vitamin D deficiency has a meaningful association with the condition, that magnesium plays an important role in muscle relaxation and inflammation, that a deficiency in calcium may cause costochondritis type symptoms, and that an anti-inflammatory dietary pattern is a sensible and low-risk approach to managing chronic inflammation of any kind.
This article was written by Sarah James, Qualified Nutritionist. It is intended as general health information only and does not replace individualised medical or nutritional advice. Always consult your healthcare provider before beginning any new supplement regimen.
References
1. Stephanie Chandler. Can Calcium be absorbed without magnesium? [Internet] Livestrong.com; 2013; [Accessed 2013 Nov 1] Available from: https://www.livestrong.com/article/444390-can-calcium-be-absorbed-without-magnesium/
2. Robert Oh and Jeremy Johnson. Chest pain and costochondritis associated with vitamin d deficiency: a report of two cases. [Internet] Pubmed 2012 ; [Accessed 2026, April 3] Available from: https://pubmed.ncbi.nlm.nih.gov/22761623/
3. Correlation of symptoms with vitamin D deficiency and symptom response to cholecalciferol treatment: a randomized controlled trial [Internet] Pubmed; 2009; [Accessed 2026, April 3] Available from: https://pubmed.ncbi.nlm.nih.gov/19364687/
4. Violeta Cepeda, Marina Ródenas-Munar, Silvia García, et al, Unlocking the Power of Magnesium: A Systematic Review and Meta-Analysis Regarding Its Role in Oxidative Stress and Inflammation [Internet] Pubmed; 2025; [Accessed 2026, April 3] Available from: https://pmc.ncbi.nlm.nih.gov/articles/PMC12189353/
5. Health Direct, Magnesium Deficiency [Internet] Health Direct, 2025. [Accessed 2026 April 3] Available from: https://www.healthdirect.gov.au/magnesium-deficiency
6. Ancient Minerals. 10 signs you are not getting enough magnesium. [Internet] LL Magnetic Clay Inc; 1996 – 2010; [Accessed 2013 Nov 1] Available from: https://www.ancient-minerals.com/magnesium-deficiency/need-more/
7. Nan Kathryn Fuchs, Ph.D. Magnesium: A Key to Calcium Absorption [Internet] The magnesium website; 2013. [Accessed 2013 Nov 1] Available from: https://www.mgwater.com/calmagab.shtml


Glenda @ Healthy Stories
Posted at 11:11h, 02 NovemberHi Sarah. Costochondritis is an inflammatory condition and is often caused by trauma to the ribs, although the ‘trauma’ doesn’t have to be as bad as you might think. Three years ago I had pleurisy from a respiratory virus (I’m an asthmatic so have touchy lungs). Between the inflammation from the pleurisy and some severe coughing, I developed a very chronic costochondritis that took 8 months to heal. It is the strangest feeling and very hard to deal with chronic pain in your chest region, but mine required osteopathic manipulation to heal. Physio didn’t work because it wasn’t only muscular, but osteopaths can manipulate the ribs to help set things right. Other postural issues can contribute too, including tense back and shoulder muscles, and even tight abdominals – which can be caused from long hours seated at a computer. So you may want to consider looking into physical therapy as well as the supplements.
Sarah James
Posted at 12:17h, 02 NovemberThanks Glenda!
I am sorry to hear that you had pleurisy and costochondritis, and very glad that you healed eventually.
It is interesting that this condition can be caused by physical trauma. And spending too much time at the computer is surely an issue for many of us – especially those in my line of work – the web.
Thanks heaps for the info. As far as my own experience with costochondritis goes, it is transient on the whole, although it is a good reason to work on posture!
I am pretty sure in this particular case it can be attributed to a calcium supplement. I notice on your blog that you use a lot of rice milk. I am finding it hard to get enough calcium, but I have just bought some magnesium to take with calcium supplements, so hopefully this will reduce the night time phenomena.
Thanks again for your thoughts 🙂
Have a great day!! 🙂
Sara
Posted at 06:50h, 13 FebruaryWeird! I am suspecitng I have low or deficient magnesium with eyelid twitches and lip twitches I am having. But I was recently diagnosed with costochondritis! No apparent “cause” and no injury sustained. This may be my answer to several issues I am having! I sure hope so, because it seems easy to fix. Thank you!
Sarah
Posted at 11:51h, 14 FebruaryHi Sara,
Magnesium is also helping me with muscle spasms and with chest pains in the night. It is interesting that you got diagnosed with costochondritis as well!
I hope it works out for you 🙂 xoxox Let me know how your magnesium goes?!? I know that not all magnesium supplements are created equal!!
cheers!
Sarah
darian
Posted at 11:30h, 13 DecemberIs megnesium good for costocondritis? I have a severe case of it thanks. lots of chest pain been to emerge and heart is healthy and can’t find nothing on exray.
Sarah
Posted at 11:41h, 13 DecemberHi Darian,
Although I did definitely find that magnesium helped my costochondritis and the problem is resolved now, at least in my case, I do think that a better nutritional profile, in general, did most of the work. At the time when I suffered from this condition, I was smoking. As smoking would have stripped my body of a lot of helpful vitamins and minerals, it would have exacerbated the issue.
Taking a powdered and balanced magnesium supplement did help a lot, and this was the advice of my medical practitioner at the time. However, getting into better health generally by quitting any toxic substances helped a lot too.
Good luck with your search. It is not a nice feeling, so I hope you get some relief soon!
🙂