Ergocalciferol is vitamin D2. Vitamin D is important for the absorption of calcium from the stomach and for the functioning of calcium in the body. Ergocalciferol is used to treat hypoparathyroidism (decreased functioning of the parathyroid glands). Ergocalciferol is also used to treat rickets (softening of the bones caused by vitamin D deficiency) or low levels of phosphate in the blood (hypophosphatemia). Ergocalciferol may also be used for purposes not listed in this medication guide.