Rosemary (Rosmarinus officinalis L.) is a plant widely used in Morocco for these remedies in traditional medicine and for these essential oils. The objective of this work is to compare the yield and chemical composition of wild and cultivated rosemary essential oils from different regions of Morocco that differ in their geographical positions and climatic conditions. Essential oils of R. officinalis obtained by hydrodistillation were analyzed by gas chromatography coupled to mass spectrometry (GC-MS). The yield of wild rosemary essential oils according to the regions studied; Boulmane, Berkane, Bouiblane and Errachidia vary between 1.57% and 2.90% and for rosemary grown in the region of Fez; it is 2.42%. The GC-MS analysis identified 41 compounds whose the major were 1,8-Cineole (26.2% to 48.2%), Camphor (7.8% to 10.4%), Borneol (6.4% to 9.4%) and α-pinene (4.4% to 9.8%). The chemical composition of the essential oil of various spontaneous and cultivated rosemary samples is qualitatively similar, but there are quantitative differences between some compounds because of several intrinsic and extrinsic factors.