The Earth has a liquid outer and solid inner core. It is predominantly composed of Fe, alloyed with small amounts of light elements, such as S, O and Si. The detailed chemical and thermal structure of the core is poorly constrained, and it is difficult to perform experiments to establish the properties of core–forming phases at the pressures (ca. 300 GPa) and temperatures (ca. 5000–6000 K) to be found in the core. Here we present some major advances that have been made in using quantum mechanical methods to simulate the high–P/T properties of Fe alloys, which have been made possible by recent developments in high–performance computing. Specifically, we outline how we have calculated the Gibbs free energies of the crystalline and liquid forms of Fe alloys, and so conclude that the inner core of the Earth is composed of hexagonal close packed Fe containing ca. 8.5% S (or Si) and 0.2% O in equilibrium at 5600 K at the boundary between the inner and outer cores with a liquid Fe containing ca. 10% S (or Si) and 8% O.