Background: Biological nitrogen fixation is catalyzed by Mo-, V- and Fe-nitrogenases that are encoded by nif, vnf and anf genes, respectively. NifB is the key protein in synthesis of the cofactors of all nitrogenases. Most diazotrophic Paenibacillus strains have only one nifB gene located in a compact nif gene cluster (nifBHDKENX(orf1)hesAnifV). But some Paenibacillus strains have multiple nifB genes and their functions are not known.Results: We have analyzed the genomes of the 116 diazotrophic Paenibacillus strains and found that some Paenibacillus strains have 2-4 nifB genes. Phylogeny analysis shows that all nifB genes in Paenibacillus fall into 4 subclasses: the nifB1 being the first gene within the compact nif gene cluster, the nifB2 being adjacent to anf or vnf genes, the other nifB3and nifB4 being scattered on genomes. Transcriptional results demonstrate that nifB1 exhibits the greatest increase in expression under Mo-dependent conditions and nifB2 is even more induced under alternative fixation conditions. Functional analyses by complementation of the ∆nifB and ∆nifBHDK mutantof P. polymyxa WLY78 which has only one nifB gene and only Mo-nitrogenase showed that both nifB1 and nifB2 are active in synthesis of Mo-, Fe and V-nitrogenase. The nifB3 and nifB4 genes were not significantly expressed under N2-fixing conditions and could not restore the nitrogenase activity of P. polymyxa ∆nifB mutant, suggesting that nifB3 and nifB4 genes were not involved in nitrogen fixation. In addition, reconstruction of anf system comprising 8 genes (nifBanfHDGK and nifXhesAnifV) and vnf system comprising 10 genes (nifBvnfHDGKEN and nifXhesAnifV) supported synthesis of Fe-nitrogenase and V-nitrogenasein P. polymyxa, respectively. Conclusions: Our data and analysis reveal the contents and distribution of nifB genes in Paenibacillus. We demonstrated that the transcriptions of nifB being adjacent to nif or anf or vnf genes significantly expressed under N2-fixation conditions and are active in synthesis of Mo-, Fe and V-nitrogenase. Our study also provides guidance for engineering nitrogen fixation genes into heterologous hosts for nitrogen fixation.