Requests

Laboratory tests

Sunlight and diet: sources of vitamin D

People whose blood test shows low vitamin D often ask whether they can correct it “naturally” by getting more sunlight or changing their diet.

Clínica Alegre practitioner examining a blood sample tube beside sample collection tubes

Reviewed by Dr. Fernando Alegre

Clinical Director · OMD, registration no. 9688

Written by the Clínica Alegre team9-minute read

In this article

There are two parts to the answer. For most people, sunlight exposure is the main source of vitamin D because the skin produces it when exposed to ultraviolet B radiation. Diet contributes less, but may play an important role in months when sunlight is weak or for people who spend little time outdoors.

This article explains how the skin produces vitamin D, what limits production, which foods contain the most and how to balance this source with protection against skin cancer. It is not a substitute for medical assessment: if your blood test shows low vitamin D, the doctor who requested it will decide whether adjusting your habits is enough or a supplement is needed.

How the skin produces vitamin D

The skin contains a substance derived from cholesterol which, when exposed to ultraviolet B (UVB) radiation, is converted into previtamin D3 and then vitamin D3. This vitamin enters the blood and is converted in the liver into 25-hydroxyvitamin D, the form measured in blood tests. The body has a protective mechanism: with prolonged exposure, the excess is converted into inactive compounds, so sunlight alone does not cause vitamin D toxicity.

In 2016, the EFSA scientific panel recognised that when vitamin D is made in the skin, the dietary requirement is lower and may even be zero. Dietary reference values were set specifically for the opposite situation: little exposure to sunlight.

Factors affecting production in the skin

Not all sunlight produces vitamin D. UVB radiation is the most effective, and its intensity depends on the sun's height in the sky. When the sun is low, early in the morning, late in the day and in winter, far less UVB reaches the surface. In Portugal, vitamin D production is most efficient from spring to early autumn, around the middle of the day.

Personal factors also matter. Darker skin needs longer exposure to produce the same amount because melanin absorbs some UVB radiation. The skin produces less with age. The area exposed makes a substantial difference: the face and hands produce little compared with the arms and legs. Window glass blocks almost all UVB radiation, while correctly applied sunscreen reduces production.

FactorEffect on vitamin D production
SeasonMuch greater in spring and summer than in winter
Time of dayGreater around midday, when the sun is highest
LatitudeLower in more northerly countries
Skin typeDarker skin produces less with the same exposure
AgeOlder people's skin produces less
Area exposedMore skin exposed, greater production
GlassBlocks virtually all UVB radiation
SunscreenReduces production when applied in an adequate amount
Cloud and pollutionReduce the radiation reaching the skin

How much sunlight is enough?

There is no universal recommendation in minutes, precisely because production depends on so many factors. Broadly speaking, short, regular exposure of the arms and legs around the middle of the day in spring and summer allows many fair-skinned people to produce meaningful amounts of vitamin D without the skin becoming red.

The 2011 Endocrine Society guideline describes sunlight as an important source, but stresses that the need to balance this benefit against skin cancer risk makes precise recommendations difficult. People with a history of skin cancer, many moles or very fair skin should discuss the best strategy with their doctor or dermatologist. This may involve prioritising dietary sources and, if necessary, supplements.

Sunlight and skin cancer: finding the right balance

The same UVB radiation that produces vitamin D is also the main cause of sunburn and contributes to skin cancer, including melanoma. Sunburn, particularly in childhood, increases this risk. The idea of “getting lots of sun to raise vitamin D” is therefore not advisable.

Vitamin D production reaches a plateau after relatively short exposure. Beyond this point, longer exposure does not increase vitamin D but continues to increase skin damage. The most balanced approach is moderate exposure without sunburn, and sun protection during prolonged exposure.

PracticeFor vitamin DFor the skin
Short, regular exposureUsefulLow risk if there is no redness
Prolonged, unprotected exposureNo additional benefitIncreased risk of sunburn and cancer
SunburnNo additional benefitClearly increased risk
SunbedsNot recommendedIncreased risk of skin cancer

Foods containing vitamin D

Few foods are naturally rich in vitamin D. The best sources are oily fish, such as sardines, mackerel, horse mackerel, salmon, herring and tuna. Cod liver oil is very rich in vitamin D, but also contains a great deal of vitamin A, so it should not be taken in large amounts without advice, particularly during pregnancy. Egg yolk, liver and some dairy products contain smaller amounts.

Mushrooms are a plant source of vitamin D2, particularly when exposed to ultraviolet light during production or after harvesting. Some products are fortified with vitamin D, including certain plant-based drinks, breakfast cereals, margarines and yoghurts. The amount varies widely, so it is worth reading the label.

FoodContribution to vitamin D intake (indicative)
Oily fish (sardines, mackerel, salmon, herring)Richest natural source
Cod liver oilVery rich, but high in vitamin A
Egg yolkModerate contribution
UV-exposed mushroomsPlant source of vitamin D2
LiverSmall to moderate contribution
Fortified foodsVariable; check the label
Meat, unfortified cereals, fruit, vegetablesVery small contribution

The exact vitamin D content varies with the species, season and production and cooking methods. Figures in food composition tables are averages.

Is diet enough?

In 2016, EFSA set an adequate intake of 15 micrograms per day for adults, assuming little exposure to sunlight. Reaching this level through an ordinary diet alone is difficult without eating oily fish several times a week or choosing fortified foods. Many European dietary surveys show average intakes well below this level.

This does not mean diet is irrelevant. For people with little sunlight exposure, eating oily fish two or three times a week and eggs regularly can make a genuine contribution. In people with a confirmed deficiency, however, diet is rarely enough to correct the level and the doctor may consider a supplement necessary.

Vegetarians, vegans and other special circumstances

People following a strict vegetarian or vegan diet miss out on the main dietary sources of vitamin D, apart from mushrooms and fortified plant products. Sunlight exposure and, if necessary, supplements therefore play a greater role. Both vitamin D2 and non-animal vitamin D3 supplements are available.

Other groups who find it harder to obtain vitamin D from sunlight include people who are bedridden or live in institutions, those who cover almost all their skin for cultural or religious reasons, night workers and people with skin conditions requiring strict sun protection. The 2011 guideline identified these groups as being at greater risk of deficiency.

SituationStrategy to discuss with your doctor
Vegan dietFortified foods, mushrooms, possible supplement
Limited mobility or living in an institutionAssess the need for a supplement
Most of the skin coveredDiet and possible supplement
History of skin cancerStrict sun protection and possible supplement
Intestinal disorders causing malabsorptionSpecific medical plan

When sunlight and diet are not enough

If vitamin D remains low despite suitable habits, or there is a marked deficiency, the doctor may recommend a supplement. The 2024 Endocrine Society guideline advises against supplements above reference doses in healthy adults under 75 to prevent disease, but supports supplementation for some groups, including children, adults aged 75 or over and pregnant women.

Whatever the strategy, it is important not to take high-dose supplements on your own initiative. Excess vitamin D can raise blood calcium, causing nausea, vomiting, intense thirst and, in severe cases, confusion and abnormal heart rhythms. In these situations, contact your doctor or SNS 24 (808 24 24 24); call 112 if there is confusion or severe palpitations.

At Clínica Alegre in Setúbal and Seixal, you can have laboratory tests and ask our team any questions about the results.

Frequently asked questions

Does sunlight through a window produce vitamin D?

Virtually none. Glass blocks most of the UVB radiation needed for production.

Does sunscreen prevent vitamin D production?

It reduces production when applied correctly, but ordinary use does not usually cause deficiency by itself. Continue to use sun protection during prolonged exposure.

Does winter sunlight in Portugal produce vitamin D?

It produces less, particularly in the morning and late in the day. Some production may still occur around midday on clear days.

Can I get vitamin D toxicity from sunlight?

No. The skin has a mechanism that limits production. Toxicity is nearly always caused by excessive supplements.

How often should I eat oily fish?

As a general guide, two or three times a week makes a useful contribution to vitamin D and other nutrients.

Are mushrooms a good source?

They can be, particularly if exposed to UV light. The amount varies widely between products.

As a vegan, do I need a supplement?

You may, particularly if you have little exposure to sunlight. Discuss this with your doctor, who may request blood tests to guide the decision.

Did you enjoy this article?

Scientific references3
  1. EFSA Panel on Dietetic Products, Nutrition and Allergies (NDA). Dietary reference values for vitamin D. EFSA J. 2016;14(10):4547.
  2. Holick MF, Binkley NC, Bischoff-Ferrari HA, et al. Evaluation, treatment, and prevention of vitamin D deficiency: an Endocrine Society clinical practice guideline. J Clin Endocrinol Metab. 2011;96(7):1911-30.
  3. Demay MB, Pittas AG, Bikle DD, et al. Vitamin D for the Prevention of Disease: An Endocrine Society Clinical Practice Guideline. J Clin Endocrinol Metab. 2024;109(8):1907-47.
Article information
Written by
Clínica Alegre team
Clinical review
Dr Fernando Alegre, Clinical Director · OMD, registration no. 9688
Published
2 Dec 2026
Last updated
2 Dec 2026
Topic
Laboratory tests
Reading time
9 min

See also

Related treatments

Want to know what is right for you?

Contact us on WhatsApp or book an assessment, in person or online.

Book an appointment

Book your assessment.

Choose Setúbal or Seixal. We reply within opening hours.

Newsletter

Get the latest news from the Clínica Alegre.

Blog articles and clinic news, delivered to your inbox. Unsubscribe at any time.