Understanding patterns in forest communities and its driving factors play a critical role in ecological studies. In view of this, present study attempts to understand the role of environmental and anthropogenic factors towards shaping species diversity and composition along the altitudinal gradient (700–3800 m asl) in Indian western Himalaya. A total of 51 tree species (28 families) were recorded; Pinaceae (5) and Fagaceae (5) were the species rich families. α-diversity indices i.e., Margalef's richness index (R), Shannon index (Hʹ) and Simpson index showed a humped shaped distribution, whereas Evenness index (E) showed an inverted humped shaped distribution along the altitude range. Based on non-metric dimensional scaling (NMDS), four different community types were identified. Redundancy analysis (RDA) revealed a strong relationship of tree species composition with environmental (41.73% variation) and anthropogenic factors (17.35% variation). RDA further indicated that the bulk density (BD), disturbance index (DI), mean diurnal temperature range (Bio2) and solar radiation (SR) are significantly associated with sub-tropical (below 1200 m) and lower temperate forest (1200–1700 m) types. Likewise, soil organic carbon (SOC), precipitation of the driest quarter (Bio17) and pH were significantly associated with upper temperate (1700–2900 m), and subalpine forest composition (>2900 m). Both NMDS classification and RDA ordination clearly demonstrate spatial variability in composition of tree community and environmental properties.