We review here recent advances in our understanding of the genetic, molecular and genomic basis of sex determination and sexual reproduction in the fungal kingdom as a window on the evolution of sex in eukaryotes more generally. In particular, we focus on the evolution of the mating-type locus and transitions in modes of sexual reproduction using examples from throughout the kingdom. These examples illustrate general principles of the origins of mating-type loci/sex chromosomes and the balance between inbreeding and outcrossing afforded by different modes of sexual reproduction involving tetrapolar, bipolar and unipolar sexual cycles.