Earth-abundant, efficient and durable electrocatalysts for water splitting are vitally important for a sustainable energy system. Here we report the rational design of hollow Mo-doped CoP (Mo-CoP) nanoarrays, which simultaneously combine electronic structure modification through doping with a high density of reaction sites through nanostructuring. With this strategy the Mo-CoP arrays give significantly improved hydrogen evolution reaction (HER) performance, and also, when in situ transformed into Mo-doped CoOOH (Mo-CoOOH) arrays, excellent activity towards the oxygen evolution reaction (OER) is obtained. The origin of the improvement is determined by atomic-resolution imaging combined with density functional theory (DFT). An electrolyzer using Mo-CoP and Mo-CoOOH can be powered by a single AA battery (~1.5 V), and maintains a stable water-splitting current for 20 h, superior to most reported electrocatalysts in alkaline media, offering great promise for practical applications.