Basal cell carcinoma (BCC), the most common keratinocyte cancer, presents a substantial public health challenge due to its high prevalence. Traditional diagnostic methods, which rely on visual examination and histopathological analysis, do not include metabolomic data. This exploratory study aims to molecularly characterize BCC and diagnose tumour tissue by applying matrix-assisted laser desorption ionization mass spectrometry imaging (MALDI-MSI) and machine learning (ML). BCC tumour development was induced in a mouse model and tissue sections containing BCC (n = 12) were analysed. The study design involved three phases: (i) Model training, (ii) Model validation and (iii) Metabolomic analysis. The ML algorithm was trained on MS data extracted and labelled in accordance with histopathology. An overall classification accuracy of 99.0% was reached for the labelled data. Classification of unlabelled tissue areas aligned with the evaluation of a certified Mohs surgeon for 99.9% of the total tissue area, underscoring the model's high sensitivity and specificity in identifying BCC. Tentative metabolite identifications were assigned to 189 signals of importance for the recognition of BCC, each indicating a potential tumour marker of diagnostic value. These findings demonstrate the potential for MALDI-MSI coupled with ML to characterize the metabolomic profile of BCC and to diagnose tumour tissue with high sensitivity and specificity. Further studies are needed to explore the potential of implementing integrated MS and automated analyses in the clinical setting.