The study focused on the morphological diversity of pods and seeds from six ecotypes of carob tree (Ceratonia siliqua L.), originating from different regions of Morocco including Khemissat, Safi, Aït Attab, Berkane, Ouezzane, and Agadir. Thirty pods per ecotype were collected from 10 different trees. Measurements were taken to analyze the morphology of seeds and pods. The results revealed significant differences among ecotypes for most morphological characteristics such as pod length, pod width, pod thickness, total pod weight, pulp weight, total number of seeds in the pod, seed weight within the pod, seed length, seed width, seed thickness, single seed weight, and weight of 100 seeds. Correlation analysis revealed associations among different morphological measures, highlighting the influence of pod morphology on seed yield. Principal component analysis (PCA) and hierarchical clustering analysis confirmed the presence of two distinct groups of ecotypes: the first group comprising the ecotypes Agadir, Aït Attab, Safi, and Khemissat, while the second group included the ecotypes Berkane and Ouezzane. These results have significant implications for variety selection and improvement of carob tree cultivation, with significant potential to enhance food security in Mediterranean regions. By better understanding the impact of ecotype on morphological characteristics, selection efforts can be directed towards developing varieties better adapted to changing environmental conditions, thereby contributing to strengthening the resilience of agricultural systems face of climate change.