Sunlight turns a cholesterol precursor into vitamin D
Vitamin D synthesis begins in the skin, where ultraviolet B (UVB) radiation strikes 7-dehydrocholesterol and converts it to previtamin D3, which then rearranges into vitamin D3. That D3 is biologically inactive until the liver and then the kidney add hydroxyl groups, producing first the storage form measured in blood tests and finally the active hormone. So skin makes the raw material; the organs finish it.
Diet and supplements provide an alternative source, which matters because skin production alone is often unreliable.
What gates how much the skin can make
Several factors throttle UVB-driven synthesis. At higher latitudes, winter sun is too low in the sky for adequate UVB, so little or no vitamin D is made for months. Melanin absorbs UVB, so darker skin produces less for the same exposure. Sunscreen, clothing, glass, age, and time of day all reduce it further. These overlapping limits are why insufficiency is common even in sunny regions.
This is general educational information, not medical advice. Because sun exposure also carries skin cancer risk and supplement needs vary, vitamin D dosing should be guided by testing and a qualified clinician.