Ergocalciferol, also known as vitamin D2 and nonspecifically calciferol, is a type of vitamin D found in food and used as a dietary supplement. As a supplement it is used to prevent and treat vitamin D deficiency. This includes vitamin D deficiency due to poor absorption by the intestines or liver disease. It may also be used for low blood calcium due to hypoparathyroidism. It is used by mouth or injection into a muscle.Excessive doses can result in increased urine production, high blood pressure, kidney stones, kidney failure, weakness, and constipation. If high doses are taken for a long period of time, tissue calcification may occur. Normal doses are safe in pregnancy. It works by increasing the amount of calcium absorbed by the intestines and kidneys. Food in which it is found include some mushrooms.Ergocalciferol was first described in 1936. Ergocalciferol is available as a generic medication and over the counter. In 2020, it was the 46th most commonly prescribed medication in the United States, with more than 14 million prescriptions. Certain foods such as breakfast cereal and margarine have ergocalciferol added to them in some countries. It is on the World Health Organizations List of Essential Medicines. Use
Ergocalciferol may be used as a vitamin D supplement, whereas cholecalciferol (vitamin D3) is produced naturally by the skin when exposed to ultraviolet light.
Sources
Fungus, from USDA nutrient database (per 100g), D2 + D3:
Mushrooms, Agaricus bisporus:
raw portobello: 0.3 μg (10 IU); exposed to ultraviolet light: 11.2 µg (446 IU)
raw crimini: 0.1 μg (3 IU); exposed to ultraviolet light: 31.9 µg (1276 IU)
Mushrooms, shiitake:
raw: Vitamin D (D2 + D3): 0.4 μg (18 IU)
dried: Vitamin D (D2 + D3): 3.9 μg (154 IU)Lichen

Cladina arbuscula specimens grown under different natural conditions contain provitamin D2 and vitamin D2, ranges 89-146 and 0.22-0.55 μg/g dry matter respectively. They also contain vitamin D3 (range 0.67 to 2.04 μg/g) although provitamin D3 could not be detected. Vitamin D levels correlate positively with UV irradiation.Plantae

Alfalfa (Medicago sativa subsp. sativa), shoot: 4.8 μg (192 IU) vitamin D2, 0.1 μg (4 IU) vitamin D3

Biosynthesis
The vitamin D2 content in mushrooms and C. arbuscula increase with exposure to ultraviolet light. Ergosterol (provitamin D2) found in these fungi is converted to previtamin D2 on UV exposure, which then turns into vitamin D2. As cultured mushrooms are generally grown in darkness, less vitamin D2 is found compared to those grown in the wild or dried in the sun.When fresh mushrooms or dried powders are purposely exposed to ultraviolet light, vitamin D2 levels can be concentrated to much higher levels. The irradiation procedure does not cause significant discoloration, or whitening, of mushrooms. Claims have been made that a normal serving (approx.