Vitamin D from a Chemist’s point of view!
This vitamin is basically an assembly of seco-steroids accountable for escalating intestinal absorption of magnesium, calcium and phosphate. Members of this group are fat soluble. Prime members are vitamin D3 (cholecalciferol) and vitamin D2 (ergocalciferol). One important information is that Vitamin D obtained from our daily diet or from other sources is mostly inactive until it gets activated in the liver and kidney due to enzymatic conversion like hydroxylation.
Vitamin D3 (Cholecalciferol) is then converted in the liver to calcifediol (25-hydroxycholecalciferol) whereas Vitamin D2 (ergocalciferol) is converted to 25-hydroxyergocalciferol. These two vitamin D metabolites (called 25-hydroxyvitamin D or 25(OH)D) are usually measured in serum to determine a person’s vitamin D status. Calcifediol thus obtained gets further hydroxylated by the kidneys to form calcitriol (1,25-dihydroxycholecalciferol), biologically active form of vitamin D. Calcitriol behaving as a hormone circulates in the blood and plays a significant role maintaining the concentration of calcium, magnesium and phosphate.

Vitamin D is basically a seco-steroid. Seco-steroid represents those molecules having one of the rings broken. In the above figure, A, B, C, and D ring structure is derived from the cyclopentanoperhydrophenanthrene ring structure for steroids. It has been shown in the figure that ring B is broken in Vitamin D. Hence the word seco- is used in its nomenclature.
Action of sunlight or ultraviolet light can produce Vitamin D3 photochemically from the precursor sterol 7-dehydrocholesterol which is present in the epidermis or skin of man and higher animals. Conjugated double bond system in the B ring allows the molecule for absorption of light quanta at certain wavelengths in the UV range; which can be easily provided in most geographical locations by natural sunlight (or UV-B) and consequently a complex series of transformations will take place to generate Vitamin D3. This is the fundamental pathway that helps Vitamin D3 to be produced endogenously as long as the animal (or human) has access on a regular basis to sunlight.