Vitamin D2 and vitamin D3 are the forms of vitamin D most important to human health, according to the Mayo Clinic. Vitamin D2 is manufactured by plants, while vitamin D3 is manufactured in the skin when it's exposed to the sun.
Vitamin D2 is also known as ergocalciferol, while vitamin D3 is known as cholecalciferol, according to the National Institutes of Health. Doctors previously believed they were identical to each other, but this belief is based on studies conducted decades ago. Now, medical professionals believe that vitamin D3 is the superior type of vitamin D, especially for humans and other primates.
Vitamins D2 and D3 are both types of secosteroids and differ because D3 has a double bond between two carbons and a methyl group bonded to another carbon within the D3 molecule, according to Wikipedia. Vitamin D3 is created from a type of cholesterol called 7-dehydrocholesterol when it is impacted by ultraviolet B light, either from the sun, from tanning beds or other sources.
By contrast, vitamin D2 is found in portobello and shiitake mushrooms and is especially abundant in raw or grilled portobello mushrooms that have been irradiated. Vitamin D2 is also found in Cladina arbuscula lichens as well as alfalfa shoots, claims Wikipedia.