Ergosterol is a biological precursor (a provitamin) to vitamin D2. It is turned into viosterol by ultraviolet light, and is then converted into ergocalciferol, a form of vitamin D also known as D2 or D2.[1] For this reason, when yeast (such as brewer’s yeast) and fungi (such as mushrooms), are exposed to ultraviolet light, significant amounts of vitamin D2 are produced.

Because ergosterol is present in cell membranes of fungi yet absent in those of animals, it is a useful target for antifungal drugs. Ergosterol is also present in the cell membranes of some protists, such as trypanosomes.

The three major human diseases caused by trypanosomatids are; African trypanosomiasis (Sleeping Sickness, caused by Trypanosoma brucei), South American trypanosomiasis (Chagas Disease, caused by Trypanosoma cruzi), and leishmaniasis (a set of trypanosomal diseases caused by various species of Leishmania). This is the basis for the use of some antifungals against West African sleeping sickness.