A systematic first-principles study was conducted on the stability of binary iron carbides. The calculations showed that all the binary iron carbides are unstable relative to the elemental solids (α-Fe and graphite). Apart from a cubic Fe23C6 phase, the energetically most favorable carbides exhibit hexagonal close-packed (hcp) Fesublattices. Structural relaxation of the hcp iron carbides was analyzed and discussed together with their relative thermodynamically stability. Finite-temperature analysis showed that contributions from lattice vibration and anomalous magnetic ordering (Curie-Weiss behavior), rather than from the conventional lattice mismatch with the matrix, are the origin of the high stability and predominance of cementite among the iron carbides in steels.