Creating affordable and efficient bifunctional electrocatalysts is crucial for producing clean hydrogen energy through complete water splitting. We describe a way to make S-doped carbon-encapsulated iron-nickel phosphide nanowires (S/FeNiP@C) using metal-organic frameworks. These nanowires exhibit exceptional electrocatalytic performance for both the hydrogen evolution reaction (HER) and oxygen evolution reaction (OER) in alkaline conditions. The optimized S/FeNiP@C nanowires exhibit low overpotentials of 53 mV and 270 mV at a current density of 10 mA cm˗2 for HER and OER, respectively. They also have tiny Tafel slopes of 159 mV dec˗1 for HER and 50 mV dec˗1 for OER. The water electrolyzer uses S/FeNiP@C nanowires as both the anode and the cathode to reach a current density of 10 mA cm˗2 at a voltage of 1.61 V and stays very stable for 48 h. The great catalytic performance is mostly due to the simple carbon framework and low sulfur integration. This creates a large surface area for the catalyst and electrolyte to interact, allowing charge and mass to move quickly, and a lot of active sites that last a long time.