Ultrathin nitrogen-doped carbon nanofibers (NCNFs) with unique structure are prepared by electrospinning. The ultrathin NCNFs are produced in the form of large-area membranes by carbonizing electrospun polyacrylonitrile (PAN) nanofibers in NH3. The diameter of the NCNFs can be effectively reduced due to the etching reactivity of NH3 with carbon and the average diameter down to 20nm is obtained. The NCNFs carbonized in NH3 possess unique structure that many graphitic layers protrude from the fiber surface with their edges exposed. The nitrogen doped in the NCNFs is mainly from that contained in the PAN molecules and partially from ambient NH3. The membranes of the ultrathin NCNFs exhibit high electrocatalytic activity, long-term operation stability, and excellent tolerance to crossover effect during oxygen reduction reaction in fuel cells. The high electrocatalytic activity of the ultrathin NCNFs may be mainly ascribed to their small diameter and exposed graphitic layer edges apart from N doping. Due to the simplicity in production, low cost, absence of metal residue, and the material form of freestanding membrane with large area the ultrathin NCNFs derived from electrospinning hold high promise for the practical application of fuel cells.