Based on the ab initio calculations within the density functional theory and crystal structure prediction algorithms, the structure and stability of compounds in the Ni−S system at pressures of 100−400 GPa were determined. As a result, a homologous series of discrete compounds (Ni and S) consisting of Ni 14 S-C2/m, Ni 13 S-R3̅ , Ni 12 S-R3̅ , Ni 5 S-C2/m, Ni 4 S-P1̅ , and Ni 3 S-Cmcm is revealed. We also confirmed the absence of the stable Febearing compounds between Fe and Fe 2 S in the studied pressure range. At the Earth's core pressures, 4 wt % of sulfur can be dissolved in solid fcc-Ni without deformation of the structure. Significant deformations in the Ni structure occur at sulfur contents from 4 to 15 wt %. In contrast, up to 0.45 wt % of sulfur could be dissolved in hcp-Fe at 350 GPa and 0 K. For Ni 3 S, two phases with space groups I4̅ and Cmcm were predicted. Ni 3 S-I4̅ is stable at least from 100 GPa, whereas above 330 GPa, it transforms into Ni 3 S-Cmcm. The pressure of phase transition is almost independent of temperature. The Ni 2 S is stable in the entire pressure range and undergoes a single-phase transition from the Pnma-to P6̅ 2m-phase at 266 GPa and 0 K with a Clapeyron slope of 5 MPa/ K. The S-rich sulfide NiS 3 is characterized by Im3̅ m symmetry and is thermodynamically stable from 100 to 318 GPa. Our new data on Ni sulfides might be important to constrain detailed thermodynamic models for Fe−Ni-bearing Earth and planetary cores.