A sex-determination system is a biological system that determines the development of sexual characteristics in an organism. Most organisms that create their offspring using sexual reproduction have two sexes. Occasionally, there are hermaphrodites in place of one or both sexes. There are also some species that are only one sex due to parthenogenesis, the act of a female reproducing without fertilization.
In many species, sex determination is genetic: males and females have different alleles or even different genes that specify their sexual morphology. In animals this is often accompanied by chromosomal differences, generally through combinations of XY, ZW, XO, ZO chromosomes, or haplodiploidy. The sexual differentiation is generally triggered by a main gene (a "sex locus"), with a multitude of other genes following in a domino effect.
In other cases, sex is determined by environmental variables (such as temperature) or social variables (e.g. the size of an organism relative to other members of its population).
Some species do not have a fixed sex, and instead change sex based on certain cues. The details of some sex-determination systems are not yet fully understood.