Production and accumulation of secondary metabolites in plants are influenced by genetic and environmental conditions such as height. Stachys byzantina is one of the most valuable medicinal species belonging to the Lamiaceae family. Traditionally, the plants in this family are widely used in the treatment of diseases. In this study, to investigate the effect of altitude on the amount of phenolic compounds of this leaf and flower plant of S. byzantina were collected from three habitats in Mazandaran, the first habitat (Sari with a height of 376 m), the second habitat (Kiyasar with a height of 1612 m) and the third habitat (Filband with a height of 2357 m), in June 2017. The methanol extract was prepared to measure anthocyanin, total phenol, flavonoid and flavonol and the content of these compounds was evaluated using spectrophotometric methods A one-way analysis of variance (ANOVA) was performed and the treatment means were compared using Tukey’s HSD all-pairwise comparisons at the p< 0.01 level as a post-hoc test. The results indicated that the leaf had higher phenolic compounds than the flower and the total phenol content and anthocyanin increased with altitude decrease. Also, the highest amount of flavonoids and flavonol has been observed in Kiyasar habitat. In general, it seems that altitude does not have the same effects on the production of phenolic compounds in the Stachys byzantina plant and possibly other climatic conditions affect the changes in phenolic compounds.