The accumulation of high concentrations of signalling androgens within prostate tumours that progress despite use of androgen-deprivation therapy is a clinically important mechanism of the development of castration-resistant prostate cancer. In the past 5 years, data from a number of studies have increased our understanding of the enzymes and substrates involved in intratumoural androgen biosynthesis, and have implicated three competing pathways, which are likely to account for these observations. These pathways ('canonical', 'backdoor' and '5α-dione'), which can all ultimately generate the potent signalling androgen, dihydrotestosterone, involve many of the same enzymes, but differ in terms of substrate preference, reaction sequence and the organs and tissues in which they occur. For this reason, the relative importance of each pathway to the development and progression of prostate cancer remains controversial. In this Review, we describe the current understanding of androgen synthesis and the evidence for its role in castration resistance, and examine the evidence supporting and or rebutting the relevance of each pathway to patients with prostate cancer.