Left ventricular (LV) scar is a risk factor for sudden cardiac death and heart failure in hypertrophic cardiomyopathy (HCM). LV scar is frequent in HCM and evolves over time. Hence there is a need for LV scar detection and longitudinal monitoring. The current gold standard for LV scar detection is late gadolinium enhancement (LGE) on magnetic resonance imaging (MRI), which is limited by high cost and susceptibility to artifacts from implanted defibrillators. We introduce XplainScar, the first explainable machine learning method for LV scar detection and localization in HCM, using 12-lead electrocardiogram (ECG) data, which is not influenced by implanted devices. We use 500 patients from the JH-HCM Registry for model development, and 248 patients from the UCSF-HCM-Registry for validation. XplainScar combines unsupervised and self-supervised ECG representation learning, resulting in high precision (90%), sensitivity (95%), specificity (80%) and F1-score (90%) for scar detection in the basal, mid, and apical LV myocardium, with a processing time of <1 minute per 10 patients. Basal LV scar prediction by XplainScar is dominated by QRS features, and mid/apical LV scar by T wave features. XplainScar generalizes well to the held-out test UCSF data, with 88% precision, 90% sensitivity, 78% specificity, and F1-score of 89%. In summary, XplainScar demonstrates good performance for LV scar detection, and provides ECG signatures of basal, mid, and apical LV scar in HCM.