Developing highly efficient strategy for fabrication of bifunctional electrocatalysts for oxygen reduction reaction (ORR) and methanol oxidation reaction (MOR) is a challenging topic. In this work, we reported the in situ synthesis of N, S co-doped carbon nanorod material (N/S-C) by the facile template-free, one-step pyrolysis approach using N and S co-containing poly(ionic liquid) (PIL) of p[BZ][HSO 4 ] 2 as precursor derived from the simple chemically oxidative polymerization of ionic liquid benzidine sulfate ([BZ][HSO 4 ] 2 ) in the presence of ammonium persulfate as oxidant. The N/S-C catalysts have nanorod morphology with hierarchical porous architectures of abundant micropores and well-defined mesopores featuring high specific surface areas. The ORR performance of N/S-C-800 is extremely satisfactory in alkaline media with the onset and half-potentials of 0.985 V and 0.857 V (vs. RHE), respectively, which are comparable to that of commercial Pt/C (0.990 V and 0.852 V vs. RHE). It also delivers the favorable long-term stability and methanol tolerance, significantly outperforming commercial Pt/C. Moreover, the N/S-C-800 was served as a support for Pt nanoparticles, showing the higher methanol electrooxidation activity (806.74 mA mg Pt -1 ) compared with commercial Pt/C (356.32 mA mg Pt -1 ). These results show an effective route to design the attractive metal-free carbon-based electrocatalysts for direct methanol fuel cells. • The N/S co-doped carbon nanorod material was synthesized in situ via facile one-step pyrolysis approach using the poly(ionic liquids) (PILs) as precursor. • The N/S-C-800 catalyst exhibited the superior ORR activity and stability in alkaline media. • The Pt nanoparticles supported on the N/S-C-800 catalyst showed superior MOR activity.