Developing high-performance, low-cost, and robust bifunctional electrocatalysts for overall water splitting is extremely indispensable and challenging. It is a promising strategy to couple highly active precious metals with transition metals as efficient electrocatalysts, which can not only effectively reduce the cost of the preparation procedure, but also greatly improve the performance of catalysts through a synergistic effect. Herein, Ru and Ni nanoparticles embedded within nitrogen-doped carbon nanofibers (RuNi-NCNFs) are synthesized via a simple electrospinning technology with a subsequent carbonization process. The as-formed RuNi-NCNFs represent excellent Pt-like electrocatalytic activity for the hydrogen evolution reaction (HER) in both alkaline and acidic conditions. Furthermore, the RuNi-NCNFs also exhibit an outstanding oxygen evolution reaction (OER) activity with an overpotential of 290 mV to achieve a current density of 10 mA cm-2 in alkaline electrolyte. Strikingly, owing to both the HER and OER performance, an electrolyzer with RuNi-NCNFs as both the anode and cathode catalysts requires only a cell voltage of 1.564 V to drive a current density of 10 mA cm-2 in an alkaline medium, which is lower than the benchmark of Pt/C||RuO2 electrodes. This study opens a novel avenue toward the exploration of high efficient but low-cost electrocatalysts for overall water splitting.