The vitamin your body produces from sunlight is vitamin D, specifically vitamin D3 (cholecalciferol). Unlike every other essential vitamin, which you have to eat, vitamin D3 is manufactured in your skin when ultraviolet B radiation from the sun hits a cholesterol-related compound sitting in your outer skin layers. This makes vitamin D more like a hormone your body builds on demand than a traditional dietary vitamin, and the process is surprisingly sensitive to where you live, what time of year it is, and even how old you are.
How Your Skin Turns Sunlight Into Vitamin D
Your skin contains a molecule called 7-dehydrocholesterol, which is a form of cholesterol concentrated in the outermost layer of skin. When UVB radiation from the sun strikes it, the molecule absorbs that energy and transforms into previtamin D3, which then rearranges itself into vitamin D3.1PubMed Central. Sunlight and Vitamin D: A global perspective for health That vitamin D3 enters your bloodstream and travels to the liver, where it gets converted into 25-hydroxyvitamin D, the form doctors measure in blood tests. From there, the kidneys convert it into its fully active form, which can bind to receptors throughout the body and influence how your cells behave.2PubMed. Vitamin D in health and disease: a literature review
One reassuring feature of this system is that it self-regulates. Your skin cannot produce a dangerous excess of vitamin D from sun exposure alone because prolonged UV exposure breaks down the previtamin D3 and vitamin D3 into inactive byproducts. You can get a sunburn, but you cannot get vitamin D toxicity from sunlight.3PubMed. Contributions of sunlight and diet to vitamin D status That built-in ceiling does not apply to supplements, which is part of why the distinction matters.
Where You Live Changes Everything
The single biggest factor determining how much vitamin D your skin can make is the angle at which sunlight reaches you, and that depends on your latitude and the time of year. When the sun sits low in the sky, UVB rays travel through more atmosphere, and more of them get scattered or absorbed before reaching your skin. In practical terms, if you live at higher latitudes, there are months when no meaningful vitamin D production is possible no matter how long you stand outside.
Research using skin samples and sunlight modeling found that in Boston (about 42°N), sun exposure from November through February produced no detectable previtamin D3 at all. In Edmonton, Canada (52°N), that “vitamin D winter” stretched from October through March. But at lower latitudes, around 34°N and 18°N, winter sunlight still triggered vitamin D production.4The Journal of Clinical Endocrinology & Metabolism. Influence of Season and Latitude on the Cutaneous Synthesis of Vitamin D3 In tropical locations below 35° latitude, vitamin D3 synthesis occurs year-round, though it still dips during winter months. A study comparing a site near the equator (3°S) with one at 23°S found that winter conversion rates at the more southern location dropped by over half compared to the equatorial site.5PubMed. Sun-induced production of vitamin D3 throughout 1 year in tropical and subtropical regions
Time of day matters too. In Cape Town, South Africa, vitamin D production peaked at midday during summer and small amounts were still being generated between 8 and 9 a.m. and between 4 and 5 p.m. During winter, though, peak midday production was less than a third of what was seen in Johannesburg (further north), and almost nothing was produced before 10 a.m. or after 3 p.m.6PubMed. The effect of season and latitude on in vitro vitamin D formation by sunlight in South Africa The practical takeaway: midday sun, roughly between 10 a.m. and 2 p.m., is when UVB is strongest and vitamin D synthesis is most efficient. Early morning and late afternoon sun, while pleasant, contributes little.
Skin Tone, Age, and Genetic Variation
Melanin, the pigment that gives skin its color, absorbs UVB radiation. Because the same UVB wavelengths that trigger vitamin D production are also absorbed by melanin, darker skin makes less vitamin D per minute of sun exposure compared to lighter skin.7PubMed Central. Colour Counts: Sunlight and Skin Type as Drivers of Vitamin D Deficiency at UK Latitudes The size of this effect has been debated. A direct comparison of the lightest and darkest skin types found melanin’s inhibitory factor was only about 1.3 to 1.4, meaning darkly pigmented skin produces roughly 25–30% less vitamin D from the same UV dose rather than the dramatically less that was once assumed.8PubMed. Melanin has a Small Inhibitory Effect on Cutaneous Vitamin D Synthesis: A Comparison of Extreme Phenotypes That difference is small in absolute terms but compounds over weeks and seasons, especially at higher latitudes where UVB is already scarce. It may be enough to explain why darker-skinned people living in northern countries consistently show lower vitamin D levels in population studies.
Age is another factor. The concentration of 7-dehydrocholesterol in your skin declines as you get older. A study comparing skin from people aged 8 to 92 found that by the late 70s and early 80s, the skin’s capacity to produce previtamin D3 had dropped by more than half compared to younger skin.9PubMed Central. Aging decreases the capacity of human skin to produce vitamin D3 This is one reason older adults are disproportionately affected by vitamin D insufficiency, even when they spend reasonable time outdoors.
Genetics add another layer. The protein that carries vitamin D through the bloodstream, vitamin D binding protein (VDBP), comes in several genetic variants. A study in children found that those carrying one variant (the 1S allele) achieved the highest blood levels of vitamin D, while those with a different variant (1F) had the lowest levels regardless of intake. Among 1S/1S children, meeting the recommended dietary intake raised their average vitamin D levels by about 50% compared to those with low intake, whereas 1F/1F children struggled to reach adequate levels even when intake was high.10Pediatric Research. Vitamin D binding protein polymorphisms significantly impact vitamin D status in children This means two people with the same sun exposure, same skin tone, and same diet can end up with meaningfully different vitamin D status.
Does Sunscreen Block Vitamin D Production?
This question comes up constantly, and the answer is more nuanced than either side of the debate usually admits. In controlled lab settings, sunscreen clearly suppresses vitamin D synthesis in skin. An early study found that subjects wearing SPF 8 sunscreen showed almost no rise in blood vitamin D3 after UV exposure, while unprotected subjects saw their levels jump dramatically.11The Journal of Clinical Endocrinology & Metabolism. Sunscreens Suppress Cutaneous Vitamin D3 Synthesis
But real-world use tells a different story. A study using SPF 50+ sunscreen found that while cutaneous vitamin D production dropped by 75–93% depending on the group, circulating 25-hydroxyvitamin D levels in the blood were only reduced by about 7–13%.12PubMed. Sunscreens block cutaneous vitamin D production with only a minimal effect on circulating 25-hydroxyvitamin D The researchers speculated that the body compensates by drawing on other endogenous sources of vitamin D precursors when skin production is suppressed. In everyday life, people also rarely apply sunscreen as thickly or uniformly as in studies, and they miss spots, so some unprotected skin is usually still producing vitamin D. The practical implication: wearing sunscreen for skin cancer prevention is unlikely to put you into vitamin D deficiency on its own, especially if you have other sources.
What Vitamin D Actually Does in Your Body
Vitamin D’s best-known job is managing calcium. It is essential for absorbing calcium from the food you eat in the gut, for maintaining the calcium level in your blood, and for mineralizing bone tissue.13PubMed. Calcium and vitamin D in human health: Hype or real? Without enough vitamin D, your intestines absorb only a fraction of available dietary calcium, which over time weakens bones. Research has suggested that a blood level of at least about 32 ng/mL (80 nmol/L) of 25-hydroxyvitamin D is needed for optimal fracture protection and calcium absorption.14PubMed Central. Calcium and vitamin D: skeletal and extraskeletal health
Beyond bones, vitamin D receptors appear on nearly every type of immune cell, which was the first clue that the vitamin plays a broader role in immune function.15PubMed Central. Vitamin D’s Effect on Immune Function It can influence both the rapid-response arm of the immune system and the slower, more targeted adaptive response.16PubMed Central. Vitamin D and the immune system This is one reason people have historically gotten sicker in winter; beyond the cold weather keeping people indoors together, their vitamin D levels also plummet.
Muscle function is another area where vitamin D matters, particularly for older adults. Evidence suggests that people with blood levels below about 40 nmol/L are most likely to see improvements in muscle performance from supplementation, and a daily dose of 800–1,000 IU appears to reduce falls in this group. Interestingly, very high doses have sometimes backfired, actually increasing fall risk in some studies.17PubMed Central. Vitamin D and muscle function
Low vitamin D has also been linked to cardiovascular problems. Deficiency appears to promote vascular inflammation, dysfunction of the cells lining blood vessels, and the formation of arterial plaques.18PubMed Central. Links between Vitamin D Deficiency and Cardiovascular Diseases Some studies have associated low levels with a higher risk of heart disease and stroke, though the evidence for whether supplementation reverses this risk is less clear-cut.19PubMed Central. Vitamin D and Cardiovascular Diseases: An Update The pattern across much of vitamin D research is consistent: low levels are reliably associated with worse outcomes, but raising levels through supplements doesn’t always produce the improvements you’d expect. Whether sunlight exposure itself carries benefits beyond what a vitamin D pill delivers remains an open question.
How Common Is Deficiency?
Extremely common. A large pooled analysis covering nearly 8 million participants across studies from 2000 to 2022 found that about 16% of people globally had vitamin D levels below the threshold typically classified as deficient (30 nmol/L), while about 48% fell below 50 nmol/L, a level many researchers consider insufficient. Over three-quarters of participants were below 75 nmol/L, a cutoff some experts argue is the minimum for optimal health.20PubMed Central. Global and regional prevalence of vitamin D deficiency in population-based studies from 2000 to 2022 The prevalence was about 1.7 times higher in winter and spring compared to summer and autumn, higher in people living at greater latitudes, and higher in women than men. The Eastern Mediterranean region and lower-middle-income countries were particularly affected.
These numbers highlight a paradox: vitamin D is free, produced by standing in sunlight, yet nearly half the world doesn’t have enough. Modern life is the main culprit. People spend most of their time indoors, cover most of their skin with clothing, and when they are outside, they often wear sunscreen. Add in the latitude-driven vitamin D winter that affects hundreds of millions of people for months at a time, and widespread insufficiency becomes unsurprising.
Getting Vitamin D From Food and Supplements
Very few foods naturally contain meaningful amounts of vitamin D. Fatty fish like salmon and mackerel are the best natural sources, along with egg yolks and beef liver. Many countries fortify milk, orange juice, and cereals with vitamin D, but the amounts added are modest. For people who get little sun, supplements are the most reliable way to maintain adequate levels.
Supplements come in two forms: vitamin D2 (ergocalciferol, derived from fungi) and vitamin D3 (cholecalciferol, typically from animal sources or lichen).21PubMed Central. Differences in the absorption and metabolism of vitamin D2, vitamin D3, and 25 hydroxyvitamin D They are not equally effective. A study giving people physiologically relevant, low doses found that vitamin D3 raised blood levels of 25-hydroxyvitamin D by roughly 74–75%, compared to just 33–34% for vitamin D2, making D3 more than twice as effective at raising vitamin D status.22Nutrition Bulletin. Vitamin D2 vs. vitamin D3: They are not one and the same If you’re choosing a supplement, vitamin D3 is generally the better option unless you need a plant-based form.
Unlike sunlight-derived vitamin D, which is self-limiting, supplemental vitamin D can accumulate to toxic levels. Taking excessive amounts of vitamin D3 or D2 can cause the body to build up too much 25-hydroxyvitamin D, which binds to vitamin D receptors and drives blood calcium dangerously high.23PubMed Central. Vitamin D-Mediated Hypercalcemia: Mechanisms, Diagnosis, and Treatment This is rare at standard supplement doses but has been reported with megadoses. The safety ceiling established by most health agencies is 4,000 IU per day for adults, though some people take more under medical supervision.
Balancing Sun Exposure and Skin Cancer Risk
The same UVB wavelengths that make vitamin D also cause DNA mutations in skin cells, which over time can lead to skin cancer.24PubMed Central. Skin cancer and vitamin D: an update This creates a genuine tension. Dermatologists understandably emphasize sun protection, while vitamin D researchers point out that strict sun avoidance can drive deficiency. Finding the balance has been the subject of considerable debate.
The emerging consensus, endorsed by researchers on both sides, is that brief, unprotected sun exposure is both sufficient for vitamin D production and unlikely to meaningfully increase skin cancer risk. Some researchers have argued that the protective effects of moderate UVB exposure outweigh the mutagenic risks, and that overly aggressive sun-protection messaging may itself cause harm by promoting deficiency.25PubMed. The challenge resulting from positive and negative effects of sunlight Personalized approaches that account for skin type, latitude, and season offer the most practical path forward.26Dermatological Reviews. Sunlight in Small Doses: Balancing Health Benefits and Dermatologic Risks
For most fair-skinned people at mid-latitudes during summer, exposing your face and forearms for roughly 10–15 minutes around midday, a few times per week, is enough to maintain adequate vitamin D levels without burning. Darker-skinned individuals may need somewhat longer. After that brief window, applying sunscreen or covering up for the rest of your time outdoors is a reasonable strategy. During winter at higher latitudes, when UVB is too weak for any vitamin D production, supplementation becomes the only reliable option.
Why Human Skin Color Evolved Around Vitamin D
Vitamin D synthesis has been such a powerful force in human biology that it likely shaped the evolution of skin color itself. The leading theory, known as the vitamin D–folate hypothesis, proposes that human skin pigmentation evolved as a balancing act between two UV-sensitive vitamins. Near the equator, where UVB is intense year-round, dark skin evolved to protect folate (a B vitamin that UV radiation degrades) while still allowing enough UVB through for vitamin D production. As human populations migrated to higher latitudes with weaker UVB, lighter skin evolved to maximize vitamin D synthesis from the limited UV available.27PubMed Central. The Vitamin D−Folate Hypothesis as an Evolutionary Model for Skin Pigmentation
This model treats skin color as a product of two opposing selection pressures. One, generated by intense UVR near the equator, favored dark, melanin-rich skin for photoprotection. The other, driven by the need for UVB photons to sustain vitamin D production in low-UV environments, led to the evolution of depigmented skin.28PubMed Central. Human skin pigmentation as an adaptation to UV radiation The fact that vitamin D was important enough to drive one of the most visible differences in human appearance speaks to how fundamental it is to survival and reproduction. It also helps explain why skin-color mismatches with latitude, such as dark-skinned people living in northern Europe or light-skinned people in tropical Australia, create real health consequences in both directions.
Vitamin D Toxicity From Supplements
Because sunlight-driven production self-limits, vitamin D toxicity is exclusively a supplement problem. When excessive vitamin D3 or D2 is ingested over time, 25-hydroxyvitamin D accumulates and begins binding directly to vitamin D receptors throughout the body, triggering a cascade that raises blood calcium to dangerous levels.23PubMed Central. Vitamin D-Mediated Hypercalcemia: Mechanisms, Diagnosis, and Treatment Symptoms of hypercalcemia include nausea, kidney stones, confusion, and in severe cases, heart rhythm disturbances. Most documented cases involve people taking tens of thousands of IU per day for extended periods, often from misunderstanding dosing instructions or taking multiple supplements that each contain vitamin D. Standard doses of 600–2,000 IU per day, the range most adults fall into, carry no toxicity risk. The key point is that sunlight and supplements are not interchangeable when it comes to safety. Sunlight has a built-in brake; pills do not.