Sunlight triggers vitamin D production through a photochemical reaction in your skin, not through warmth or visible light. Specifically, ultraviolet B radiation breaks open a ring in a cholesterol-like molecule sitting in your outer skin layers, launching a chain of conversions that eventually yields the hormone your body uses to regulate calcium, bone growth, and immune function. The process is surprisingly precise, dependent on the right wavelength of UV hitting the right molecule at the right angle, and it is shaped by everything from your latitude to your age to the genes you inherited.
The Photochemical Reaction in Your Skin
Your epidermis, the outermost layer of skin, contains a molecule called 7-dehydrocholesterol (7-DHC). It is a natural part of your skin’s chemistry, a cholesterol precursor that happens to absorb UVB photons in the 280–315 nanometer range. When a UVB photon strikes a 7-DHC molecule, it delivers enough energy to crack open one of the molecule’s carbon rings. That ring-opening converts 7-DHC into previtamin D3.
Previtamin D3 is not yet useful to your body. It needs heat to rearrange into vitamin D3 (cholecalciferol), and your skin temperature provides exactly that. This thermal step takes hours, not seconds, which is why you do not get an instant spike of vitamin D the moment you walk outside. Research using lab-grown skin models has confirmed this sequence: UVB exposure generates previtamin D3 first, which then slowly converts to vitamin D3, which is then further processed into its active hormonal forms.1PubMed. UVB-induced conversion of 7-dehydrocholesterol to 1alpha,25-dihydroxyvitamin D3 in an in vitro human skin equivalent model Studies on UVB conversion kinetics have shown that over roughly 30 minutes of sun exposure, the ring of 7-DHC opens to generate previtamin D3, which then undergoes the thermal rearrangement to cholecalciferol.2PubMed Central. From 7-dehydrocholesterol to vitamin D3: Optimization of UV conversion procedures toward the valorization of fish waste matrices
From Skin to Bloodstream to Active Hormone
The vitamin D3 your skin produces is biologically inert. Before it can do anything, it has to pass through two separate organ systems. First, it enters your bloodstream and travels to the liver, where an enzyme converts it to 25-hydroxyvitamin D, often written as 25(OH)D. This is the form your doctor measures in a blood test because it circulates for weeks and reflects your overall vitamin D stores. The liver enzyme responsible for this step, CYP2R1, has been confirmed through genetic studies as the key player: people born with mutations in CYP2R1 have chronically low 25(OH)D levels and classic vitamin D deficiency symptoms, even with normal sun exposure.3PubMed Central. Genetic evidence that the human CYP2R1 enzyme is a key vitamin D 25-hydroxylase
The second conversion happens mainly in the kidneys, where another enzyme, CYP27B1, adds a second hydroxyl group to produce 1,25-dihydroxyvitamin D, the fully active hormone (calcitriol). Your body tightly controls this final step. Parathyroid hormone ramps it up when calcium is low; the hormone FGF23 and calcitriol itself dial it down when levels are sufficient.4PubMed Central. Regulation of 1 and 24 hydroxylation of vitamin D metabolites in the proximal tubule This feedback loop means your kidneys act as a gatekeeper, producing only as much active vitamin D as the body signals it needs.5PubMed Central. Vitamin D metabolism, mechanism of action, and clinical applications
Interestingly, the kidneys are not the only place that final conversion happens. Dozens of tissues, including the skin itself, the colon, the brain, and immune cells, also express the CYP27B1 enzyme. In these tissues, locally produced calcitriol acts on nearby cells rather than entering general circulation, regulating processes like cell growth and immune responses in what researchers call an intracrine or paracrine role.6PubMed Central. Extrarenal expression of the 25-hydroxyvitamin D-1-hydroxylase This local production has been confirmed through protein staining in tissues as varied as the adrenal glands, pancreas, and lymph nodes.7The Journal of Clinical Endocrinology & Metabolism. Extrarenal Expression of 25-Hydroxyvitamin D3-1α-Hydroxylase
Why Only UVB Matters, and Why It Is Easy to Miss
Not all ultraviolet light is equal here. UVA, which makes up roughly 95% of the UV reaching the ground, does not have the right energy to crack open 7-DHC. Only UVB, with its shorter wavelength and higher energy, can trigger the reaction. And UVB is far more easily blocked by the atmosphere. When the sun sits low in the sky, its light passes through a thicker slice of atmosphere, and the ozone layer absorbs most of the UVB before it reaches you. That is why early morning and late afternoon sun feels warm but does almost nothing for vitamin D production.
The precise wavelengths that matter have been the subject of ongoing refinement. A study that irradiated 75 healthy volunteers with five different UV spectra found that the long-used action spectrum for previtamin D3 production needed a correction when researchers checked actual blood levels of 25(OH)D3 rather than just measuring previtamin D3 in isolated skin. The peak effectiveness shifted slightly toward shorter wavelengths than previously assumed, meaning prior calculations about how much sun exposure you need were somewhat off.8PubMed Central. A revised action spectrum for vitamin D synthesis by suberythemal UV radiation exposure in humans in vivo Separately, research has shown that the action spectrum for vitamin D production is more narrowly concentrated in the UVB range than the action spectrum for sunburn, which extends further into UVA. Using sunburn intensity as a proxy for vitamin D production can be off by as much as fivefold.9PubMed. On the relationship between erythemal and vitamin D action spectrum weighted ultraviolet radiation
Latitude, Season, and the “Vitamin D Winter”
Where you live on the planet may be the single biggest factor in how much vitamin D your skin can make. At latitudes near the equator, the sun is high enough year-round that UVB reaches the ground in meaningful amounts every day. A study comparing a city near 3°S latitude with one at 23°S found that vitamin D production happened throughout the year in both places, but the equatorial city produced roughly 40% more on average, and the higher-latitude city experienced a sharp drop in winter, with conversion falling to less than half of equatorial levels during June.10PubMed. Sun-induced production of vitamin D(3) throughout 1 year in tropical and subtropical regions: relationship with latitude, cloudiness, UV-B exposure and solar zenith angle
Move further from the equator and the problem gets worse. Classic research by Michael Holick’s group showed that skin or 7-DHC samples exposed to sunlight in Boston (about 42°N) from November through February produced zero previtamin D3 on cloudless days. In Edmonton, Canada (52°N), the dead zone stretched from October through March. Only at latitudes below about 34°N did midwinter sun still drive meaningful conversion.11PubMed. Influence of season and latitude on the cutaneous synthesis of vitamin D3: exposure to winter sunlight in Boston and Edmonton will not promote vitamin D3 synthesis in human skin This “vitamin D winter” is a genuine biochemical dead zone, not just a period of reduced production. No amount of winter sun exposure at those latitudes will move the needle.
How Much Skin, How Much Time
You do not need a beach vacation to produce vitamin D during months when UVB is available. Modeling work has estimated that generating about 400 IU of vitamin D per day, a common dietary recommendation, takes roughly one-third of the time it would take to start turning pink, for a person with a moderate skin type exposing about 600 square centimeters of skin (roughly both forearms). Double that skin area and you need about one-sixth of the sunburn time.12PubMed. Determining an Effective UV Radiation Exposure Time for Vitamin D Synthesis in the Skin Without Risk to Health: Simplified Estimations from UV Observations
A separate model found that 400 IU per day is readily achievable during a midday lunch break with no sunburn risk, for all latitudes during at least part of the year, and year-round at tropical latitudes. That assumes exposing the lower arms and legs. Higher targets like 1,000 IU per day are still achievable through sun alone during summer but require exposing more skin area; 4,000 IU per day, the upper tolerable intake set by some guidelines, is not realistically achievable through lunchtime sun for most of the globe and most of the year.13PubMed. Ultraviolet Exposure Scenarios: Balancing Risks of Erythema and Benefits of Cutaneous Vitamin D Synthesis
Your Skin’s Built-In Overdose Protection
One of the more elegant features of this system is that your skin cannot produce a toxic amount of vitamin D from sun exposure alone. Once previtamin D3 accumulates in the skin, continued UV exposure starts converting it into inactive byproducts, lumisterol and tachysterol, instead of producing more vitamin D. The previtamin D3 concentration in the skin reaches a plateau at less than one minimal erythemal dose (the threshold for mild sunburn), and everything beyond that just generates inactive molecules.14The American Journal of Clinical Nutrition. Sun exposure and vitamin D sufficiency – Section: ULTRAVIOLET ACTION SPECTRA AND BIOLOGICAL RESPONSES This is why vitamin D toxicity occurs from supplements, not from sunbathing. Your skin self-limits. Your digestive tract does not.
Skin Color, Age, and Individual Variation
Melanin absorbs UVB, which is how it protects deeper skin layers from DNA damage. The logical assumption for decades was that darker skin dramatically reduces vitamin D synthesis. The real story is more nuanced. A controlled comparison of extreme skin types (very fair versus very dark) found that the melanin inhibition factor for vitamin D synthesis was about 1.3 to 1.4, meaning darker skin produces vitamin D about 25–30% less efficiently per unit of UV dose.15PubMed. Melanin has a Small Inhibitory Effect on Cutaneous Vitamin D Synthesis: A Comparison of Extreme Phenotypes That is much smaller than the protection factor melanin offers against DNA damage in the basal layer, which is about 60-fold. The reason: 7-DHC is distributed throughout the upper epidermis, including layers that have relatively little melanin even in the darkest skin types.16JBMR Plus. Physical Determinants of Vitamin D Photosynthesis: A Review – Section: Personal Factors The modest per-dose difference may still matter over a lifetime, but it is not the dramatic several-fold effect that older textbooks suggested.
Age, on the other hand, has a clear and substantial effect. The concentration of 7-DHC in the epidermis declines as you get older. A study comparing skin samples from people aged 8 to 92 found that people in their late 70s and 80s produced less than half the previtamin D3 of younger people when exposed to the same UV dose.17PubMed Central. Aging decreases the capacity of human skin to produce vitamin D3 This is a straightforward depletion of the raw material, not a change in the UV reaction itself.
Genetics adds another layer. Variants in the gene for vitamin D binding protein (GC gene) affect how much 25(OH)D circulates in your blood and how strongly your levels respond to supplementation. In a randomized trial in infants, those homozygous for certain minor alleles showed the lowest 25(OH)D concentrations and the smallest increases when given high-dose vitamin D3.18The Journal of Clinical Endocrinology & Metabolism. Genetic Variation of the Vitamin D Binding Protein Affects Vitamin D Status and Response to Supplementation in Infants Older adults carrying certain rare alleles of the same gene also benefit less from summer sun, with 25(OH)D levels running roughly 9–10 nmol/L lower than those with the common alleles even during high-UV months.19Epidemiology. Genetic Variations in the Vitamin D Binding Protein and Season-Specific Levels of Vitamin D Among Older Adults Two people standing side by side in the same sun can end up with meaningfully different vitamin D levels purely because of inherited variation in how the vitamin is carried and processed.
Does Sunscreen Block Vitamin D Production?
In a lab, a thick layer of sunscreen blocks nearly all UVB and should shut down vitamin D synthesis. In the real world, people do not apply sunscreen the way lab tests assume. They miss spots, apply too little, sweat it off, and reapply inconsistently. A review of the evidence, including randomized trials and observational studies, found that regular sunscreen use in real-life settings did not meaningfully lower 25(OH)D levels. In some observational studies, sunscreen users actually had higher vitamin D levels, likely because people who apply sunscreen are the same people who spend more time outdoors.20PubMed. The effect of sunscreen on vitamin D: a review
An early randomized trial in Australia found that sunscreen users and placebo groups both saw their 25(OH)D levels rise by similar amounts over summer.21JAMA Dermatology. The Effect of Regular Sunscreen Use on Vitamin D Levels in an Australian Population: Results of a Randomized Controlled Trial However, a more recent and larger randomized trial, the Sun-D Trial, did find a statistically meaningful difference: the group assigned to daily sunscreen application was more likely to be vitamin D deficient at the end of the study compared to the control group, with deficiency rates of about 46% versus 37%.22British Journal of Dermatology. Effect of daily sunscreen application on vitamin D: findings from the open-label randomized controlled Sun-D Trial The absolute difference in blood levels was modest, around 5 nmol/L, but it was consistent across subgroups. The emerging picture is that very diligent, daily, whole-body sunscreen application can reduce vitamin D production somewhat, while the casual way most people actually use sunscreen leaves enough UV exposure to maintain adequate levels.
Sun Exposure Versus Supplements
If both sun and pills raise vitamin D, does it matter which route you use? A randomized trial in young adults compared controlled sun exposure advice with 1,000 IU/day oral vitamin D3. After eight weeks, the supplementation group saw a substantially larger increase in blood levels: an adjusted mean difference of about 8.5 ng/mL above placebo, versus 2.2 ng/mL for the sun exposure group. Over half the supplement group reached sufficient 25(OH)D levels, compared to about 12% of the sun group.23Elsevier / Clinical Nutrition. Effect of sun exposure versus oral vitamin D supplementation on serum 25-hydroxyvitamin D concentrations in young adults: A randomized clinical trial A big caveat: compliance with sun exposure instructions was low. People simply did not go outside as often or expose as much skin as the protocol called for. In those who did comply adequately, their levels rose more meaningfully. This mirrors the real-world challenge: sun-based vitamin D production depends on behavior, weather, latitude, and season, while a supplement just needs to be swallowed.
The Evolutionary Backstory
The link between UV exposure and vitamin D likely shaped the evolution of human skin color. The vitamin D–folate hypothesis proposes that skin pigmentation evolved as a balancing act: darker skin near the equator to protect against UV-driven destruction of folate (a B vitamin critical for fetal development), and lighter skin at higher latitudes to allow enough UVB through for vitamin D synthesis.24PubMed Central. The Vitamin D-Folate Hypothesis as an Evolutionary Model for Skin Pigmentation: An Update and Integration of Current Ideas The geographic gradient of skin pigmentation among indigenous populations tracks closely with UV radiation levels, consistent with the idea that as human ancestors migrated out of the tropics, lighter skin was selectively advantageous for maintaining vitamin D synthesis in lower-UV environments.25PubMed. The evolution of human skin coloration More recent biophysical work continues to support this framework.26PubMed. Biophysical evidence to support and extend the vitamin D-folate hypothesis as a paradigm for the evolution of human skin pigmentation
An interesting footnote from veterinary science: dairy cows also synthesize vitamin D3 evenly across their body surface when exposed to sunlight, and their hair does not block the process the way clothing blocks it in humans. Researchers confirmed this by covering portions of cows’ bodies and measuring blood levels, finding a clear inverse relationship between covered body surface and circulating 25(OH)D3.27PubMed Central. Vitamin D(3) synthesis in the entire skin surface of dairy cows despite hair coverage The finding underscores that UVB penetration through a surface covering depends on the material: thin animal hair transmits enough UV to drive the reaction, while woven fabric does not.
How Rickets Connected the Dots
The scientific understanding of this whole process was pieced together over more than a century, and the clues came largely from sick children. By the late 1800s and early 1900s, rickets was rampant among children in northern industrial cities. Doctors noticed that children in sunnier, less polluted areas rarely got the disease, and that cod liver oil could treat it, but nobody knew why both sunshine and fish oil worked against the same bone disorder. It was not until the 1920s and 1930s that researchers identified vitamin D, confirmed its presence in cod liver oil, and demonstrated that ultraviolet light could generate it in the skin.28PubMed. Vitamin D, cod-liver oil, sunlight, and rickets: a historical perspective The geographic association, children in smog-choked northern cities getting rickets while children in sunny rural areas did not, was one of the earliest examples of an environmental exposure being traced to a specific biochemical pathway. Fortification of milk with vitamin D followed shortly after and largely eliminated rickets as a public health crisis in industrialized countries, though the disease still appears in populations with limited sun exposure and inadequate dietary intake.