Magnesium and vitamin D influences on anxiety

Magnesium and vitamin D supplementation for anxiety is currently a hot topic in circulation on many social media platforms, where many people are claiming that magnesium and vitamin D supplements have reduced their feelings of anxiety.


UK statistics currently state that eight million people are experiencing an anxiety disorder at any one time. Therefore, it is undeniable that chronic stress and anxiety are common. This can be due to the added pressures of longer hours of work, meeting targets and increased demands leading to juggling many tasks. It is no wonder people want to seek a natural way to support themselves. 

Given this current interest, I felt it would be beneficial to share the evidence from the perspective of a nutritional therapist.

As a nutritional therapist, my role requires investigating the latest evidence available through scientific research. It is important to seek the most effective and up-to-date studies in order to silence the endless supply of internet chatter so that you are given clear researched answers. I hope you find the information in this article a useful guide on this topic.

Before we dig deep, let's look at vitamin D and magnesium in more detail.

What is magnesium? 

Magnesium is an essential mineral that is required for over 300 reactions in the body including bone composition, energy production, cardiovascular support for heart and vascular function, blood pressure balance and regulating blood sugars. It is also an important co-factor (friend and helper) for other nutrients. Research studies also suggest the benefits of improved sleep, discussed further in this article.

Here are the common signs and symptoms associated with magnesium deficiency: 

  • leg cramps and twitching
  • muscle pain
  • feeling anxious or stressed
  • feeling tired/lacking energy
  • migraines/headaches
  • poor sleep
  • craving sugary foods
  • constipation
  • premenstrual syndrome
  • high blood pressure
  • vascular disease 
  • diabetes
  • osteoporosis

What is vitamin D?

Vitamin D is known as the 'sunshine vitamin' because it can be synthesised on the skin when the body is exposed to sunlight. Interestingly it can also be known as a hormone due to its functional connections with hormonal balances in the body.

The key functions of vitamin D are bone health, muscle contraction, calcium absorption, immune modulation, managing inflammation and strengthening the body's defence system.

It can provide heart, cardiovascular and brain protection because of its anti-inflammatory effect related to immune modulation. Some research also suggests if it is in adequate levels it may be cancer-protective.

What are the common signs and symptoms associated with vitamin D deficiency?

  • low immune – e.g. frequent colds, bouts of illness, chest infections
  • poor sleep
  • mood, depression and anxiety
  • bone pain
  • osteoporosis
  • rickets
  • fractures
  • osteomalacia (softening of the bones) 
  • musculoskeletal pain
  • high blood pressure

Now let's dig deep into the research on magnesium, vitamin D and anxiety.

Magnesium and anxiety 

Magnesium plays an important role in energy production and brain function, therefore based on these roles, there is no surprise that some research suggests it may help with depression and related disorders such as anxiety. However, one recent comprehensive study suggests the usefulness of further research to better understand the full connection.

One study looked at how magnesium supplementation can reduce the stress hormone cortisol and, by doing so, can help switch someone from being in a hyper state to a more calming state. Not only this, but chronic stress in itself can lead to reduced magnesium stores in our body, thus creating a vicious cycle.

Another study in 2017 found magnesium supplementation useful for relieving symptoms of mild anxiety and also for women experiencing premenstrual syndrome. In one study, B6 was also used alongside magnesium resulting in positive outcomes.

When looking at many past studies, it is true to say that a small percentage have mixed results but the majority are in favour of using magnesium for neurological issues. This is indeed promising.

Let's look at it from another angle. We all know that when we have a good night's sleep we generally feel better the next day compared to a poor night's sleep. This can include more energy, clearer thinking, less agitation and stress, and some would say we make better food choices. Therefore, this positive connection between magnesium and sleep can indirectly have a knock-on effect on how anxious one may feel. A recent systematic review (2022) looking at the role of magnesium for sleep, concluded that individuals who took 320mg of magnesium supplementation saw improvements in sleep.

Vitamin D and anxiety

Studies have identified a link between the benefits of vitamin D and mood, anxiety and depression, due to several roles associated with brain function.

Firstly, vitamin D acts similar to a hormone within our body and if deficient it is known to put people at a greater risk for experiencing mood issues. One such role is helping in the production of an important neurotransmitter called serotonin, otherwise known as the happy hormone.

Another association is its role in helping to maintain a balanced stress response by modulating the production of the stress hormone cortisol.

Vitamin D also has an anti-inflammatory effect on the brain, therefore, by reducing inflammatory markers, it provides a better understanding of the mechanisms underpinning improvements in neurological symptoms.

Similar to magnesium, vitamin D study outcomes show the link between vitamin D deficiency and poor sleep quality. One large study identified the presence of a large number of vitamin D receptors within all areas of the brain, two of which are the hypothalamus and prefrontal cortex, and both are known to execute important roles in sleep regulation.

Taking vitamin D and magnesium supplements together

Vitamins and minerals do not act alone. Many work together to help with processes in the human body such as absorption and nutrient metabolism. When it comes to magnesium, studies suggest it assists in the activation of vitamin D, which in turn regulates calcium and phosphate for bone health. A recent review discussed how all enzymes that metabolise vitamin D seem to require magnesium; therefore taking this information into consideration, we would recognise that taking magnesium and vitamin D together can be supportive.

A very important point to get across is the importance of ensuring we have adequate levels of both magnesium and vitamin D in our diet. Once this is mastered, supplements can be used to top up until levels in the body are adequate. The reason for achieving adequate levels is that many studies refer to links between deficiency/low levels and neurological symptoms.

The recommended allowance of magnesium is 270mg for women and 300mg for men, while vitamin D is 10ug for both women and men.

It is worth noting that every person’s case is different and therefore it is important to take advice from a registered practitioner when discussing specific dosages of each supplement.

This is because every person has a different starting point, a major consideration when deciding on supplement dosages. Good quality and highly absorbable options are best, such as magnesium biglycinate, while also bearing in mind every person has their own personal opinion on their preferred type of administration. This is where a registered practitioner can help, providing you with all the necessary and appropriate options specific to you.

Food sources of magnesium to include in your diet:

  • spinach
  • pumpkin seeds
  • lima beans
  • tuna
  • brown rice
  • almonds
  • dark chocolate – 85% cocoa
  • avocado
  • plain yoghurt
  • banana
  • black beans
  • figs, barley
  • cashews
  • cod
  • eggs
  • molasses
  • soybeans
  • parsnips
  • wholegrains

Food sources of vitamin D to include in your diet:

  • salmon, rainbow trout, tinned sardines, tuna
  • portobello mushrooms exposed to the sun, white button mushrooms
  • fortified milk and yoghurt
  • organic eggs
  • fish liver oils
  • organic butter
  • sprouted seeds

Alternative nutritional tips for helping with anxiety

Apart from magnesium and vitamin D, there are many natural ways to help with anxiety. I hope you find this added list useful.

  1. Reducing or eliminating stimulants such as coffee, alcohol, and sugary drinks can help reduce the production of stress hormones cortisol and adrenaline.
  2. Daily movement – Daily activity such as brisk walking or gardening can be useful for stimulating endorphins. These hormones create feelings of happiness.
  3. 'Me time' – self-care and taking time to do the things you love is supportive for emotional and physical health. This can be reading, speaking to a friend, attending a club, or anything that brings you joy.
  4. Relaxing herbal teas – Many herbs used as a tea can be beneficial for anxiety. These include chamomile, passionflower, lemon balm, and lavender.
  5. Practice meditation and deep breathing exercises – Taking long deep breaths can be very effective for activating the calming side of our nervous system. You can do this by slowly breathing in for five seconds, holding for two and exhaling slowly for six seconds. Repeat this 10 times and notice the difference. Alternatively, if you prefer, you can follow the details on a meditation app.
  6. Social connections – Engaging in fun activities with people and local communities can build positive connections lift mood and increase confidence. Spending less time on social media that may cause stress and anxiety compared to positive media connections is a positive step to reducing anxiety
  7. Learning to manage your time – This includes learning to say 'no' when your time is overstretched, alongside planning ahead when meeting deadlines.

Nutrient-rich diet

Eating a variety of coloured vegetables and fruit containing phytonutrients optimises brain health. Good fats such as nuts, seeds, avocado, olive oil, and oily fish (salmon, sardines, anchovies, mackerel, herring) nourish the brain cells. Apart from vitamin D and magnesium, other key foods from specific nutrients beneficial for mood and anxiety are as follows:

  • B6 – Found in foods such as salmon, chicken breast, tofu, beef, sweet potato, banana, potato, avocado, and pistachios.
  • Zinc – Found in pumpkin seeds, grass-fed beef, lamb, cashews, chickpeas, mushrooms, spinach, dark chocolate, wild salmon, and organic chicken.

If you need any further help on any of the topics discussed in this article, please feel free to get in touch and I'd be more than happy to help.

Now I leave you with a delicious recipe that contains foods rich in magnesium, vitamin D, zinc and B6.

Chickpea and salmon salad recipe


  • 1 cup of cooked chickpeas
  • 2 salmon fillets
  • 2 cups of spinach
  • 2 cups of lamb’s lettuce
  • ½ an avocado – cubed
  • 2 tbsp of pumpkin seeds
  • 4 walnut halves chopped
  • 1 fresh fig – sliced
  • 2 tbsp of extra olive oil
  • 1 tbsp of balsamic vinegar
  • a squeeze of lemon juice
  • season with salt and pepper


  • Rinse the chickpeas in cold water and drain well. Put aside.
  • Preheat the oven to 180 degrees C. Place the salmon fillets on a baking sheet lined with parchment paper. Season and bake for approximately 12-15 minutes until salmon is cooked through.
  • In a large bowl combine the chickpeas, spinach, lambs lettuce, avocado, pumpkin seeds, walnuts and fig slices.
  • In a small bowl mix together the olive oil, balsamic vinegar, lemon juice and a pinch of salt and pepper.
  • Pour the dressing over the salad and top with the cooked salmon
  • Serve straight away.


  • Sartori SB, Whittle N, Hetzenauer A, Singewald N. Magnesium deficiency induces anxiety and HPA axis dysregulation: Modulation by therapeutic drug treatment. Neuropharmacology. 2012;62(1):304-312. doi:10.1016/j.neuropharm.2011.07.027
  • Boyle NB, Lawton C, Dye L. The effects of magnesium supplementation on subjective anxiety and stress - A systematic review. Nutrients. 2017;9(5):429. doi:10.3390/nu9050429
  • Arab, A., Rafie, N., Amani, R. et al. The Role of Magnesium in Sleep Health: a Systematic Review of Available Literature. Biol Trace Elem Res 201, 121–128 (2023).
  • Gao, Q.; Kou, T.; Zhuang, B.; Ren, Y.; Dong, X.; Wang, Q. The Association between Vitamin D Deficiency and Sleep Disorders: A Systematic Review and Meta-Analysis. Nutrients 2018, 10, 1395.
  • Vellekkatt F, Menon V. Efficacy of vitamin D supplementation in major depression: A meta-analysis of randomized controlled trials. J Postgrad Med. 2019 Apr-Jun;65(2):74-80. doi: 10.4103/jpgm.JPGM_571_17. PMID: 29943744; PMCID: PMC6515787.
  • Uwitonze, AM, Razzaque, MS. Role of Magnesium in Vitamin D Activation and Function: J Osteopath Med; 118(3): 181-189

The views expressed in this article are those of the author. All articles published on Nutritionist Resource are reviewed by our editorial team.

Share this article with a friend
Redhill RH1 & Reigate RH2
Written by Therese Conlon-Barratt, DipNT, mBAN,T mCNHC | Nutrigenomics | Certified Health Coach
Redhill RH1 & Reigate RH2

My name is Therese I am a registered Nutritional Therapist with governing body CNHC and professional body BANT . These registrations apply to nutritionists’ qualified in scientific and clinical practice.

My passion lies in supporting people with issues such as weight gain, cardiovascular health, blood sugar balance and I.B.S conditions.

Show comments

Find a nutritionist dealing with Nutrition and mental health

All nutrition professionals are verified

All nutrition professionals are verified