Skip to Content

When is the best time to take magnesium and Vitamin D3?

Magnesium and vitamin D are two vital nutrients that have many important roles in the body. While magnesium helps with muscle relaxation, nerve functioning, blood pressure, and much more, vitamin D helps the body absorb calcium for stronger bones and teeth. Many people are deficient in one or both of these nutrients, so supplementation is common.

When it comes to the timing of magnesium and vitamin D supplementation, there are some things to consider to maximize the benefits. Here is a detailed overview of the best times to take these two supplements.

When to Take Magnesium

Magnesium is involved in over 300 biochemical reactions in the body and plays a key role in energy production, blood sugar control, nerve transmission, muscle contractions, and more. It’s found in foods like spinach, almonds, beans, avocados, and whole grains.

Some signs of magnesium deficiency include muscle cramps, insomnia, fatigue, anxiety, headaches, and constipation. Many people can benefit from magnesium supplementation of 200-400 mg per day.

Here are some of the best times to take magnesium supplements:

Before Bed

Taking magnesium before bed is ideal for a few reasons. First, magnesium has natural muscle relaxing and calming effects that can promote restful sleep. One study found that magnesium supplements improved insomnia symptoms in older adults.

Second, magnesium absorption may be enhanced when taken in the evening. Research shows that taking magnesium at night results in higher blood magnesium levels overnight.

Aim for 200-400 mg of magnesium 30-60 minutes before bed for the best results.

First Thing in the Morning

Another beneficial time to take magnesium is early in the morning, especially for those who have morning muscle cramps or twitches. Since magnesium is lost through urine overnight, replenishing levels first thing can help prevent muscle issues throughout the day.

Taking magnesium on an empty stomach may also increase absorption. One study showed higher magnesium blood levels when a supplement was taken with water 30 minutes before eating in the morning.

Before a Workout

Some research has found that taking magnesium just before exercise can improve performance and endurance. This may be due to magnesium’s roles in muscle and nerve function and energy production.

If you experience muscle cramps during or after exercise, taking 200-400 mg of magnesium 30-60 minutes pre-workout may help provide relief.

Times to Avoid

While magnesium is generally well tolerated, there are some times it’s best to avoid taking it:

  • With medications – Magnesium may interact with certain medications like antibiotics and diuretics. Check with your doctor.
  • During illness – High doses of magnesium can worsen diarrhea and vomiting.
  • After taking other supplements – Magnesium can reduce absorption of zinc, iron, and calcium if taken at the same time.

Spacing your magnesium dose away from medications or other supplements by 2-3 hours is recommended.

When to Take Vitamin D

Known as the “sunshine vitamin,” vitamin D helps your body absorb the calcium it needs for bone health. It’s also involved in immune function, blood pressure regulation, and cell growth.

A vitamin D deficiency can cause bone loss, muscle weakness, fatigue, low mood, and poor immune function. Supplements are often required since it’s difficult to get enough vitamin D from the diet alone.

Here is an overview of the best times to take vitamin D supplements:


Taking vitamin D first thing in the morning with breakfast or on an empty stomach is an easy way to remember your dose.

One study found blood levels were highest when people took vitamin D in the morning compared to afternoon or evening.

Aim for at least 600-800 IU of vitamin D in the morning if you’re deficient. You can also take higher doses of 2,000-5,000 IU per day for 2-3 months to correct a deficiency faster, then reduce to a maintenance dose.

With a Meal

Another option is taking vitamin D with a meal that contains healthy fats or oils.

Some research shows that vitamin D is better absorbed when consumed with the largest meal of the day.

Good meal pairings include breakfast with eggs, lunch with salmon, or dinner with avocado.

Times to Avoid

Here are some instances when vitamin D supplementation should be avoided:

  • With calcium – Vitamin D helps you absorb calcium, so avoid taking both together.
  • Before bed – Vitamin D can give you a boost of energy, so evening doses could disrupt sleep.
  • During illness – High vitamin D intake on its own can cause nausea and vomiting.

Spacing out your vitamin D and calcium supplements by several hours is best. And stick to morning or daytime vitamin D doses unless directed otherwise by your healthcare provider.

Can You Take Magnesium and Vitamin D Together?

Yes, you can take magnesium and vitamin D supplements together as they can provide synergistic effects. Here are some of the key benefits:

Bone Health

Magnesium and vitamin D both play central roles in bone formation and bone density. Vitamin D improves calcium absorption, while magnesium is needed to activate vitamin D and incorporate calcium into the bone.

Taking magnesium with vitamin D can further boost bone mineral density, especially when calcium is low in the diet.

Muscle Function

These two nutrients team up to support muscle health. Vitamin D receptors in muscle tissue require magnesium to function properly.

One study in athletes showed that vitamin D and magnesium supplementation for 4 weeks improved vertical jump height and reduced inflammation after exercise.


Magnesium and vitamin D both influence immune cells and immune-related biomarkers. They may provide synergistic immune-boosting effects.

One analysis found that magnesium enhanced the protective effects of vitamin D supplementation on immune function in those deficient in both nutrients.

Best Practices

To get the most out of magnesium and vitamin D:

  • Take vitamin D in the morning and magnesium before bed.
  • Look for supplements formulated with vitamin D3 and chelated magnesium.
  • Start with moderate doses of 200-400 mg magnesium and 600-800 IU vitamin D.
  • Increase vitamin D to 2,000-5,000 IU/day if deficient.
  • Optimize magnesium intake first before raising vitamin D.
  • Get blood levels tested after 3-4 months to check for deficiency.

Always consult your healthcare provider before supplementing, especially if taking medications or if you have a medical condition.

The Bottom Line

Magnesium is best taken before bedtime to promote sleep and muscle relaxation. It can also be taken in the morning or before a workout. For vitamin D, aim for morning doses with breakfast or midday with lunch or dinner. This allows you to get the benefits throughout the day without disrupting sleep.

Taking magnesium and vitamin D together provides enhanced benefits for bone health, immunity, and disease prevention, as they work synergistically. Optimal timing, dosing, and forms can help you get the most out of these two vital supplements.