In a tropical stream (at the Soberanía National Park, Panama), different environmental factors were quantified in riffle habitats (water characteristics: velocity, depth, turbulence, and direction; stone characteristics: surface area, sphericity, and degree of burial; and others: substrate type, and canopy cover). Characteristics of macroinvertebrate assemblages (mean density of individuals, mean taxon richness, and cumulative taxon richness in three stones at each riffle) were related to both mean values and variability of these environmental factors at riffle scale. Macroinvertebrate density was higher in shallow, fast flowing, stony riffles, with low variabihty in dominant substrate type. Taxon richness was also higher in shallow rilfles with loose, not buried stones, and water direction more or less parallel to the bank. Environmental variability resulted as important as mean values of environmental factors to explain variation in macroinvertebrate assemblages. This is the first study, to our knowledge, that quantifies substratum variability and demonstrates its influence on macroinvertebrate assemblages in a tropical stream.