Nitrogen-doped transition metal materials display promising potential as bifunctional electrocatalysts for oxygen reduction reaction (ORR) and oxygen evolution reaction (OER). Herein, Fe/N co-doped three-dimensional (3D) porous graphene (FeN-3D-PG) is prepared via a template method using sodium alginate as the carbon source and low polymerization degree melamine resin as the nitrogen source. The low polymerization degree melamine resin can form complexes with Fe3+ in the aqueous solution and further forms high density Fe-Nx active sites during pyrolysis. Meanwhile, the formed 3D porous structure efficiently promotes the uniform distribution of Fe-Nx active sites. The FeN-3D-PG catalyst exhibits pH-independent ORR activity. For OER, the catalyst possesses a low over potential (370 mV at 10 mA cm−2) in alkaline electrolyte. The Zn-air batteries (ZABs) using FeN-3D-PG as cathode exhibits a power density up to 212 mW cm−2, a high specific capacity of 651 mAh g−1, and the charge-discharge stability of 80 h. This work provides new sight to transition metal materials based ZABs with excellent performance.