Understanding within-species variability in terpenoid content and composition is highly relevant for predicting species adaptive potential to biotic stresses, but there is still limited information on terpene variations even for widespread species. We studied the foliage content and composition of terpenoids, foliage structure, and carbon (C) and nitrogen (N) contents in Pinus sylvestris L. in four Estonian sites ranging from dry forest to raised bog. In the bogs, samples were taken along the environmental gradient from drier margins towards wetter central parts. A chiral column was used to gain insight into the variation in terpene composition. We hypothesized that terpene contents increase and the composition becomes more diverse in more strongly N-limited sites (greater C/N ratio) and that terpene signatures cluster together in sub-sites with similar conditions (drier/wetter). Altogether 37 terpenes were quantified across the sites. Extremely large variability of terpene contents, 48-62% for monoterpenes and 61-89% for sesquiterpenes, was observed. According to the amounts of α-pinenes and (+)-3-carene, we distinguished two different 'pine chemotypes'. Contrary to the hypothesis, terpene contents and variability were the greatest in the dry site with the lowest C/N ratio. However, individual terpenoids correlated differently with C or N in different sites, indicating site effects on terpene composition. Moreover, correlations between the terpenoids and C or N depended on the pine chemotype. The sub-sites with different water regime were more strongly clustered together within the site than across the sites. The study demonstrates extensive variations in terpene contents and composition among the populations and over short spatial distances within the populations, suggesting a large among- and within-population adaptive capacity of P. sylvestris.