Industrial-scale water splitting processes will require economical and efficient electrocatalyst materials. Many oxygen evolution electrocatalysts prepared with non-precious metals have been reported. However, transition metal-based nanomaterials experience unavoidable aggregation and low stability in corrosion environments, which substantially reduces their catalytic performance. Herein, we successfully used a simple electrospinning technique followed by carbonation to synthesize a porous B-doped carbon fiber electrocatalyst with embedded B-doped FeNi alloy nanoparticles. To prepare the optimal catalyst sample, 1.05 g PAN, 5.0 mmol H3BO3, 2.5 mmol Fe(NO3)3, and 2.5 mmol Ni(NO3)2 were used as precursors. The electrospun pristine fibers were annealed for 1 h at 800 °C in argon. Its overpotential for oxygen evolution at a current density of 10 mA cm−2 was only 231 mV, and a 60.99 mV·dec−1 Tafel slope was achieved. At this current density, this catalyst exhibits good performance for over 24 h or for more than 1000 CV cycles. This is due to the doping of non-metallic B atoms into the alloy nanoparticles, as well as the support and protection on them by carbon nanofibers. Insight This research provides a more thorough understanding of the preparation and practical application of low-cost and high-efficiency transitional metal alloy based water splitting catalysts.