Homologous recombination deficiency (HRD) results in impaired double strand break repair and is a frequent driver of tumorigenesis. Here, we used a machine learning approach to develop a sensitive pan-cancer Classifier of HOmologous Recombination Deficiency (CHORD). CHORD employs genomewide genomic footprints of somatic mutations characteristic for HRD and that discriminates BRCA1and BRCA2-subtypes. Analysis of a metastatic pan-cancer cohort of 3,504 patients revealed HRD to occur at a frequency of 6% with highest rates for ovarian cancer (30%), comparable frequencies for breast, pancreatic and prostate cancer (12-13%) and incidental cases in other cancer types. Ovarian and breast cancer were equally driven by BRCA1-and BRCA2-type HRD, whereas for prostate, pancreatic and urinary tract cancers BRCA2-type HRD was predominant. Biallelic inactivation of BRCA1, BRCA2, RAD51C and PALB2 were found as the most common genetic causes of HRD (60% of all CHORD-HRD cases), with RAD51C and PALB2 inactivation resulting in BRCA2-type HRD. Loss of heterozygosity (LOH) was found to be the main inactivating mechanism in ovarian, breast and pancreatic cancer, whereas for prostate cancer deep deletions (primarily of BRCA2) are also a major cause. From the remaining 40% of CHORD-HRD patients, 35% had a monoallelic mutation in one of the HRD associated genes, suggesting that the second allele could be inactivated by epigenetic or regulatory mechanisms. For only 5% of CHORD-HRD patients, no mutations were identified that could explain the HRD phenotype. Taken together, our results demonstrate that broad genomics-based HRD testing is valuable for cancer diagnostics and could be used for patient stratification towards treatment with e.g. poly ADP-ribose polymerase inhibitors (PARPi).