Food chain length (FCL) is a fundamental component of food web structure. Studies in a variety of ecosystems suggest that FCL is determined by energy supply, environmental stability, and/or ecosystem size, but the nature of the relationship between environmental stability and FCL, and the mechanism linking ecosystem size to FCL, remain unclear. Here we show that FCL increases with drainage area and decreases with hydrologic variability and intermittency across 36 North American rivers. Our analysis further suggests that hydrologic variability is the mechanism underlying the correlation between ecosystem size and FCL in rivers. Ecosystem size lengthens river food chains by integrating and attenuating discharge variation through stream networks, thereby enhancing environmental stability in larger river systems.