Biological and environmental contrasts between aquatic and terrestrial systems have hindered analyses of community and ecosystem structure across Earth's diverse habitats. Ecological stoichiometry provides an integrative approach for such analyses, as all organisms are composed of the same major elements (C, N, P) whose balance affects production, nutrient cycling, and food-web dynamics. Here we show both similarities and differences in the C:N:P ratios of primary producers (autotrophs) and invertebrate primary consumers (herbivores) across habitats. Terrestrial food webs are built on an extremely nutrient-poor autotroph base with C:P and C:N ratios higher than in lake particulate matter, although the N:P ratios are nearly identical. Terrestrial herbivores (insects) and their freshwater counterparts (zooplankton) are nutrient-rich and indistinguishable in C:N:P stoichiometry. In both lakes and terrestrial systems, herbivores should have low growth efficiencies (10-30%) when consuming autotrophs with typical carbon-to-nutrient ratios. These stoichiometric constraints on herbivore growth appear to be qualitatively similar and widespread in both environments.