Sunlight triggers your skin to make vitamin D, and vitamin D is the main vitamin your body produces from sunshine. It is not the only nutrient linked to sun exposure in research, but it is the one with a clear, well-established pathway from sunlight to the body. Sunlight also affects other aspects of health, though those effects work through different mechanisms than vitamin production.
The process starts when ultraviolet B (UVB) rays in sunlight reach a form of cholesterol in your skin. A series of chemical steps follow, first in the skin and then in the liver and kidneys, that turn this cholesterol into active vitamin D. Without enough UVB exposure, the body relies on food and supplements, and very few foods contain meaningful amounts naturally.
What Vitamin From Sunshine Does Your Body Actually Make?
Your skin produces vitamin D3, also called cholecalciferol. This is the same form found in most animal-based foods and in many supplements.
The pathway works like this. UVB radiation converts 7-dehydrocholesterol, a cholesterol compound present in skin cells, into a precursor molecule. That precursor rearranges into vitamin D3. From the skin, vitamin D3 enters the bloodstream and travels to the liver, where it is converted into 25-hydroxyvitamin D. This is the form most blood tests measure. The kidneys then convert it again into calcitriol, the active hormone form that regulates calcium and phosphate absorption.
Vitamin D behaves more like a hormone than a classic vitamin. It influences calcium balance, bone mineralization, muscle function, and immune cell activity. Receptors for it exist in many tissues, which is why researchers have studied it far beyond bone health.
Sunlight exposure also affects other compounds in the body, including nitric oxide release in the skin and the production of certain immune-signaling molecules. These effects are real but less well understood than the vitamin D pathway. They are an active area of research, not established clinical guidance.
How Does Sunlight Make Vitamin D?
UVB rays are the specific wavelength that drives vitamin D production. Not all sunlight contains enough UVB to do the job.
Several factors determine how much vitamin D your skin can make at any given moment:
- Time of day. UVB is strongest near midday. Early morning and late afternoon sun contains mostly UVA, which does not produce vitamin D.
- Season. In much of the United States, UVB intensity drops enough in winter that skin makes little or no vitamin D from sun, especially in northern latitudes.
- Latitude. The farther you live from the equator, the more UVB is filtered out by the atmosphere, particularly in winter months.
- Altitude. Higher elevations receive more UVB because there is less atmosphere to filter it.
- Skin tone. Melanin absorbs UVB. People with darker skin need longer sun exposure to produce the same amount of vitamin D as people with lighter skin.
- Age. Older skin has less 7-dehydrocholesterol and produces vitamin D less efficiently.
- Sunscreen and clothing. Sunscreen blocks UVB, which is how it prevents sunburn and skin cancer, but it also reduces vitamin D production. Clothing blocks it entirely.
- Glass. Window glass blocks nearly all UVB, so sitting in a sunny window or in a car does not trigger vitamin D production.
These factors interact. Two people outside at the same time in the same place can produce very different amounts of vitamin D.
Is Sunlight the Only Source of Vitamin D?
No. Food and supplements can supply vitamin D, though natural food sources are limited.
Fatty fish such as salmon, tuna, and mackerel contain vitamin D. Egg yolks and some mushrooms contain smaller amounts. In the United States, milk is fortified with vitamin D by regulation, and many plant-based milks, cereals, and juices are fortified as well. Fortification levels vary by product.
Supplements typically provide vitamin D3 or vitamin D2. Both raise blood levels, though research generally shows D3 raises them somewhat more effectively and keeps them elevated longer. For most people, either form works.
Getting vitamin D from food alone is difficult without fortified products. That is one reason fortified milk and other staples became standard in the US.
How Much Sun Do You Need to Make Vitamin D?
There is no single answer, and no official guideline states a required number of minutes of sun exposure for vitamin D. The amount depends on the same factors listed above, which vary widely from person to person and by season.
Some general points are well established. For many people with lighter skin, short exposure of arms and legs during midday sun in summer can produce meaningful vitamin D. People with darker skin, older adults, and those living at high latitudes typically need longer exposure or may not produce much at all in winter.
The World Health Organization and other public health bodies do not recommend intentional sun exposure as a primary strategy for vitamin D, because UV radiation is a known cause of skin cancer. This creates a genuine tension: sun makes vitamin D, but sun also damages skin. Public health guidance generally favors food and supplements over deliberate tanning or prolonged sunbathing.
No clinical guidelines specify a safe amount of sun exposure that maximizes vitamin D while minimizing skin cancer risk. That trade-off is real and unresolved.
Can You Make Vitamin D Through a Window?
No. Standard window glass blocks nearly all UVB rays, and UVB is what your skin needs to produce vitamin D.
UVA passes through glass, which is why you can still get skin damage and premature aging from sun through a window. But UVA does not drive vitamin D synthesis. Sitting in a sunny window, in a car, or in a sunroom will not raise your vitamin D level.
This is a common misunderstanding. The warmth and light you feel through glass are real, but the specific wavelength needed for vitamin D never reaches your skin.
Who Is Most at Risk for Low Vitamin D?
Certain groups are more likely to have low vitamin D levels. This is well documented in clinical research.
- People who live at high latitudes, especially during winter
- People with darker skin tones
- Older adults
- People who spend most of their time indoors
- People who cover their skin for cultural or religious reasons
- Breastfed infants, since breast milk contains little vitamin D
- People with conditions that affect fat absorption, such as celiac disease or Crohn’s disease
- People with obesity, since vitamin D is stored in fat tissue and less is available in the bloodstream
- People taking certain medications that affect vitamin D metabolism
Risk does not equal deficiency. A risk factor means a higher chance of low levels, not a certainty. Blood testing is the only way to know your actual level.
What Blood Level Counts as Sufficient?
There is real disagreement among researchers and medical organizations about the ideal vitamin D blood level.
Most clinical guidelines agree that a 25-hydroxyvitamin D level below 12 ng/mL (30 nmol/L) represents deficiency and needs attention. Many organizations consider 20 ng/mL (50 nmol/L) sufficient for most healthy people. Some researchers and some medical groups argue for higher targets, often 30 ng/mL (75 nmol/L) or above, but this remains debated and is not universally accepted.
The disagreement matters because it affects who gets diagnosed with low vitamin D and who gets treated. If you are considering testing or supplementation, discuss your individual situation with a clinician rather than relying on a single number.
Does Sun Exposure Have Risks?
Yes. UV radiation from the sun is a proven cause of skin cancer, including melanoma, basal cell carcinoma, and squamous cell carcinoma. It also causes sunburn, premature skin aging, and eye damage.
This is not a minor consideration. Skin cancer is the most common cancer in the United States. Any recommendation about sun exposure has to weigh vitamin D production against this well-established risk.
Public health guidance generally emphasizes sun protection, including sunscreen, protective clothing, and avoiding peak sun when possible. For vitamin D, food and supplements are the recommended route for most people because they carry no skin cancer risk.
Frequently Asked Questions
What vitamin do you get from sunshine?
Vitamin D is the vitamin your body produces from sunlight. UVB rays trigger a chemical reaction in your skin that creates vitamin D3.
How long do you need to stay in the sun to make vitamin D?
There is no official guideline specifying how many minutes of sun exposure are needed. The amount depends on your skin tone, location, season, time of day, and other factors, and public health guidance does not recommend intentional sun exposure as a vitamin D strategy.
Can you make vitamin D through a window?
No. Window glass blocks nearly all UVB rays, which are the specific wavelength your skin needs to produce vitamin D. UVA passes through glass but does not trigger vitamin D synthesis.
Is sunlight the only way to get vitamin D?
No. You can also get vitamin D from fatty fish, egg yolks, fortified foods like milk, and supplements. Food and supplements are generally recommended over sun exposure because they carry no skin cancer risk.

