Vitamin D and sun: How much sun should I get to produce it?

Nearly half of the world's population has inadequate levels of vitamin D, according to a meta-analysis of 7.9 million participants. [(Cui et al., 2023)].. The main source of this vitamin is the sun, but how long do you really need to expose yourself to it? And is it true that sunscreen blocks it?

My name is Sebastian Podlipnik and I am Dermatologist at the Melanoma and Skin Cancer Unit of Hospital Clínic de Barcelona. Every day I see patients who are looking for the balance between obtaining sufficient vitamin D from the sun and protect your skin from ultraviolet damage. In this article I will give you answers based on the latest scientific evidence, with the collaboration of two great specialists.

What is vitamin D and why is it called "the sunshine vitamin"?

La vitamin D is actually a hormone, not a vitamin. It is known as the sunshine vitamin because your skin produces it when exposed to ultraviolet B (UVB) radiation. Its main function is to regulate the absorption of calcium and phosphorus, which are essential for bone health.

But its functions go far beyond the bones. Vitamin D receptors are present in virtually every cell in the body and regulate more than 200 genes. They are involved in immune function, cardiovascular health, glucose metabolism and protection against infection.

Molecular composition of vitamin D or sunshine vitamin
Molecular structure of vitamin D. It is synthesized in the skin from solar UVB radiation.
Calcitriol (1,25(OH)2D)
It is the active form of vitamin D. It is produced in the kidneys from vitamin D synthesized by your skin or ingested with food. It is the molecule that interacts with cell receptors throughout the body.

How long do you have to sunbathe to get vitamin D?

In summer, between 5 and 10 minutes of sunshine at noon with exposed face, arms and legs (approximately 35% of body surface area) is sufficient to maintain adequate vitamin D levels in fair-skinned people. [(Elliott et al., 2023)].. In winter, in mid-high latitudes like Barcelona (41°N), more than 45 minutes are needed, and may not be enough. These times are approximate: they vary according to the month, your latitude and your phototype.

The Spanish Photobiology Group of the AEDV has calculated the exact minutes of exposure needed according to season and time of day for phototype II-III skin in Spain:

Time of day Winter Spring Summer Autumn
10:00 - 11:00 82 min 44 min 26 min 44 min
12:00 - 15:00 22 min 12 min 7 min 12 min
16:00 - 18:00 79 min 43 min 25 min 43 min

Source: Spanish Photobiology Group (AEDV). Indicative data for phototype II-III at latitude ~40°N (peninsular Spain). The minutes vary according to the exact month, latitude and altitude of your location. At higher latitudes (northern Europe) or in transition months (October, March), the times required increase considerably.

La best time for sunbathing and produce vitamin D is between 12:00 and 15:00, when UVB radiation is most intense. Paradoxically, this is also the period with the highest risk of sunburn. For this reason, exposure should be brief and controlled.

Diagram showing the amount of UVB radiation from the sun needed to produce vitamin D.
UVB radiation is the only radiation that stimulates the production of vitamin D in the skin. Its intensity varies according to the time of day and the season.

What part of the body to expose to the sun for vitamin D?

Vitamin D synthesis is directly dependent on the exposed skin surface. The ideal is to expose face, forearms and legs, which is equivalent to approximately 35% of the body surface. The more skin you expose, the less time you need in the sun to produce the same amount of vitamin D.

If you only expose your hands and face (which is common in winter), the available surface area is so small that you would need much more exposure time, and at many times of the year it would not be enough. So in the spring and summer months, taking the opportunity to expose your arms and legs for a few minutes can make a real difference to your vitamin D levels.

A practical fact that I share with my patients: you don't need to wear a bathing suit. Just roll up your shirt sleeves and wear shorts during a midday walk. Those few minutes with your forearms and legs in the sun are enough in summer.

How do you know how many minutes of sun you need? The UV-Derma app

If you find it difficult to calculate how long you should expose yourself to the sun, the Spanish Academy of Dermatology has developed a very useful tool: the application UV-Derma. It works with geolocation data and tells you in real time how many minutes of sun exposure you need according to your location, the time of day and your phototype.

The app also warns you when the UV index is too high and you should protect yourself. It is especially useful in spring and summer, when the difference between a beneficial exposure and a sunburn can be a matter of minutes. You can download it for free at Android and in iOS.

UV-Derma application from the AEDV that indicates how many minutes of sunlight are necessary to produce vitamin D.
The AEDV's UV-Derma app calculates the minutes of sun exposure needed according to your phototype, location and time of day.

Why does more sunshine NOT mean more vitamin D?

Your skin has a self-regulating system that limits vitamin D production. Once it accumulates enough previtamin D3, it converts it into inactive photoproducts (lumisterol and tachisterol) instead of more vitamin D [(Holick, 2007)]. It is impossible to get vitamin D intoxication from the sun, precisely because this mechanism acts as a safety switch.

To understand it better: a full-body exposure equivalent to a minimal erythematous dose (1 MED, the point just before reddening) produces between 10,000 and 25,000 IU of vitamin D. That's a huge amount. But after that point, the skin produces no more. The receptors become saturated. All the additional UV radiation you receive will only generate DNA damage to your cells, not more vitamin D.

This has a practical implication that I like to explain to my patients: 10 minutes of sunshine a day for 7 days is much more efficient than 70 minutes in a single day.. Systematic reviews confirm that repeated sub-erythemal doses (below the burn) are more efficient in maintaining vitamin D levels than prolonged exposures. [(Webb et al., 2021)].. Short and frequent exposures maintain a stable 25(OH)D plateau, while long and sporadic exposures only add to the risk of burns.

Graph showing how vitamin D production in the skin reaches a plateau after 15-20 minutes in the sun.
Skin production of vitamin D peaks in 15-20 minutes. More time in the sun does not produce more vitamin D.

Understanding this saturation mechanism completely changes the way we think about vitamin D and the sun. It is not about accumulating hours of exposure, but about being consistent with short exposures.

"More sun doesn't raise your vitamin D, it just raises your risk of skin cancer. Your skin already knows how much vitamin D it needs to produce."

Dr. Sebastian Podlipnik

Can vitamin D be generated using sunscreen?

Yes, you can. A systematic review published in the British Journal of Dermatology concluded that there is little evidence that sunscreen decreases vitamin D levels under actual use conditions. [(Neale et al., 2019)]. The reason is simple: in real life, no one applies the recommended amount of sunscreen on 100% of their skin.

A clinical trial conducted in Tenerife showed that volunteers wearing SPF 15 sunscreen during a week's vacation significantly increased their vitamin D levels (+19 nmol/L), without suffering burns. [(Young et al., 2019)]. The most recent study (Sun-D Trial, 2025) with 639 participants using SPF 50+ on a daily basis showed that the difference in vitamin D levels compared to usual use was only 5.2 nmol/L. [(Tran et al., 2025)].. A modest and compensable difference with diet or supplementation.

If you want to know what sunscreens I recommend, I wrote a complete guide on the best sunscreens according to a dermatologist.

Other common myths

  • Vitamin D through a window: This is not possible. The glass blocks virtually all UVB radiation, which is the only radiation that stimulates vitamin D synthesis in the skin.
  • Tanning beds and vitamin D: Tanning beds emit mainly UVA rays, which do not produce vitamin D. Only UVB rays generate it. Only UVB rays generate vitamin D. In addition, tanning beds significantly increase the risk of melanoma. You can read more about risks of UVA rays in tanning beds.

Are you concerned about your sun exposure or vitamin D levels?

I can help you find the right balance for your skin type.

Do oral photoprotection capsules affect vitamin D?

No, oral photoprotective supplements do not interfere with vitamin D production. Unlike a topical sunscreen (which absorbs or reflects UVB rays before they reach the skin), the capsules with Polypodium leucotomos (Fernblock) act by a completely different mechanism: they are antioxidants that neutralize cell damage. then that the radiation has already penetrated the skin (Parrado et al., 2020).

This means that UVB photons continue to reach the epidermis and activate the conversion of 7-dehydrocholesterol to previtamin D3 normally. Oral photoprotection reduces erythema (redness) and DNA damage, but it does not block vitamin D synthesis.

In fact, a recent study showed that the combination of extracts from Polypodium leucotomos y Aspalathus linearis can even protect vitamin D receptors (VDR) of oxidative stress damage in ex vivo skin models [(Barahona-López et al., 2026)]. In other words, far from harming vitamin D, they could help preserve its signaling.

Bottom line: if you take oral photoprotection capsules as a supplement to your sunscreen, you can rest easy about your vitamin D levels. These supplements are an additional layer of protection, not a substitute for topical sunscreen, and do not affect your ability to produce this vitamin.

The Mediterranean paradox: why is there so much vitamin D "deficiency" in Spain?

Spain is one of the countries with the most hours of sunshine in Europe, yet the vitamin D levels of its population are similar or even lower than those of Nordic countries. A population-based study of more than 500,000 people in Catalonia found that approximately 80% of the young people had suboptimal 25(OH)D levels, below 30 ng/mL. [(Díaz-Rizzolo et al., 2022)].. A fact that, at first sight, seems incredible for a Mediterranean country.

Mediterranean paradox: Spain has plenty of sunshine but 80 percent of young people in Catalonia have low vitamin D levels
The Mediterranean paradox: despite the hours of sunshine, vitamin D levels in Spain are similar to those in Nordic countries.

In my clinical practice in Barcelona I see these numbers on a daily basis. How is this possible? There are several explanations that complement each other:

  • Indoor living: Most of the population spends more than 90% of the day inside buildings, offices or transport. The Spanish sun is useless if you don't go out to receive it.
  • Working hours: In Spain, people usually work during the central hours of the day (12:00-15:00), which are precisely the hours of highest UVB radiation and maximum vitamin D synthesis.
  • Selection bias: Vitamin D determinations are usually ordered in people with clinical suspicion (fatigue, bone pain, osteoporosis), not in the general healthy population. This inflates the "deficiency" figures because we preferentially measure those most likely to be deficient.
  • Insufficient dietary intake: The Spanish diet, despite being Mediterranean, provides less vitamin D than that of Nordic countries, where many foods are fortified by law.

But there is a deeper question that few dare to ask: Are the laboratory thresholds too demanding? The Endocrine Society considers 20 ng/mL (50 nmol/L) to be sufficient for bone health in most adults. [(Demay et al., 2024)]., while other groups propose 30 ng/mL as optimal. The difference between the two thresholds turns millions of "healthy" people into "deficient" at a stroke. In the Catalan study, if we apply the 20 ng/mL threshold instead of 30 ng/mL, the deficiency figures drop dramatically. The question is not only whether vitamin D is lacking, but whether we are measuring with the right ruler.

Low vitamin D: cause of disease or consequence?

This is probably the most important debate about vitamin D today. Observational studies show consistent associations between low vitamin D levels and increased risk of mortality, cancer, cardiovascular disease, diabetes and dementia. If we were to read only these studies, the conclusion would be clear: everyone should supplement. However, when researchers put it to the test with clinical trials, the results were surprising.

The VITAL study, published in the New England Journal of Medicine, is the largest clinical trial to date on vitamin D supplementation. 25,871 participants took 2,000 IU daily for 5.3 years. The result? No reduction in the incidence of invasive cancer (HR 0.96, p=0.47), or cardiovascular events (HR 0.97, p=0.69). All-cause mortality was practically identical between the group taking vitamin D and the group taking placebo (HR 0.99). [(Manson et al., 2019)].

A subsequent meta-analysis published in the BMJ compiled data from 52 clinical trials with 75,454 participants and confirmed these findings: vitamin D supplementation did not reduce all-cause mortality (RR 0.98). The only positive signal was a 16% reduction in cancer-specific mortality (RR 0.84, CI 0.74-0.95). [(Zhang et al., 2019)].

How do we explain this discrepancy between what observational studies show and what happens when we actually supplement? A systematic review published in The Lancet Diabetes & Endocrinology, which analyzed 290 prospective studies and 172 clinical trials, proposed a perspective-changing hypothesis: low vitamin D is a marker of disease, not a cause of disease. When a person becomes ill, the inflammatory processes inherent to the disease reduce 25(OH)D levels. This creates a statistical association (more disease = less vitamin D) that seems causal but is not. [(Autier et al., 2014)]..

This does not mean that vitamin D does not matter. It means that supplementing blindly in people with no real deficiency does not improve health. Vitamin D is essential for bones, the immune system and probably for reducing cancer mortality. But taking it as if it were insurance against everything is a simplification that science does not support.

How to obtain vitamin D from the diet?

Approximately 10-20% of the vitamin D we need comes from food. Although few foods contain it naturally, a well-planned diet can supplement what your skin produces from the sun. I've reached out to a great friend and nutrition specialist for her expert insight.

Dr. María José Escaffi, specialist in nutrition and vitamin D.

Dr. María José Escaffi

Internal Medicine, Mg Nutrition, MBA. Clínica las Condes, Chile.

There are two forms of vitamin D in the diet: the vitamin D3 (cholecalciferol), of animal origin, present in fatty fish and egg yolks, and the vitamin D2 (ergocalciferol), of vegetable origin, found in certain mushrooms. Vitamin D3 is almost twice as potent as D2 in raising blood levels.

Metabolic and enzymatic pathways of vitamin D formation in skin, liver and kidneys
Vitamin D metabolic pathways: from cutaneous synthesis to the active form (calcitriol).

The recommended daily intake of vitamin D is 400 IU for infants, 600 IU for children and adults up to 70 years of age, and 800 IU for people over 70 years of age and pregnant women.

Food IU per serving
Cod liver oil (5 ml) 600 - 1.360
Sun-dried mushrooms (100 g) 1.600
Sardines in oil (100 g) 500
Salmon (100 g) 360
Mackerel (100 g) 345
Tuna in oil (100 g) 238
Fortified milk (250 ml) 115 - 124
Egg (1 piece) 25

When do you need vitamin D supplements?

Vitamin D supplementation is indicated for specific population groups, not for everyone. The main scientific societies advise against universal supplementation and routine screening in people with no risk factors. [(USPSTF, 2021)]. To discuss this issue, I have contacted my colleague at Hospital Clínic:

Dr. Helena Florez Enrich, rheumatologist, expert in osteoporosis and vitamin D.

Dr. Helena Florez Enrich

Rheumatologist, MD, PhD, Hospital Clínic de Barcelona.

"Although vitamin D deficiency is an endemic problem that affects a large part of the population, supplementation is only indicated for certain risk groups."

Dr. Helena Florez Enrich

The Endocrine Society's 2024 guideline recommends empirical supplementation (without the need to measure levels) in these groups [(Demay et al., 2024)].:

  • Institutionalized elderly and people at high risk of falling or fractures
  • Patients with osteoporosis or fragility fractures
  • People with malabsorption: bariatric surgery, inflammatory bowel disease, celiac disease, celiac disease
  • People with little sun exposure: for cultural, work or medical reasons
  • People with dark skin: melanin reduces cutaneous synthesis of vitamin D
  • Pregnant women: maternal deficit is a risk factor for infantile rickets. If you are pregnant, you will also be interested in my article on sunbathing in pregnancy
  • Infants exclusively breastfed and children from 1 to 4 years of age
  • People with obesity (BMI >30)

For healthy adults under 75 years of age with no risk factors, the recommendation is not to exceed 600-800 IU daily and not to perform routine vitamin D screening.

Comparison between normal bone and osteoporotic bone due to vitamin D deficiency.
Vitamin D is essential for bone health. Chronic deficiency contributes to osteoporosis.

The risks of unprotected sunbathing: my perspective as a dermatologist

Excessive ultraviolet radiation is the main preventable risk factor for the types of skin cancer, including melanoma. It also accelerates skin aging, generates sunspots, and may cause actinic keratoses, precancerous lesions frequent in photoexposed areas.

A recent consensus of European experts in dermato-oncology is clear: "Vitamin D synthesis does not justify deliberate unprotected UV exposure." [(JEADV, 2025)]. The priority should be to seek shade and protective clothing, using sunscreen as a supplementary measure.

In Europe, the so-called "vitamin D winter" lasts an average of 126 days per year, with up to 36-fold differences in UVB radiation between the summer peak and the winter trough. [(Khanna et al., 2022)].. In Barcelona, between November and February, skin synthesis is minimal. At that time, diet and supplements (if you belong to a risk group) are the best option.

Another vitamin that has protective effects against skin cancer is nicotinamide (vitamin B3), which you can combine with photoprotection. If you have ever burned yourself trying to get vitamin D, here's what I explain how to treat a sunburn. You can also consider the oral sunscreen supplements as a complement.

Frequently asked questions about vitamin D and the sun

How many minutes of sun per day do I need for vitamin D?

In summer, 7 to 10 minutes at midday with exposed face and arms is sufficient for fair-skinned people. In winter in Spain, you need between 20 and 45 minutes, and in months from November to February it may not be enough to maintain optimal levels at latitudes above 40°N.

Can vitamin D be obtained through a window?

No. Window glass blocks virtually all UVB radiation, which is the only radiation capable of stimulating vitamin D production in your skin. You need direct exposure to the sun, no glass in between.

Can vitamin D be generated with sunscreen?

Yes. Three studies published in the British Journal of Dermatology confirm that, even when using SPF 15 to SPF 50+ sunscreen, the skin still produces vitamin D. In real life, no one applies sunscreen over 100% of their skin, so there is always exposed surface area left that synthesizes vitamin D.

Why doesn't more sunshine produce more vitamin D?

Because your skin has a saturation mechanism. When it accumulates enough previtamin D3, it converts it into inactive photoproducts (lumisterol and tachysterol). After 15-20 minutes of exposure, you do not produce more vitamin D but increase your risk of sunburn and skin cancer.

Do tanning beds produce vitamin D?

No. Tanning beds emit mainly UVA rays, which do not stimulate vitamin D production. Only UVB rays generate vitamin D, and tanning beds emit hardly any. Moreover, their use significantly increases the risk of melanoma.

How long does it take for vitamin D to rise with supplements?

With adequate supplementation (800-2,000 IU per day), 25(OH)D levels usually normalize in 8 to 12 weeks. Your doctor can verify this with a blood test. Do not take high doses without medical supervision.

Why is there so much vitamin D deficiency in Spain if it is a sunny country?

There are several explanations: living mostly indoors, work schedules that do not coincide with peak UVB radiation hours, and a possible debate about whether current laboratory thresholds are too demanding. A study of more than 500,000 people in Catalonia found suboptimal levels in about 80% of the young people tested.

Consultation with a specialist dermatologist

Vitamin D is essential, but obtaining it should not compromise the health of your skin. With moderate sun exposure, a balanced diet and supplementation when indicated, you can maintain adequate levels without unnecessary risk. If you have concerns about your sun exposure or vitamin D levels, a personalized dermatological assessment can give you peace of mind.

Would you like a personalized assessment?

I can help you find the right balance between sun, vitamin D and skin protection.

Share this article

Subscribe
Notify of
17 Comments
Inline Feedbacks
Check all the comments
Sebastian Podlipnik - Skin cancer

Sebastian Podlipnik

Dermatology Blog

I am a dermatologist and cum laude PhD and author of multiple research studies. I specialize in skin cancer, laser technologies and longevity in dermatology. The intention of this blog is to bring you closer to topics of interest in dermatology and research.

My favorites
Read my book
Subscribe

And get exclusive and quality information for my readers.

Subscribe to my newsletter

To stay informed about the latest news and I will send you my free photoprotection guide