Vitamin D, Genes, and Your Immune System

Vitamin D is more than just a ‘vitamin’.  It is actually a hormone that is essential to so many processes in your body – including your immune system.

A Spanish randomized control trial recently showed that giving hospitalized COVID-19 patients vitamin D reduced the risk of an ICU stay by 98%![ref] This article explains how vitamin D interacts with the immune system and how to check your genetic data for vitamin D related genes. We will wrap up with ways to increase your vitamin D level.

Vitamin D and the Immune System:

Often when you hear about vitamin D, it is in reference to strong bones and calcium regulation. But Vitamin D is also vital for your immune system – both in fighting off pathogens and in keeping your immune response in check so that it doesn’t get out of hand.[ref]

Producing Vitamin D:

Vitamin D is produced in the skin from exposure to sunlight. It is produced via a reaction with UVB radiation and cholesterol in the skin.[ref]  You can also get vitamin D through your diet.

Once your body makes D3 (cholecalciferol) or you absorb it from food, it goes through a couple of steps to convert it into the active form.  First, it can be converted in the liver into 25-hydroxy vitamin D  – 25(OH)D – with the help of an enzyme coded for by the CYP2R1 gene.

That 25(OH)D then needs to go through one more step to be the active form that your cells need. To convert the 25(OH)D  into the active form – 1,25(OH)2D3  or calcitriol. The key enzyme for this conversion is coded for by the CYP27B1 gene.

Your body’s 25(OH)D levels are basically depending on how much you take in from food and sunlight. But the 1,25(OH)2D3 (calcitriol) levels are more tightly regulated, and the active form is converted when and where it is needed.

What exactly does vitamin D do?

In a nutshell, vitamin D can cause cells to turn on genes, making certain proteins needed in a cell.

To get a little more specific…
Inside of your cells, vitamin D binds to the vitamin D receptor  (VDR).  This then causes VDR to get together with a couple of other proteins (one is a vitamin A-related receptor) and bind to different spots on the nuclear DNA. This activates the transcription of certain genes. In fact, vitamin D controls the expression of about 3% of the human genome. So, yeah, it’s pretty important.

Additionally, vitamin D can act as a hormone within cells to immediately cause non-DNA related actions to take place – such as opening ion channels or causing the secretion of insulin.

The term pleiotropy gets used a lot in research papers about vitamin D. Pleiotropy just means that one gene (or in this case one product of a gene, calcitriol) can cause more than one completely different action or trait to occur.  In other words, vitamin D does a lot of stuff in the body that is seemingly unrelated. For example, Vitamin D is essential for calcium regulation and strong bones — and vitamin D is also essential for immune response. It is also important in cancer prevention, hypertension, atrial fibrillation, blood clots, inflammatory bowel disease, and autoimmune disease. [ref]

A little history:
The Industrial Revolution in Northern Europe in the 1700s brought in crowded cities and thick air pollution from burning coal. Dirty skies and indoor jobs lead to widespread rickets, a disease that causes bone deformation in children due to lack of vitamin D.  It is estimated that by the early 1900s,  80-90% of children had rickets in Northern Europe and the NE United States. This turned around in the 1930s when milk and other foods were being fortified with vitamin D and the government was encouraging sun exposure for young kids.[ref] Baby cages became a popular way to put the kids out for some sun…  (go look it up :-)

Immune response:

We can divide our body’s immune response into two parts:

  • the innate immune response that happens immediately
  • the adaptive response that develops to remember pathogens.

The innate response includes types of white blood cells known as monocytes and macrophages. T. You could imagine them as little PacMan coming in to gobble up the pathogens and cellular debris.

Macrophages contain both the vitamin D receptor (VDR) and CYP27B1, so they are able to use the circulating 25(OH)D to make the active calcitriol when needed. Macrophages use active vitamin D when initiated by interferon-gamma, which the innate immune system produces in response to pathogens such as viruses.[ref]

Interestingly, research shows that vitamin D both enhances and tamps down immune response — playing a vital role in making sure the initial immune response is strong enough but putting the brakes on if the adaptive immune response is out of control.[ref]

By the way – this knowledge of vitamin D helping immunity isn’t new!

Healers have known for ages that sunlight is vital for health. Our great-grandparents probably reached for the cod liver oil, which is high in vitamin D, whenever the kids were sick. It was also used centuries ago as a primary treatment for tuberculosis (a lung disease caused by a bacteria).

Vitamin D deficiency links obesity and immune response:

People who are obese are also more likely to also be vitamin D deficient – and inflammation is a key linking factor here.  In obesity, the fat cells can start giving off inflammatory signals and become infiltrated with macrophages.

Animal research clearly shows that low vitamin D levels increase inflammation significantly in obesity – and low vitamin D is also linked to increased fat mass. The research shows that low vitamin D levels cause the animals to burn less fat (lower fatty acid oxidation) and thus have more weight gain on a fattening diet. Additionally, inflammatory cytokines such as IL-6 and TNF-alpha are higher in mice fed an obesogenic diet that is low in vitamin D.[ref]

How is vitamin D deficiency defined?

Different countries and various research groups define vitamin D deficiency in varying ways.

  • Severe vitamin D deficiency – less than 10 ng/mL – will cause rickets, which is a bone deformity disease.
  • A lot of studies define vitamin D deficiency as <20 ng/mL, and the range between 20 -30 ng/mL is considered ‘insufficient’.

Basically, the statistically relevant bad effects of vitamin D tend to occur at levels of less than 30 ng/mL.[ref] Some groups recommend levels of 40-50 ng/mL as being optimal.

Studies on supplemental vitamin D and immune response:

There are a number of studies on vitamin D supplementation for viral and bacterial pathogens, and the outcomes range from no response to very positive effects.

  • In patients with chronic hepatitis C (a viral disease), vitamin D deficiency (<30 ng/ml) is associated with more severe liver disease. A randomized control trial shows that correcting the deficiency helps to bring some of the inflammatory markers back into a good range, thus predicting better long term outcomes for the patients.[ref]
  • In HIV patients, vitamin D insufficiency (<30 ng/ml) and deficiency (<20 ng/ml) are associated with higher levels of inflammatory cytokines (IL-6, TNF-α, etc) and more activated monocytes. [ref]
  • In kidney transplant patients, vitamin D deficiency is linked to an almost two-fold risk of urinary tract infections (bacterial).[ref]
  • A meta-analysis of 18 studies on vitamin D and children found that low vitamin D is associated with an increased risk of acute lower respiratory infections (usually viral).[ref]
  • A meta-analysis of a bunch of randomized, placebo-controlled trials in adults found that vitamin D supplementation reduced the risk of acute respiratory infections overall. The effect was mainly in those with low baseline vitamin D levels (<25 ng/mL).
  • Supplemental vitamin D (1,200 IU and up) has been shown in several studies to be effective in decreasing the risk of influenza A (but not influenza B).[ref]

So does a vitamin D supplement cure everything? Well… probably not. There are quite a few studies showing that vitamin D supplements don’t do a lot for the population as a whole.

For example, a large 2019 study published in the New England Journal of Medicine showed that 2,000 IU of vitamin D/day did not affect cardiovascular disease outcomes, cancer rates, or all-cause mortality. The study was a clinical trial conducted in 25,000+ people, with half the group taking a placebo and half the supplemental vitamin D. It was a multi-ethnic study that followed participants for over 5 years.[ref] On the other hand, a Cochrane analysis of 159 randomized trials concluded that vitamin D3 supplementation may be beneficial in older adults. It does show that vitamin D decreases the overall risk of cancer a little bit.[ref]

Instead of being a cure-all, my takeaway from reading through quite a few supplement studies is that vitamin D supplementation is important for the immune response in people who are vitamin D deficient. But for people with sufficient vitamin D levels, supplementation doesn’t show statistically significant benefits when looking at the population as a whole.

Vitamin D levels and SARS-CoV2 susceptibility:

In the midst of the world-wide coronavirus outbreak, vitamin D has been in the spotlight. Numerous preprint articles since early on in the pandemic have noted that severe COVID-19 patients are much more likely to have vitamin D deficiency.[ref][ref][ref][ref]

There are a lot of mechanistic reasons why vitamin D deficiency would add to COVID-19 susceptibility. Top among these reasons is that vitamin D boosts the innate immune response (that initial response needed to kick the virus) and that vitamin D modulates the later immune overactivation, which causes acute respiratory distress syndrome.

A recent paper published in The Lancet explains:
“A role for vitamin D in the response to COVID-19 infection could be twofold. First, vitamin D supports production of antimicrobial peptides in the respiratory epithelium, thus making infection with the virus and development of COVID-19 symptoms less likely. Second, vitamin D might help to reduce the inflammatory response to infection with SARS-CoV-2. Deregulation of this response, especially of the renin-angiotensin system, is characteristic of COVID-19 and degree of overactivation is associated with poorer prognosis.”

Additionally, IL-6, which is a cytokine that causes much of the damage in severe COVID-19, is modulated by vitamin D. [ref]

A preprint analysis of the data in several vitamin D studies shows that about 90% of COVID-19 patients are either vitamin D deficient or insufficient. For this study, insufficiency was defined as being <20ng/mL.[ref]

A Chinese study found that vitamin D levels less than 30 nmol/L increased the risk of COVID severity by almost 3-fold.[ref]

Is it too late to boost your vitamin D levels once you have COVID? A randomized placebo-controlled study investigated the effects of 60,000 IU of oral vitamin D nano-liquid droplets daily for people who had mild SARS-CoV-2. The group receiving the vitamin D cleared the SARS-CoV-2 infection more quickly than the control group. Additionally, the vitamin D group also had a significant decrease in fibrinogen (clotting) levels.[ref]

A Spanish randomized control trial showed that giving hospitalized COVID patients vitamin D reduced the risk of an ICU stays by 98%![ref]

Vitamin D Genetic Variants:

Members: See your data below

Log in and select your data file Not a member? Join now.

Your genes play a role in your vitamin D levels in several ways. Different genes are key in each of the different steps involved in converting vitamin D into the active form.

CYP2R1 Gene:

CYP2R1 is the gene that codes for the enzyme that acts in the first step, converting cholecalciferol into 25(OH)D in the liver. Genetic variants here play a role in overall 25(OH)D levels, which is the common form of serum vitamin D measured in blood tests.

Check your genetic data for rs2060793 (23andMe v4, v5; AncestryDNA):

  • A/A: lower vitamin D levels[ref]
  • A/G: typical vitamin D levels
  • G/G: higher vitamin D levels

Members: Your genotype for rs2060793 is .

Check your genetic data for rs1562902 (23andMe v4, v5; AncestryDNA):

  • T/T: higher vitamin D levels[ref]
  • C/T: typical vitamin D
  • C/C: typical vitamin D levels

Members: Your genotype for rs1562902 is .

CYP27B1 Gene:

The second step in the conversion to the active form of vitamin D involves CYP27B1 as a catalyst for the conversion of 25(OH)D  to calcitriol (1,25(OH)2D3 ).  A couple of rare mutations (listed below) of CYP27B1 do affect the conversion to the active form of vitamin D, and these mutations are linked to rickets, a disease caused by the lack of vitamin D in childhood.

Check your genetic data for rs10877012 (23andMe v5; AncestryDNA):

  • T/T:  increased fracture risk in the elderly, associated with lower vitamin D levels[ref]
  • G/T: more likely to achieve vitamin D sufficiency with supplementation (diabetics)[ref]
  • G/G:  typical, more likely to achieve remission in hep. B with interferon (correlated with higher vit. D)[ref]

Members: Your genotype for rs10877012 is .

Check your genetic data for rs4646536 (23andMe v4; AncestryDNA):

  • A/A: increased susceptibility to vitamin D deficiency[ref] increased fracture risk in the elderly[ref]
  • A/G: increased susceptibility to vitamin D deficiency
  • G/G: typical

Members: Your genotype for rs4646536 is .

Check your genetic data for rs28934607 (23andMe v4; AncestryDNA):

  • A/A: pathogenic for Vitamin D related rickets[ClinVar]
  • A/G: carrier of a pathogenic allele
  • G/G: typical

Members: Your genotype for rs28934607 is .

Check your genetic data for rs28934605 (23andMe v4; AncestryDNA):

  • T/T: pathogenic for Vitamin D related rickets[ClinVar]
  • C/T: carrier of a pathogenic allele
  • C/C: typical

Members: Your genotype for rs28934605 is .

Check your genetic data for rs28934604 (23andMe v4; AncestryDNA):

  • T/T: pathogenic for Vitamin D related rickets[ClinVar]
  • C/T: carrier of a pathogenic allele
  • C/C: typical

Members: Your genotype for rs28934604 is .

VDR (vitamin D receptor) Gene:

After vitamin D (from sunlight, food, or supplements) has gone through the conversion steps, the active form, calcitriol (1,25(OH)2D3 ), can act within cells through the vitamin D receptor (VDR), which is a transcription factor that turns a gene on or off.  Vitamin D receptors control a variety of different functions including the activity of the immune system, skin, pancreas, and bone tissue. There have been many studies on these VDR gene variants, with some studies showing conflicting results.[ref]

Check your genetic data for rs731236 (23andMe v.4, v.5; AncestryDNA):

  • G/G: typical[ref]
  • A/G: usually typical
  • A/A: VDR TaqI variant[ref] increased risk of tuberculosis[ref]

Members: Your genotype for rs731236 is .

Check your genetic data for rs1544410 (23andMe v4, v5; AncestryDNA):

  • C/C: typical[ref]
  • C/T: probably typical levels
  • T/T: carrier of BsmI variant, possible increased risk of low bone mineral density[ref][ref] increased risk of malignant melanoma[ref] increased risk of tuberculosis[ref]

Members: Your genotype for rs1544410 is .

Check your genetic data for rs2228570 (23andMe v4 only):

  • A/A: typical
  • A/G: typical vitamin D levels[ref]
  • G/G: carrier of FokI variants, possibly decreased vitamin D levels, pos. increased risk of fractures[ref][ref][ref] increased risk of malignant melanoma[ref] increased risk of dengue fever[ref]

Members: Your genotype for rs2228570 is .

Check your genetic data for rs7975232 (23andMe v4, v5; AncestryDNA)

  • C/C: half the risk of dengue fever[ref] faster clearance of hepatitis C[ref]
  • A/C: typical risk of dengue fever
  • A/A: typical risk of dengue fever

Members: Your genotype for rs7975232 is .


GC Gene: Vitamin D Binding Protein

The vitamin D binding protein is coded for by the GC gene, and variants in the gene affect the total serum levels of 25(OH)D. The frequency of the variants in the GC gene vary in different population groups, and this is thought to be part of the difference in vitamin D levels among populations. This vitamin D binding protein binds to and transports vitamin D (both 25(OH)D and calcitriol) in the bloodstream, and it basically keeps vitamin D levels stable throughout the body. Vitamin D binding protein can also bind to free fatty acids, and high concentrations of unsaturated fatty acids may block the binding of vitamin D to VDBP.[ref]

Check your genetic data for rs2282679 (23andMe v4, v5; AncestryDNA):

  • T/T: typical vitamin D levels[ref]
  • G/T: somewhat lower total serum vitamin D levels
  • G/G: lower serum vitamin D levels[ref]

Members: Your genotype for rs2282679 is .

Check your genetic data for rs7041 (23andMe v.4, v.5; AncestryDNA):

  • C/C: typical Vitamin D levels[ref]
  • A/C: somewhat lower vitamin D levels[ref]
  • A/A: lower serum vitamin D levels[ref][ref]

Members: Your genotype for rs7041 is .

Check your genetic data for rs12512631 (23andMe v4; AncestryDNA):

  • T/T: typical vitamin D
  • C/T: typical vitamin D
  • C/C: increased vitamin D (both 25 and 1,25) levels.[ref]

Members: Your genotype for rs12512631 is .

Check your genetic data for rs1155563 (23andMe v4, v5; AncestryDNA):

  • T/T: typical vitamin D
  • C/T: lower vitamin D
  • C/C: significantly lower vitamin D levels[ref][ref]

Members: Your genotype for rs1155563 is .



Sun exposure:

This may seem like a double-edged sword: You need to expose your skin to the sun in order to make vitamin D, but too much sun exposure causes photoaging and skin damage.

Moderation may be the key here. If you are not used to being in the sun and you have low levels of vitamin D, you are going to burn more easily. But, as vitamin D levels increase, the vitamin D in your skin actually protects you from UV induced sunburns and inflammation.[ref]

When the skin produces vitamin D from sunlight, it doesn’t just immediately boost your overall vitamin D levels. Instead, it takes up to 8 hours for the conversion to occur. This causes some confusion when looking at studies of sunlight vs. supplemental vitamin D because the supplemental form raises serum levels more quickly.[ref]

Vitamin D is produced by UVB radiation, which makes up about one percent of the solar radiation hitting the earth’s surface at noon. Most of the UVB radiation is absorbed in the ozone layer. (Remember back in the 80s when we had to give up hairspray so that we wouldn’t get skin cancer from the hole in the ozone layer? At least that is the way that I remember it being explained in small-town Alabama when I was a kid :-)

During the winter months, anyone living north or south of about 33 degrees latitude gets no UVB radiation, even at noon. Thus, even if you go outside in NY or Boston from November through February, you still won’t be making any vitamin D. (Image below, creative commons license)[ref]

Sunscreen blocks about 95-98% of UVB (for SPF 30). Therefore, if you wear sunscreen, you are also blocking your ability to produce vitamin D.

Food sources:

Vitamin D2 in foods in IUs/serving (Source: NIH, Dietary Supplement Fact Sheet):

Food source: IU/ day 
Cod liver oil (1 tbsp) 1360
Salmon, 3 oz 447
Tuna, 3oz 154
Fortified OJ, 1 cup 137
Fortified Milk, 1 cup 115
Fortified Yogurt, 6oz 80
Egg yolk (1) 41

The US government sets the RDA at 600 IU per day for adults with an upper intake of 4,000 IU.  That is, obviously, a huge range – and your genes play a role in whether you need more vitamin D or not. The RDA should be enough to keep you from getting rickets or have a frank deficiency.  If you are exceeding 4,000 IU per day on a long term basis, I would suggest getting a vitamin D test done to see what your levels are.


There are two types of vitamin D available – D2 and D3.  Research shows that vitamin D3 is much more effective at raising serum 25(OH)D levels.[ref]

I highly recommend reading the label on any supplement you choose to take.  Vitamin D is a fat-soluble vitamin, so many supplements are in gel cap form and contain oil. Check to see what kind of oil is in the vitamin – there are brands that contain coconut oil or olive oil that don’t cost much more than the less expensive soybean or cottonseed oil versions.


The only way to actually know what your vitamin D levels are is to get a blood test done. Genetics can tell you whether you are likely to be prone to lower levels, but environmental factors (sun exposure!) and consumption of foods with vitamin D vary a lot from person to person.

You can ask your doctor to order a vitamin D test the next time you go in for a checkup, or – in the US – you can order your own blood work online. For example, UltaLab Tests offers a vitamin D 25(OH)D test for $39 and the 1,25(OH)2D3  test for $81. (Coupon Code ULTA15 will get you 15% off – June 2020)

Related Articles and Topics:

Should you increase your vitamin C levels?
Like most nutrients, our genes play a role in how vitamin C is absorbed, transported, and used by the body.  This can influence your risk for certain diseases, and it can make a difference in the minimum amount of vitamin C you need to consume each day.

7 Genetic Variants That Increase Your Risk of Blood Clots
Genes matter when it comes to how quickly your blood clots – and whether you are at an increased risk for thrombosis. Learn about how blood clotting works and whether you are at risk.

Author Information:   Debbie Moon
Debbie Moon is the founder of Genetic Lifehacks. She holds a Master of Science in Biological Sciences from Clemson University and an undergraduate degree in engineering from Colorado School of Mines. Debbie is a science communicator who is passionate about explaining evidence-based health information. Her goal with Genetic Lifehacks is to bridge the gap between the research hidden in scientific journals and everyone's ability to use that information. To contact Debbie, visit the contact page.