Although tramway tracks are found in most cities, their flora is not thoroughly researched. Many more studies relate to railway areas as specific anthropogenic habitats for the development of plants. Both railway and tram tracks represent specific ecological migration corridors for plants. The objective of this study was to determine the relationship between the floristic composition and selected soil parameters of tram tracks. In 2014-2015, floristic studies were carried out along tram tracks in the Upper Silesian conurbation (southern Poland). Depending on the dominant species, five groups of sites with varying floristic composition were distinguished. Five plots with an area of 1 m2 were randomly selected in each of the sites. The species composition was determined at each plot together with the cover-abundance of all species occurring at a given plot according to Westhoff’s and van Maarel’s scale. Soil samples were collected from each plot and analysed for pH, the content of biogenic elements and heavy metals. A total of 329 species of vascular plants were identified on the tram tracks of the surveyed area, and 40 species on the plots. The dominant species included: Amaranthus retroflexus, Achillea millefolium, Plantago lanceolata, Hieracium pilosella, Silene vulgaris, Taraxacum sp. and Trifolium repens. Grouping of plots in respect of soil factors largely reflects their species composition. It has been found that the content of nitrate nitrogen, lead and phosphorus has the strongest impact on the floristic diversity of the railway tracks. Based on these parameters, three groups of species were distinguished: nitrophytes, metallophytes and common, i.e. not closely associated with the studied soil properties. Three habitat types of varying plant species composition were distinguished based on the content of nitrate nitrogen and lead: 1) nitrophilous dominated by Amaranthus retroflexus, 2) with increased content of heavy metals, dominated by Silene vulgaris and 3) mesotrophic dominated by meadow species (Achillea millefolium, Plantago lanceolata, Hieracium pilosella, Taraxacum sp., Trifolium repens).