Abstract. We test to what extent mean environmental conditions and environmental heterogeneity are related to species richness in a regular geographical grid system (UTM) of 10 km × 10 km in the NE Iberian Peninsula (i.e. Catalonia, ca. 31 900 km2). Species richness of each UTM quadrat was estimated by compiling a large database (more than a million records) from bibliographic references and atlases. Mean environmental conditions of each quadrat were derived from climatic maps. Environmental heterogeneity was estimated from the diversity of geological substrates and climatic classes in each quadrat. The increase in effective (real) area due to topographic complexity was also considered (derived from the digital elevation model). The statistical analysis was performed by a weighted analysis of deviance assuming a negative binomial error distribution. The results suggest that species richness in the study area is a function of both within-quadrat heterogeneity (specifically, effective area, heterogeneity of geological substrates, heterogeneity of January temperature) and mean environmental conditions (mean annual temperature, Thornthwaite moisture index and aspect). All these parameters showed a positive relationship with species richness. Quadrat heterogeneity accounted for ca. 2/3 of the explained deviance, suggesting the importance of environmental heterogeneity when using a geographical grid system. The study fits well with earlier results on the importance of climatic parameters on plant species richness and provides one of the few rigorous, quantitative, coarse-scale studies testing environmental heterogeneity in plant species richness.