The capability of nickel and iron doped graphene and graphene oxide nanosheets (GNS and GONS) for adsorbing of ozone, sulfur dioxide and nitrogen dioxide molecules were scrutinized by density functional theory calculations. The molecular electrostatic potential, adsorption energy and charge transfer of these gas molecules on nickel and iron doped GNS and GONS are studied. The high negative adsorption energy values exhibit that the nickel and iron dopant atoms can remarkably enhance the interaction between molecules and GNS and GONS. The range of chemisorption energy is -145.9 to -439.5 kJ/mol for the most stable complexes. The results indicated that the iron doped GNS and GONS are most effective for adsorbing ozone, nitrogen dioxide and sulfur dioxide molecules with obvious charge transfer. After the adsorption of these molecules, the energy gap of the G and GO are increased in all configurations. This study can be useful for removing toxicant gases.