In the nucleus of each cell, the DNA molecule is packaged into thread-like structures called chromosomes. The X or Y chromosomes determine whether an unborn fetus is male of female. You can find more information here: http://learn.genetics.utah.edu/content/begin/traits/tour_chromosome.html