The species of Artemisia are well known in the Mediterranean region, especially in Morocco, for their traditional uses and health benefit. In this study, we were interested in two species of Artemisia, namely A. herba alba Asso and A. mesatlantica Maire. These species were collected from different soils of the Central Middle Atlas (loamy, stony, limestone and rocky soil) with different atmospheres. Extraction of essential oils from the leaves and flowering tops was carried out by hydrodistillation in Clevenger apparatus. Chemical composition analysis was further carried out using gas chromatography coupled with mass spectrometry (GC-MS). Principal component analysis (PCA) was performed to determine the similarities and dissimilarities in the chemical compositions of these six essential oils. The results obtained showed that the essential oil contents extracted from the flowering tops vary from one species to another according to the place of harvest, altitude, soil type and climate. The essential oil yield is between 0.84% and 2.19% (mL/100 g). Chemical analysis revealed that the chemotype of A. herba alba in limestone soil with a subhumid to humid atmosphere is trans-thujone (33.78%), while camphor (46.19%) is for limestone soil with a semi-arid atmosphere, vetivenic acid (14.91%) and davana ether (14.64%) are for limestone soil with a semi-arid and arid atmosphere and camphor (18.39%) is for loamy and stony soil with a semi-arid atmosphere. As for A. mesatlantica from a rocky soil on limestone with a subhumid to humid atmosphere, the main component is camphor (44.86%), and that of limestone soil with a subhumid to the humid atmosphere trans-thujone (41.08%). In addition, HCA affirmed the PCA and allowed us to distinguish between four groups. Our findings observed differences in the chemical compositions of the isolated essential oils most likely related to many factors such as the climates in the regions of the samples collected, altitudes and soil types