Recent experimental studies have demonstrated that Fe3C is more stable than Fe7C3 under PT-conditions of the Earth’s core. Theoretical calculations at 0 K, in turn, show the possible stability of Fe2C at the core pressures. Therefore, a theoretical modeling of iron carbides at ≤ 500 GPa is carried out. Energetically stable phases and the pressures of magnetic transitions at 0 K are determined. The parameters of magnetic transitions for Fe7C3 and Fe3C are consistent with those determined in the previous papers. The phase transition from Pnnm to Pnma in Fe2C at 28 GPa is estimated. At > 100 GPa, Fe2C loses its magnetic moment. Assuming carbon to be the only light element in the system, the first-principles calculations yield 2.7-2.9 and 2.0-2.2 wt.% C at the boundary of the inner core at 5000 and 7000 K, respectively.