Self-supported porous Ni–P foam is fabricated by a convenient one-step method, and exhibits excellent electrocatalytic performance towards oxygen evolution reaction. An alkaline electrolyzer constructed using two self-supported porous Ni–P foams shows superior energy efficiency of 90.2% at 10 mA cm−2, and can sustain 1000 h under operation conditions without obvious degradation.