The NiS2 nanosheet array on Ni foil (NiS2/NF) was prepared using an in situ growth strategy and sulfidation method and was used as the cathode of lithium sulfur battery. The unique nanostructure of the NiS2 nanosheet array can provide abundant active sites for the adsorption and chemical action of polysulfides. Compared with the sulfur powder coated pure NF (pure NF-S) for lithium sulfur battery, the sulfur powder coated NiS2/NF (NiS2/NF-S) electrode exhibits superior electrochemical performance. Specifically, the NiS2/NF-S delivered a high reversible capacity of 1007.5 mAh g−1 at a current density of 0.1 C (1 C= 1675 mA g−1) and kept 74.5% of the initial capacity at 1.0 C after 200 cycles, indicating the great promise of NiS2/NF-S as the cathode of lithium sulfur battery. In addition, the NiS2/NF-S electrode also showed satisfactory electrochemical performance when used as the cathode for sodium sulfur battery.