Data were collected in the San Joaquin and Sacramento river drainages to evaluate associations between macroinvertebrate assemblages and environmental variables as part of the National Water-Quality Assessment Program of the U.S. Geological Survey. Samples were collected at 53 sites from 1993 to 1995 in the San Joaquin River drainage and in 1996 and 1997 in the Sacramento River drainage. Macroinvertebrates were collected from riffles or from large woody debris (snags) when riffles were absent. Macroinvertebrate taxa were aggregated to the family (or higher) level of taxonomic organization, resulting in 81 taxa for analyses. Only the 50 most common taxa were used for two-way indicator species analysis (TWINSPAN) and canonical correspondence analysis. TWINSPAN analysis defined four groups of riffle samples and four groups of snag samples based on macroinvertebrate assemblages. Analysis of variance identified differences in environmental and biotic characteristics of the groups. These results combined with the results of canonical correspondence analysis indicated that patterns in riffle sample assemblage structure were highly correlated with a gradient in physical and chemical conditions associated with elevation. The results also suggested that flow regulation associated with large storage reservoirs has negative effects on the total number of taxa and density of macroinvertebrates below foothill dams. Analysis of the snag samples showed that, although elevation remained a significant variable, mean dominant substrate size, gradient, specific conductance, water temperature, percentage of the basin in agricultural land use, and percentage of the basin in combined agricultural and urban land uses were more important factors in explaining assemblage structure. Macroinvertebrate assemblages on snags may be useful in family level bioassessments of environmental conditions in valley floor habitats. In the Sierra Nevada and its foothills, the strong influence of elevation made it difficult to attribute differences in macroinvertebrate assemblage structure among sites to specific environmental conditions. Additional work is needed in the foothills and Sierra Nevada to better define macroinvertebrate assemblages and their relations to environmental variables.