The biochemical reduction and loss of nitrate or nitrite to gaseous nitrogen, either as N2 or oxides of nitrogen (N2O, NO, NO2).