The density and sound velocity structure of the Earth's interior is modeled on seismological observations and is known as the preliminary reference Earth model (PREM). The density of the core is lower than that of pure Fe, which suggests that the Earth's core contains light elements. Carbon is one plausible light element that may exist in the core. We determined the equation of state (EOS) of Fe 3 C based on in situ high-pressure and high-temperature X-ray diffraction experiments using a diamond anvil cell. We obtained the P-V data of Fe 3 C up to 327 GPa at 300 K and 70-180 GPa up to around 2300 K. The EOS of nonmagnetic (NM) Fe 3 C was expressed by two models using two different pressure scales and the third-order Birch-Murnaghan EOS at 300 K with the Mie-Grüneisen-Debye EOS under high-temperature conditions. The EOS can be expressed with parameters of V 0 = 148.8(±1.0) Å 3 , K 0 = 311.1(±17.1) GPa, K 0 = 3.40(±0.1), γ 0 = 1.06(±0.42), and q = 1.92(±1.73), with a fixed value of θ 0 = 314 K using the KBr pressure scale (Model 1), and V 0 = 147.3(±1.0) Å 3 , K 0 = 323.0(±16.6) GPa, K 0 = 3.43(±0.09), γ 0 = 1.37(±0.33), and q = 0.98(±1.01), with a fixed value of θ 0 = 314 K using the MgO pressure scale (Model 2). The density of Fe 3 C under inner core conditions (assuming P = 329 GPa and T = 5000 K) calculated from the EOS is compatible with the PREM inner core.