Bedforms are a focal point of carbon and nitrogen cycling in streams and coastal marine ecosystems. In this paper, we develop and test a mechanistic model, the "pumping and streamline segregation" or PASS model, for nitrate removal in bedforms. The PASS model dramatically reduces computational overhead associated with modeling nitrogen transformations in bedforms and reproduces (within a factor of 2 or better) previously published measurements and models of biogeochemical reaction rates, benthic fluxes, and in-sediment nutrient and oxygen concentrations. Application of the PASS model to a diverse set of marine and freshwater environments indicates that (1) physical controls on nitrate removal in a bedform include the pore water flushing rate, residence time distribution, and relative rates of respiration and transport (as represented by the Damkohler number); (2) the biogeochemical pathway for nitrate removal is an environment-specific combination of direct denitrification of stream nitrate and coupled nitrification-denitrification of stream and/or sediment ammonium; and (3) permeable sediments are almost always a net source of dissolved inorganic nitrogen. The PASS model also provides a mechanistic explanation for previously published empirical correlations showing denitrification velocity (N2 flux divided by nitrate concentration) declines as a power law of nitrate concentration in a stream (Mulholland et al. Nature, 2008, 452, 202-205).