Hydrogen is not only a promising energy, but also widely used in inflammation treatment and sports training. The key to these applications is to obtain purity hydrogen conveniently. Water electrolysis provides a green and sustainable method for hydrogen production, but the urgent problem is to develop low-cost and efficient electrocatalysts. In this work, hierarchically porous Ni3S2 nanostructures, which the flocculent two-dimensional Ni3S2 is coated on the surface of Ni3S2 nanosheets, were successfully grown on nickel foam through a facile two-step hydrothermal reaction. The hierarchically porous Ni3S2 nanostructures has a large specific surface area can expose more active sites and facilitates desorption of bubbles. Moreover, the theoretical calculation indicated that the dimensional confinement effect of metallic Ni3S2 improves the carrier concentration and conductivity. Therefore, the hierarchically porous Ni3S2 nanostructures on nickel foam exhibited enhanced hydrogen evolution reaction and good catalytic stability. This work sheds some light on improving the catalytic performance of metallic compounds.