A method for estimating denitrification and nitrogen fixation simultaneously in coastal sediments was developed. An isotope-pairing technique was applied to dissolved gas measurements with a membrane inlet mass spectrometer (MIMS). The relative fluxes of three N(2) gas species ((28)N(2), (29)N(2), and (30)N(2)) were monitored during incubation experiments after the addition of (15)NO(3)(-). Formulas were developed to estimate the production (denitrification) and consumption (N(2) fixation) of N(2) gas from the fluxes of the different isotopic forms of N(2). Proportions of the three isotopic forms produced from (15)NO(3)(-) and (14)NO(3)(-) agreed with expectations in a sediment slurry incubation experiment designed to optimize conditions for denitrification. Nitrogen fixation rates from an algal mat measured with intact sediment cores ranged from 32 to 390 microg-atoms of N m(-2) h(-1). They were enhanced by light and organic matter enrichment. In this environment of high nitrogen fixation, low N(2) production rates due to denitrification could be separated from high N(2) consumption rates due to nitrogen fixation. Denitrification and nitrogen fixation rates were estimated in April 2000 on sediments from a Texas sea grass bed (Laguna Madre). Denitrification rates (average, 20 microg-atoms of N m(-2) h(-1)) were lower than nitrogen fixation rates (average, 60 microg-atoms of N m(-2) h(-1)). The developed method benefits from simple and accurate dissolved-gas measurement by the MIMS system. By adding the N(2) isotope capability, it was possible to do isotope-pairing experiments with the MIMS system.