There are two main types of nitrogen-fixing bacteria:
* Free-living nitrogen-fixing bacteria: These bacteria live in the soil and water and fix nitrogen independently.
* Symbiotic nitrogen-fixing bacteria: These bacteria live in a mutually beneficial relationship with plants, typically forming nodules on the roots of legumes (e.g., beans, peas, lentils).
While some other organisms like cyanobacteria can also fix nitrogen, the majority of nitrogen fixation in the biosphere is carried out by these two groups of bacteria.