Carbon has been suggested as one of the light elements existing in the Earth's core. Under core conditions, iron carbide Fe7C3 is likely the first phase to solidify from a Fe-C melt and has thus been considered a potential component of the inner core. The crystal structure of Fe7C3, however, is still under debate, and its thermoelastic properties are not well constrained at high pressures. In this study, we performed synchrotron-based single-crystal X-ray diffraction experiment using an externally heated diamond-anvil cell to determine the crystal structure and thermoelastic properties of Fe7C3 up to 80 GPa and 800 K. Our diffraction data indicate that Fe7C3 adopts an orthorhombic structure under experimentally investigated conditions. The pressure-volume-temperature data for Fe7C3 were fitted by the high-temperature Birch-Murnaghan equation of state, yielding ambient-pressure unit-cell volume V0 = 745.2(2) Å3, bulk modulus K0 = 167(4) GPa, its first pressure derivative K0′ = 5.0(2), dK/dT = –0.02(1) GPa/K, and thermal expansion relation αT = 4.7(9) × 10-5 + 3(5) × 10-8 × (T – 300) K-1. We also observed anisotropic elastic responses to changes in pressure and temperature along the different crystallographic directions. Fe7C3 has strong anisotropic compressibilities with the linear moduli Ma > Mc > Mb from zero pressure to core pressures at 300 K, rendering the b axis the most compressible upon compression. The thermal expansion of c3 is approximately four times larger than that of a3 and b3 at 600 and 700 K, implying that the high temperature may significantly influence the elastic anisotropy of Fe7C3. Therefore, the effect of high temperature needs to be considered when using Fe7C3 to explain the anisotropy of the Earth's inner core.