Carbon is extremely abundant in the solar system (10 x Si, 20 x S) and in Cl carbonaceous chondrites (3.2 wt%) and it dissolves readily in liquid Fe at low pressures (4.3 wt% at 1420 K). Despite these properties it is rarely considered a potential light element in the Fe-rich core, because it is volatile, even at low temperatures as CO.|In this paper I show that carbon volatility is a strongly pressure-dependent phenomenon and that it applies during condensation from a solar gas (approximately 10(-3) atm), but not at the pressures and temperatures generated during planetary accretion and differentiation (0.01-5 GPa). Thus, impact heating and degassing of the protoearth should have led to an Fe-rich melt with around 2-4 wt% carbon, compared to the 0.01-0.6 wt% in iron meteorites and 0.3-3 ppm C predicted to be present in Fe condensed from the solar gas.|Experiments (to 9 GPa) and thermodynamic calculations on the systems Fe-C and Fe-C-S show that carbon solubility in Fe melt increases slightly with pressure but that carbon could not conceivably constitute more than half the light element content of the core. The addition of even very small amounts of carbon (< 1%) to liquids containing Fe and a light element such as S has, however, a dramatic effect on the properties of the system. At 330 GPa (inner core-outer core boundary) 0.3% of carbon is sufficient to stabilise iron carbide Fe3C, rather than epsilon-Fe as the first phase to crystallize in melts with around 10% S. Thus, for most conceivable ratios of S/C, the inner core would be expected to be crystallising Fe3C, rather than epsilon-Fe or Fe-Ni alloy.|Given probable inner core temperatures of around 5000-6000 K, both epsilon-Fe and the higher pressure alpha'-Fe are too dense to explain the inner core density of 12.85 Mg m-3. The stability of iron carbide provides a possible solution. I show that, given a plausible equation of state for Fe3C, this phase acquires the inner core density in the Tight pressure-temperature range.