Short answer: sunlight does not contain vitamin D. UVB radiation reaching uncovered skin starts a chemical reaction that allows the body to make vitamin D3. How much you make depends on the UVB reaching you and on your skin, so there is no scientifically defensible “10 minutes works for everyone” rule.

How sunlight produces vitamin D

UVB radiation in roughly the 290 to 320 nm range converts 7-dehydrocholesterol in skin to previtamin D3, which is then converted to vitamin D3. The liver and kidneys subsequently convert vitamin D through additional steps into the forms used and measured in the body.

This is why saying that sunlight “gives you vitamin D” is convenient shorthand but not literally correct. Sunlight supplies the UVB trigger; the vitamin is synthesized in the body.

Why the same sun exposure can produce very different results

  • Season and latitude: the angle of the sun changes how much UVB reaches the surface.
  • Time of day: UVB availability changes through the day.
  • Cloud, pollution and shade: these can reduce UV exposure.
  • Skin pigmentation: melanin reduces UVB penetration, so darker skin generally requires more UV exposure to generate the same amount of vitamin D.
  • Age: older skin is less efficient at producing vitamin D.
  • Clothing and sunscreen: covered skin receives less UVB. Real-world sunscreen use is variable, so its effect is not all-or-nothing.
  • Glass: UVB does not effectively penetrate ordinary window glass, so sitting in sunlight behind a window does not produce vitamin D in the same way as direct outdoor exposure.

How many minutes of sun do you need?

There is no universal number. The U.S. National Institutes of Health notes that the many variables affecting UV exposure and individual response make it difficult to give a single guideline for sufficient vitamin D synthesis.

You may see rules such as 5 to 30 minutes several times per week. These are rough examples, not a personal prescription. The UV dose that produces vitamin D is also the dose family that can damage DNA and increase skin-cancer risk.

More sun is not always better

Vitamin D production eventually reaches biological limits, while UV damage continues to accumulate. Deliberate sunburn is never a sensible vitamin D strategy. Tanning beds add UV exposure and are not a safe workaround. UV exposure can also change skin-surface chemistry within minutes; see our review of why skin can smell different after sun or UV exposure.

If the goal is simply to correct low vitamin D status, diet and supplements provide a controllable dose without adding UV exposure. For supplement dosing and safety context, see our Vitamin D3 guide on upper limits and N=1 experiments.

Can a blood test tell whether you get enough?

The standard marker is serum 25-hydroxyvitamin D [25(OH)D]. A blood test is more informative than guessing from sun exposure because two people with similar outdoor habits can have different levels.

Does vitamin D ‘boost immunity’?

Vitamin D participates in immune function, but that does not mean more vitamin D automatically creates a stronger immune system or prevents every infection. Deficiency and supplementation should be discussed in terms of measured status, specific outcomes, and evidence rather than a generic “immune boost.”

Who is more likely to have low vitamin D?

Risk can be higher in people with limited sun exposure, older adults, people with darker skin, people with disorders that reduce fat absorption, and some people with obesity or after bariatric surgery. Individual needs still vary.

Practical takeaway

  • Treat sunlight as one possible source of vitamin D, not as a precisely doseable supplement.
  • Do not use sunburn or tanning as a vitamin D strategy.
  • If you are concerned about deficiency, measure 25(OH)D rather than estimating your level from outdoor time.
  • Use food or supplements when an adequate intake cannot be achieved safely or reliably from sun exposure.

Questions people ask

Can sunlight through a window make vitamin D?

Not meaningfully. Ordinary glass blocks the UVB wavelengths needed for skin vitamin D production.

Is afternoon sunlight good for vitamin D?

It depends on the UVB available at your location and season. Clock time alone is not enough to answer the question.

Does sunscreen completely stop vitamin D production?

Sunscreen can reduce UVB reaching the skin, but real-world application is imperfect. Sun protection is still recommended because UV radiation is carcinogenic.


Sources

NIH Office of Dietary Supplements: Vitamin D Fact Sheet for Health Professionals – UVB mechanism, factors affecting synthesis, testing, diet and supplementation.

NIH Office of Dietary Supplements: Vitamin D Fact Sheet for Consumers – practical guidance on sun exposure, windows, risk groups and supplements.

Medical information

This article may contain published medical evidence, clinical context, personal observations, or hypotheses. These are not equivalent levels of evidence. See the Editorial & Medical Review Policy and Medical Disclaimer. This content is educational and does not provide an individual diagnosis or treatment plan.

Tagged in: