In hilly boreal landscapes topography governs groundwater flow which strongly influences soil development, and thus vegetation composition. Soil pH is known to correlate well with plant species density and composition, but in boreal forests this relationship has been little studied. Previously, we successfully used a topography-based hydrological index, the topographical wetness index (TWI), as an approximation of the variation in groundwater flow to predict local plant species density in a boreal forest landscape. Data on species indicator values demonstrated that soil pH can be an important soil variable linking groundwater flow and plant species density. In the present paper we explore this link by relating measured soil pH to species numbers of vascular plants and TWI in 200-m2 plots within two boreal forest landscapes, differing in average soil pH. The two landscapes showed almost identical relationships between plant species number and soil pH, implying that this relationship is robust. The landscapes also had similar relationships between soil pH and TWI as well as between plant species number and TWI except at high TWI values, which indicate groundwater discharge areas. In these areas soil pH and plant species numbers were higher in the high-pH landscape at any given TWI value. We conclude that for predictive mapping of the species density of vascular plants in boreal forests, soil pH is a major factor. However, TWI as a measure of groundwater flow is a practical alternative predictor.