Earth’s inner core is known to consist of crystalline iron (Fe) alloyed with a considerable amount of nickel (Ni) and lighter elements, but shear wave (S-wave) travels through the inner core at about half the speed expected for most Fe-rich alloys under relevant pressures. The core also exhibits anomalously high Poisson’s ratio, but those of most Fe-rich alloys are much lower than observed. Carbon, due to its high cosmic abundance and high solubility in Fe-Ni alloy under the formation and current conditions of outer core, is among the top candidates for the principal light element in the Earth’s core. Both iron-carbide phases Fe3C and Fe7C3 have been proposed as components of the inner core, solidifying from a carbon-containing metallic liquids. Here we report new experimental data from Nuclear Resonant Inelastic X-ray scattering measurements up to core pressures on iron carbide Fe3C, showing that its sound velocities increase with density at a low rate comparable to Fe7C3 after going through a pressure-induced spin-pairing transition at 40-50 gigapascals (GPa), as revealed by our X-ray Emission Spectroscopy measurements. Extrapolating to the inner core pressure, we found that the incorporation of carbon in Fe to form Fe3C and Fe7C3 can significantly lower the vS, but increase the Poisson’s ratio to a level close to seismologically observed values of the inner core. The alloying of carbon with solid Fe may account for the anomalous elastic properties of the inner core. Thus, the core may be the largest reservoir of carbon in Earth’s deep interiors.