Background: The male genital anomalies hypospadias and undescended testes have been linked to adult male reproductive disorders, testicular cancer, and decreased fertility. Few population-based studies have evaluated their effects on adult fertility outcomes and, in the case of undescended testes, the importance of early corrective surgery (orchidopexy). Methods: We did a population-based cohort study of all liveborn boys in Western Australia in 1970–99, and followed them up until 2016 via data linkage to registries for hospital admissions, congenital anomalies, cancer, and assisted reproductive technologies (ART). Study factors were hypospadias or undescended testes, and study outcomes were testicular cancer, paternity, and use of ART for male infertility. Cox regression was used to calculate hazard ratios (HRs) for the associations between genital anomalies and testicular cancer or paternity, and log-binomial regression was used to calculate relative risks (RRs) for the associations between genital anomalies and use of ART. Findings: The cohort comprised 350 835 boys, of whom 2484 (0·7%) had been diagnosed with hypospadias and 7499 (2·1%) with undescended testes. There were 505 (0·1%) cases of testicular cancer, 109 471 (31·2%) men had fathered children, and 2682 (0·8%) had undergone fertility treatment with ART. Undescended testes was associated with a more than two times increase in risk of testicular cancer (HR 2·43, 95% CI 1·65–3·58) and hypospadias with an almost 40% increase (1·37, 0·51–3·67), although this increase was not significant. Both hypospadias and undescended testes were associated with a 21% reduction in paternity (adjusted HR 0·79 [95% CI 0·71–0·89] for hypospadias and 0·79 [0·74–0·85] for undescended testes). Undescended testes was associated with a two times increase in use of ART (adjusted RR 2·26, 95% CI 1·58–3·25). For every 6 months' delay in orchidopexy, there was a 6% increase in risk of testicular cancer (HR 1·06, 95% CI 1·03–1·08), a 5% increase in risk of future use of ART (1·05, 1·03–1·08), and a 1% reduction in paternity (RR 0·99, 95% CI 0·98–0·99). Interpretation: Undescended testes is associated with an increased risk of testicular cancer and male infertility, and decreased paternity. We provide new evidence to support current guidelines for orchidopexy before age 18 months to decrease the risk of future testicular cancer and infertility. Funding: National Health and Medical Research Council and Sydney Medical School Foundation.