Nitrate and nitrite are compounds composed of nitrogen and oxygen. Both molecules contain a single nitrogen atom; nitrite contains two oxygen atoms, while nitrate contains three.
Nitrate represents a more oxidised state of nitrogen. Under aerobic conditions, autotrophic bacteria convert ammonia to nitrite and subsequently to nitrate, while lightning can convert large amounts of atmospheric nitrogen (N2) directly into nitrate. Bacterial reduction of nitrate can also produce nitrite under anaerobic conditions.
Nitrite occurs as an intermediate stage in the biodegradation of ammonia and ammonium. Under aerobic conditions, autotrophic bacteria convert ammonia to nitrite as the first step in the nitrification process, before it is further oxidised to nitrate.