Testosterone supplementation is commonly used for its effects on sexual function, bone health and body composition, yet its effects on disease outcomes are unknown. To better understand this, we identified genetic determinants of testosterone levels and related sex hormone traits in 425,097 UK Biobank study participants. Using 2,571 genome-wide significant associations, we demonstrate the genetic determinants of testosterone levels are substantially different between sexes, and that genetically higher testosterone is harmful for metabolic diseases in women but beneficial in men. For example, a genetically determined 1-standard deviation higher testosterone increases the risks of Type 2 diabetes (T2D) (OR=1.37 [1.22–1.53]) and polycystic ovary syndrome (OR=1.51 [1.33–1.72]) in women, but reduces T2D risk in men (OR=0.86 [0.76–0.98]). We also show adverse effects of higher testosterone on breast and endometrial cancers in women, and prostate cancer in men. Our findings provide insights into the disease impacts of testosterone and highlight the importance of sex-specific genetic analyses.