Hematopoietic cell transplantation from HLA-haploidentical related donors is increasingly used to treat hematologic cancers; however, characteristics of the optimal haploidentical donor have not been established. We studied the role of donor HLA mismatching in graft-versus-host disease (GVHD), disease recurrence, and survival after haploidentical donor transplantation with posttransplantation cyclophosphamide (PTCy) for 1434 acute leukemia or myelodysplastic syndrome patients reported to the Center for International Blood and Marrow Transplant Research. The impact of mismatching in the graft-versus-host vector for HLA-A, -B, -C, -DRB1, and -DQB1 alleles, the HLA-B leader, and HLA-DPB1 T-cell epitope (TCE) were studied using multivariable regression methods. Outcome was associated with HLA (mis)matches at individual loci rather than the total number of HLA mismatches. HLA-DRB1 mismatches were associated with lower risk of disease recurrence. HLA-DRB1 mismatching with HLA-DQB1 matching correlated with improved disease-free survival. HLA-B leader matching and HLA-DPB1 TCE-nonpermissive mismatching were each associated with improved overall survival. HLA-C matching lowered chronic GVHD risk, and the level of HLA-C expression correlated with transplant-related mortality. Matching status at the HLA-B leader and HLA-DRB1, -DQB1, and -DPB1 predicted disease-free survival, as did patient and donor cytomegalovirus serostatus, patient age, and comorbidity index. A web-based tool was developed to facilitate selection of the best haploidentical-related donor by calculating disease-free survival based on these characteristics. In conclusion, HLA factors influence the success of haploidentical transplantation with PTCy. HLA-DRB1 and -DPB1 mismatching and HLA-C, -B leader, and -DQB1 matching are favorable. Consideration of HLA factors may help to optimize the selection of haploidentical related donors.