Magnesium and Vitamin D: What They Do and How to Get Enough
Magnesium and vitamin D are two nutrients you hear about a lot. They are often mentioned together, in articles, on social media, and on supplement bottles. It can be hard to know what they actually do, whether you are getting enough, and what to do if you are not.
This guide explains both nutrients in plain English. It covers their general roles in the body, common food sources, how sunlight relates to vitamin D, and when it is worth talking to a healthcare professional. It does not give dosages or recommend supplements, because needs vary from person to person.
What Does Magnesium Do?
Magnesium is a mineral found in many foods. It plays a role in normal muscle function, normal functioning of the nervous system, and the maintenance of normal bones. It is also involved in energy production and in hundreds of processes in the body.
Most people get magnesium from food if they eat a varied diet. It is found in a wide range of everyday foods, so you do not need special products to include it.
A varied diet supports general health, but a single nutrient is not a cure for tiredness or poor sleep. If you have persistent symptoms, talk to a healthcare professional.
Foods That Contain Magnesium
Good food sources of magnesium include:
- Leafy green vegetables such as spinach and kale
- Nuts and seeds, including almonds, cashews, pumpkin seeds, and sunflower seeds
- Beans, lentils, and chickpeas
- Wholegrains such as oats, brown rice, and wholewheat bread
- Dark chocolate in small amounts
- Bananas, avocados, and dried fruit
Add a handful of nuts or seeds to breakfast, choose wholegrains where you can, and include beans or lentils a few times a week. Focus on variety rather than counting milligrams.
What Does Vitamin D Do?
Vitamin D is different from most nutrients because your body can make it from sunlight on your skin. It plays a role in the maintenance of normal bones and teeth, normal muscle function, and normal functioning of the immune system. It also helps your body absorb calcium from food.
Vitamin D is important for bone health across life, from childhood through older age. Low levels over a long time can affect bones, which is why health guidance in many countries pays close attention to it, especially in winter.
Unlike magnesium, vitamin D is found in only a small number of foods in useful amounts. That is why sunlight and, in some places, fortified foods matter.
Sunlight and Vitamin D
Your skin makes vitamin D when it is exposed to sunlight. How much you make depends on the time of year, where you live, your skin tone, how much skin is exposed, and how long you spend outside.
In the USA, UK, Canada, and Australia, sunlight varies a lot by season and latitude. In northern areas, sunlight in autumn and winter may not be strong enough for your body to make much vitamin D. In Australia, sun exposure advice also needs to balance vitamin D with skin cancer risk, so follow local guidance on sun safety.
A walk at lunchtime can help. You do not need to sunbathe, and you should still protect your skin from sunburn.
Because sunlight is not reliable all year in many places, some countries recommend a vitamin D supplement during autumn and winter for the general population. Guidance differs by country and by age group, so check the advice where you live and talk to a healthcare professional if you are unsure.
Foods That Contain Vitamin D
Food sources of vitamin D include:
- Oily fish such as salmon, sardines, mackerel, and trout
- Egg yolks
- Red meat and liver in small amounts
- Fortified foods such as some milks, yoghurts, breakfast cereals, and spreads
- Mushrooms exposed to sunlight, in some products
Check food labels for fortified options in your country. Fortified foods can help, but they may not provide all the vitamin D you need, especially in winter.
A varied diet with oily fish once or twice a week, eggs, and fortified foods can support your intake.
Should You Take a Supplement?
This is a common question, and the answer depends on your diet, your sun exposure, your age, your health, and where you live. Some people may benefit from a supplement, while others get enough from food and sunlight.
Health authorities in the UK, for example, advise many adults to consider a daily vitamin D supplement in autumn and winter. In Canada, guidance also recognises that sunlight is limited in winter. In the USA and Australia, advice varies, so local guidance matters.
Before taking magnesium or vitamin D supplements, talk to a healthcare professional or pharmacist, especially if you take regular medication, have kidney problems, are pregnant or breastfeeding, or have a health condition. Supplements can interact with medicines and are not suitable for everyone. More is not always better, and high doses can cause harm.
A blood test is sometimes used to check vitamin D levels, but it is not needed for everyone. A healthcare professional can advise whether testing or a supplement is appropriate for you.
FAQ
Can I get enough vitamin D from food alone?
It can be hard, because few foods contain much vitamin D. Oily fish, eggs, and fortified foods help, but sunlight and local guidance on supplements in winter also matter in many countries.
What foods are highest in magnesium?
Leafy greens, nuts, seeds, beans, lentils, and wholegrains are useful sources. A varied diet with these foods often provides magnesium without needing special products.
Should I take magnesium and vitamin D together?
Needs vary, and supplements are not suitable for everyone. Talk to a healthcare professional or pharmacist before taking supplements, especially if you take medication or have a health condition.
Sources
- NHS UK — Vitamins and minerals guidance
- National Institutes of Health — Office of Dietary Supplements
- Health Canada — Vitamin D guidance
- Harvard T.H. Chan School of Public Health — Nutrition Source
Disclaimer: This article is for general information only and is not medical advice. It does not give supplement dosages or recommend supplements. Talk to a healthcare professional before taking supplements or changing your diet for a health condition.

Comments
Post a Comment