Alteration of the global nitrogen cycle by man has increased nitrogen loading in waterways considerably, often with harmful consequences for aquatic ecosystems. Dynamic redox conditions within riverbeds support a variety of nitrogen transformations, some of which can attenuate this burden. In reality, however, assessing the importance of processes besides perhaps denitrification is difficult, due to a sparseness of data, especially in situ, where sediment structure and hydrologic pathways are intact. Here we show in situ within a permeable riverbed, through injections of 15N-labeled substrates, that nitrate can be either consumed through denitrification or produced through nitrification, at a previously unresolved fine (centimeter) scale. Nitrification and denitrification occupy different niches in the riverbed, with denitrification occurring across a broad chemical gradient while nitrification is restricted to more oxic sediments. The narrow niche width for nitrification is in effect a break point, with the switch from activity “on” to activity “off” regulated by interactions between subsurface chemistry and hydrology. Although maxima for denitrification and nitrification occur at opposing ends of a chemical gradient, high potentials for both nitrate production and consumption can overlap when groundwater upwelling is strong.