The diagnosis and management of children born with ambiguous genitalia is challenging for clinicians. Such differences of sex development (DSDs) are congenital conditions in which chromosomal, gonadal, or anatomical sex is atypical. The aetiology of DSDs is very heterogenous and a precise diagnosis is essential for management of genetic, endocrine, surgical, reproductive, and psychosocial issues. In this Review, we outline a step-by-step approach, compiled in a diagnostic algorithm, for the clinical assessment and molecular diagnosis of a patient with ambiguity of the external genitalia on initial presentation. We appraise established and emerging technologies and their effect on diagnosis, and discuss current controversies.