Magnesium and vitamin D can generally be taken together, and there is no routine requirement to separate them by time of day. Both nutrients are involved in important processes that help the body function normally.
Vitamin D helps the body absorb calcium, while magnesium contributes to normal muscle and nerve function and is involved in vitamin D metabolism. Maintaining adequate levels of both nutrients is important, but taking additional supplements is not necessarily beneficial if you already get enough through your diet and existing supplements.
If you take prescription medication, have a medical condition or are considering high-dose supplements, speak to a healthcare professional or pharmacist to check what is appropriate for you.
Are There Benefits of Taking Magnesium and Vitamin D Together?
Magnesium and vitamin D support different functions in the body, with an important connection through vitamin D metabolism.
Vitamin D contributes to the normal absorption and utilisation of calcium and helps maintain normal bones, teeth and muscle function. Magnesium contributes to normal muscle and nerve function, energy metabolism and the maintenance of normal bones.
Research has explored how magnesium intake affects vitamin D levels, although findings are not entirely consistent.
This does not mean that everyone taking vitamin D needs a magnesium supplement, or that taking both together guarantees better results. The most important consideration is meeting your individual nutritional requirements.

Why Does Your Body Need Both Magnesium and Vitamin D?
Although magnesium and vitamin D are different nutrients, they are involved in several interconnected processes.
Vitamin D
Helps the body absorb calcium and contributes to the maintenance of normal bones, teeth and muscle function. It also supports normal immune system function.
Magnesium
Contributes to normal muscle and nerve function, energy-yielding metabolism and the maintenance of normal bones. It is also involved in hundreds of enzyme systems.
Magnesium acts as a cofactor for enzymes involved in the activation and breakdown of vitamin D. This helps explain why adequate magnesium status matters, but it does not establish that taking extra magnesium will improve vitamin D levels in everyone.
Both nutrients can be obtained through food, and supplements may be useful when dietary intake or individual circumstances make it difficult to meet requirements.
Does Magnesium Help Your Body Absorb Vitamin D?
Research suggests that magnesium status may influence vitamin D metabolism, although the relationship is complex and study findings vary. There is not enough evidence to conclude that everyone needs a magnesium supplement to absorb vitamin D effectively.
If you are concerned that you may not be getting enough of either nutrient, a healthcare professional can help assess your individual needs.
When Is the Best Time to Take Magnesium and Vitamin D?
There is no universally established best time of day to take magnesium and vitamin D together. For most people, the best time is one that fits comfortably into their daily routine and helps them take their supplements consistently.
You could take both with breakfast and your evening meal, provided you follow the instructions on each product. Vitamin D is fat-soluble, so taking it with a meal containing some fat can help support absorption.
Some people prefer taking magnesium in the evening, but there is insufficient evidence to establish that evening supplementation but there is insufficient evidence to establish that evening supplementation is more effective than any other time of day. The right timing may also depend on the type of supplement, your tolerance and any medicines you take.
If you have been prescribed vitamin D to treat a deficiency, follow the dosage and schedule recommended by your healthcare professional.
Should You Take Magnesium and Vitamin D With Food?
Taking vitamin D with a meal containing some fat is a practical way to support absorption. Foods such as eggs, oily fish, nuts, seeds and olive oil can provide dietary fat as part of a balanced meal.
Magnesium supplements can be taken according to the product instructions. If magnesium causes stomach discomfort or diarrhoea, taking it with food may help some people tolerate it better. The effect can depend on the magnesium formulation and dose.
You do not necessarily need to take both supplements at the same time. Check the label for specific instructions and ask a pharmacist if you are unsure how to combine your supplements with medication.
How Much Magnesium and Vitamin D Should You Take?
The amount of magnesium and vitamin D you need depends on factors such as age, diet, health and whether you have a diagnosed deficiency.
In the UK, the NHS recommends that adults consider taking a daily vitamin D supplement containing 10 micrograms (400 IU) during autumn and winter. For example, those people who spend more time indoors, we would advise taking vitamin D throughout the year. The appropriate dose may differ when a clinician is treating a deficiency.
For magnesium, UK recommended daily amounts for adults aged 19–64 is 300 mg for men and 270 mg for women. It is worth noting that these recommendations are based on a dietary intake from food and supplements.
Check the amount of each nutrient in your supplements, especially if you use a multivitamin or a combination product. Taking several products containing, the same nutrients can increase your total intake unnecessarily. Do not exceed the recommended dose or take high-dose vitamin D unless advised by a healthcare professional.

Are There Any Side Effects or Risks of Taking Magnesium and Vitamin D Together?
Taking magnesium and vitamin D together is generally possible, but the dose, your health and any medicines you use are important considerations.
High doses of magnesium supplements can cause diarrhoea, nausea and abdominal cramps. For some people, particularly for people with impaired kidney function, they may have difficulty clearing excess magnesium.
Excessive vitamin D intake can cause calcium to build up in the blood, potentially leading to nausea, weakness, excessive thirst, frequent urination and kidney problems. For most adults, the NHS advises not taking more than 100 micrograms (4,000 IU) of vitamin D daily unless a healthcare professional recommends otherwise.
Magnesium supplements can also interact with certain medicines, including some antibiotics and medicines used to treat osteoporosis. Vitamin D can interact with other medicines too.
If you have kidney disease, take regular medication, are pregnant or are considering high-dose supplementation, ask a healthcare professional or pharmacist for personalised advice before starting a new supplement routine.