Search "how much sun for vitamin D" and you'll get a confident number — "10–30 minutes a few times a week." It's not wrong so much as incomplete: the same 20 minutes can produce a lot of vitamin D or almost none, depending on five things.
Vitamin D is made when UVB hits your skin. UVB rises and falls with the sun's height in the sky, so it peaks around solar noon and collapses in the early morning, late afternoon, and winter. Below a UV Index of about 3, there's little useful UVB for vitamin D even if it feels brightLinus Pauling Institute. A useful rule of thumb: if your shadow is longer than you are tall, the sun is too low to make much vitamin DPubMed. More on this in what UV index you need.
Melanin is natural sun protection, which also means darker skin synthesizes vitamin D more slowly. A person with very fair skin (Fitzpatrick I–II) might make a target dose in a few minutes of strong sun; someone with deep skin (Fitzpatrick V–VI) may need several times longer for the same amount — dark skin may need up to 10× longer for equal productionLinus Pauling Institute. This is established, not controversial — and it's why one-size-fits-all advice fails.
Vitamin D is made across the surface area exposed. Face and hands is maybe ~10% of your body; shorts and a t-shirt is closer to ~30–40%. More bare skin means more synthesis in less time — and it's the single biggest lever most people ignore.
Here's the counter-intuitive part: UVB drops off faster than overall UV as the sun gets lower. So winter sun, and early/late-day sun, is disproportionately weak for vitamin D even when your skin still feels warm. Above roughly 35–40° latitude, for several winter months, the midday sun simply can't make meaningful vitamin D at all (more in our winter guide).
Your skin doesn't keep making vitamin D indefinitely. Synthesis self-limits through photochemical equilibrium as you approach the point where skin starts to redden, then effectively stopsPubMed — while extra time only adds burn risk. This is the key insight: for vitamin D, there's a sweet spot, and it sits comfortably below a sunburn. Staying out longer "to get more" past that point gives you sun damage, not more vitamin D.
There is no single correct number — but published models give a sense of the spread. For 1,000 IU at Hannover (52°N), clear sky, the modelled skin time runs from 1.1 minutes on 21 June to 39 minutes on 21 December, and is effectively impossible under December cloudNature. Another analysis found tropical latitudes needing just 3–6 minutes, while Boston in winter produced effectively nothing at any practical exposurePubMed.
For scale at the other end, a full-body exposure to one minimal erythemal dose is widely quoted as yielding the equivalent of roughly 10,000–25,000 IULinus Pauling Institute — which is why the productive window is measured in minutes, not hours.
These are modelled figures for particular skin types and exposed areas, not personal prescriptions. They are the reason a fixed "20 minutes" answer fails: the same behaviour can be worth thirty-five times more, or nothing at all.
For fair-to-medium skin, a good chunk of skin bare, under strong summer sun (UV Index 6–8), a meaningful dose can happen in roughly 10–20 minutes — often before you'd burn. For darker skin, low sun, or more clothing, it's longer, and in winter at high latitude it may be impossible from sun alone — at which point a supplement is the honest workaround. That range is exactly why a fixed number misleads.