Skip to main content
Supplements and Herbs

Vitamin D and Magnesium: Is It Important to Take These Together?

Angela Dunn, MD, MPHKatie E. Golden, MD
Written by Angela Dunn, MD, MPH | Reviewed by Katie E. Golden, MD
Updated on March 11, 2024

Key takeaways:

  • About 50% of people worldwide have low vitamin D levels. And between 10% and 30% of the population are thought to have low levels of magnesium.

  • For many people, it’s important to take vitamin D and magnesium together. Without magnesium, your body can’t use vitamin D. And if you take vitamin D supplements, this can make a magnesium deficiency worse.

  • There are natural ways to increase both your vitamin D and magnesium levels. Your primary care professional can help you figure out if you need supplements to regulate your levels.

Save on related medications

Vitamin D deficiency is a global health problem. Some even call it a global epidemic, since more than 1 billion people worldwide are deficient in vitamin D. And 50% of the global population have levels that are lower than normal (but not low enough to be considered a deficiency).

It’s important for your health to have normal vitamin D levels — but you need other nutrients in your body to do this. One of them is magnesium. It helps convert vitamin D from its inactive form to an active form that your body can use. So we'll go through how to decide if you need to take these supplements together to keep you healthy.

Should you take vitamin D and magnesium together?

Yes. For most people, it’s probably best to take both vitamin D and magnesium together

You can’t properly metabolize vitamin D without the right level of magnesium. And since so many people have low magnesium levels, vitamin D supplements on their own aren’t very helpful for a large portion of the population. This means that taking vitamin D by itself may not fix a deficiency.

And taking vitamin D in large doses can also deplete magnesium, leading to a magnesium deficiency — or making an existing one worse. 

But how do you know if you have a vitamin D and/or magnesium deficiency to begin with? We go over that next.

Why is vitamin D important?

Vitamin D is a fat-soluble vitamin. It helps your body absorb calcium and maintain phosphorus levels. This keeps your bones healthy and ensures your muscles work properly. Vitamin D also helps manage inflammation, keeps your immune system strong, and helps your body use glucose (sugar).

Low levels of vitamin D are also linked to bone health problems, such as osteoporosis, bone fractures, and rickets (in children).

What are the symptoms of a vitamin D deficiency? 

Mild vitamin D deficiency or insufficiency (which is when your levels are low but not low enough to qualify as a deficiency) may not cause any symptoms. Even when deficiency becomes more severe and symptoms start to show, they’re often not very specific. This can make it difficult to pinpoint what’s causing them. When symptoms do show, you may experience:

  • Muscle pain and weakness

  • Bone pain

  • Joint stiffness

  • Muscle twitching

  • Fatigue

GoodRx icon
  • Do you have low magnesium? There are several different causes of low magnesium. Luckily, many causes of low magnesium are easily treated.

  • Foods that contain vitamin D: Vitamin D is important for immunity and bone and heart health, but not a lot of foods have it. Fatty fish, beef liver, and mushrooms are among the foods that do.

  • Foods that contain magnesium: Magnesium supports healthy nerve and muscle function. Check out which foods are rich in magnesium.

Why is magnesium important?

Magnesium is one of the most abundant minerals in your body, and it’s involved in more than 300 chemical reactions that help your body function properly. Magnesium can help:

  • Manage blood sugar levels

  • Regulate blood pressure

  • Ensure nerves and muscles work properly

  • Make new proteins and DNA

  • Strengthen bones

About half of people in the U.S. don’t consume enough magnesium every day. It’s estimated that anywhere from 10% to 30% of people may have low levels of magnesium. Having low levels of magnesium consistently is also linked to Type 2 diabetes and cardiovascular disease. In serious cases, magnesium deficiency can lead to seizures, coma, and reduced blood flow to the heart. 

Goodrx logo

Read more like this

Explore these related articles, suggested for readers like you.

What are the symptoms of a magnesium deficiency?

Not all people with magnesium deficiency show signs. But when symptoms do develop, they usually affect the muscles and heart. Some of the most common symptoms include:

  • Loss of appetite

  • Nausea and vomiting

  • Tiredness

  • Weakness

  • Personality changes

  • Numbness

  • Muscle tremors, spasms, or cramps

  • Personality and mood changes

  • Heart arrhythmias (irregular heartbeat)

A blood test can detect a magnesium deficiency, but many deficiencies go unnoticed. This is because healthcare professionals typically check for other causes first when someone comes in with symptoms of magnesium deficiency.

Can magnesium and vitamin D help with anxiety?

There has been a lot of interest in how magnesium and vitamin D might help people with anxiety. Let's break down what the science says.

Various factors can cause anxiety, and one of them is oxidative stress and inflammation in the body. Vitamin D is known to be an antioxidant, which means it helps against oxidative stress. So, it's not surprising that researchers have found a link between low levels of vitamin D and symptoms of anxiety. 

If you're feeling anxious, your doctor might suggest checking your vitamin D levels and possibly recommend vitamin D supplements if your levels are low.

Research has focused more on the link between magnesium and depression rather than anxiety. But there's still some evidence suggesting that magnesium might play a role in anxiety as well. Some studies have shown that magnesium can have a positive effect on anxiety levels, but others haven't found any significant impact

This suggests that we need more carefully designed studies to really understand the connection between magnesium and anxiety. Until then, it's hard to say for sure whether taking magnesium supplements will help with anxiety symptoms.

Can magnesium and vitamin D help with weight loss?

There’s evidence suggesting that magnesium could potentially help with weight loss, particularly in people who have been diagnosed with:

  • Obesity

  • Diabetes

  • Magnesium deficiency

Magnesium plays a crucial role in several metabolic processes, including glucose metabolism and insulin sensitivity. Additionally, magnesium deficiency has been linked to metabolic syndrome, a cluster of conditions that increase the risk of obesity, Type 2 diabetes, and heart disease. 

This all means that treating magnesium deficiency — through supplementation or dietary changes — may help with weight loss in people with obesity or diabetes. However, further research is needed to better understand how magnesium influences weight loss, and the best dosage for this purpose.

When it comes to vitamin D and weight loss, the situation is a bit more complex. People who have a higher amount of body fat often have low levels of vitamin D. This is because weight can affect how the body processes vitamin D. Additionally, people who undergo rapid weight loss — such as through bariatric surgery — often require high doses of vitamin D supplements to maintain proper nutrition.

Even though there’s a link between vitamin D and weight loss, the relationship isn’t clear-cut. It’s important to have adequate levels of both magnesium and vitamin D for overall health, but it's not guaranteed that they’ll directly lead to weight loss. 

How much magnesium should you take with vitamin D?

The exact amount of magnesium you should take depends on your current levels.

The current recommendation is that: 

  • Adult women get at least 310 mg to 320 mg of magnesium per day. 

  • Adult men get 400 mg to 420 mg per day. 

But some studies say that while this may be enough to prevent outright deficiencies, people may need more for overall health and longevity.

The same is true for vitamin D. The current recommendation is at least 600 IU to 800 IU of vitamin D per day (depending on your age). But this number is intended to maintain a blood level of 30 ng/mL. While this is considered normal, the Endocrine Society says the goal should actually be 40 ng/mL to 60 ng/mL. To get levels up to this range, adults may need to take 1,500 IU to 2,000 IU per day.

Is it better to take magnesium with vitamin D3?

Vitamin D2 and vitamin D3 are two common forms of vitamin D. They’re both important for your body, but they come from different sources. Vitamin D2 comes from plants and fungi, while vitamin D3 comes from sunlight and animal-based foods. They both help keep your bones healthy, but D3 might be better at raising your vitamin D levels.

If you’re severely deficient or have trouble absorbing these nutrients, your healthcare professional may recommend much higher doses. On the flip side, if your levels are within normal ranges, you may be able to take much less to maintain a healthy level.

What are some natural ways to increase vitamin D and magnesium levels?

Apart from supplements that a healthcare professional may recommend, you can get vitamin D and magnesium naturally.

Natural ways to increase vitamin D

Safe exposure to sunlight is one of the best ways to get vitamin D. Getting just 5 to 30 minutes of sunlight per day can help your body make vitamin D. You can also consider foods like:

  • Trout

  • Salmon

  • Mushrooms

  • Vitamin D-fortified milk and cereals

  • Sardines

  • Eggs

Cod liver oil is a natural vitamin D supplement that contains 1,360 IU per serving. This is equal to 170% of the daily recommended amount for the general population.

Keep in mind that certain health conditions and events can lower the amount of vitamin D your body is able to use. These include:

  • Crohn’s disease

  • Celiac disease

  • Chronic kidney disease

  • Higher body weight

  • History of gastric bypass surgery

If you have any of these conditions, it’s important to work with your healthcare team to figure out the best way to get enough vitamin D.

Natural ways to increase magnesium

As a general rule, foods that contain fiber also contain magnesium. Some of the most common sources of magnesium include:

  • Green leafy vegetables like spinach and kale

  • Pumpkin seeds

  • Chia seeds

  • Almonds

  • Cashews

  • Peanuts

  • Black beans

  • Potatoes

  • Brown rice

  • Plain yogurt

However, even if you’re getting enough magnesium from your diet, you may not be properly absorbing it. This is especially true if you have certain health conditions that affect the intestines, such as inflammatory bowel disease (IBS) and celiac disease. So in these cases, it’s best to talk with your healthcare team to check your levels.

The bottom line

Taking vitamin D supplements on their own may not be enough to correct a deficiency. If your healthcare professional suspects you may be low in vitamin D, make sure to get your magnesium levels checked, too. If your magnesium levels are low, your healthcare professional can help you figure out why and come up with a plan to safely raise them.

why trust our exports reliability shield

Why trust our experts?

Angela Dunn, MD, MPH, is a public health physician practicing in Utah, with a focus on serving under-resourced communities.
Katie E. Golden, MD, is a board-certified emergency medicine physician and a medical editor at GoodRx.

References

GoodRx Health has strict sourcing policies and relies on primary sources such as medical organizations, governmental agencies, academic institutions, and peer-reviewed scientific journals. Learn more about how we ensure our content is accurate, thorough, and unbiased by reading our editorial guidelines.

Was this page helpful?

Latest articles