Disorders of cortisol biosynthesis can lead to congenital adrenal hyperplasia, the most common form of which is 21-hydroxylase deficiency (21-OHD). This Review details the clinical features and prenatal diagnosis of 21-OHD, and describes how prenatal dexamethasone treatment can prevent genital ambiguity in affected females.