It is the site of violent convection. The churning metal of the outer core creates and sustains Earth's magnetic field. The hottest part of the core is actually the Bullen discontinuity, where temperatures reach 6,000° Celsius (10,800° Fahrenheit) as hot as the surface of the sun. But even lava can't hold a candle to the sun! At its surface the sun's temperature is a whopping 10,000° F! That's about five times hotter than the hottest lava on Earth.
The Sun's surface is much hotter than the Earth's surface. The Sun's surface temperature is around 5,500 degrees Celsius (9,932 degrees Fahrenheit), while the Earth's average surface temperature is around 15 degrees Celsius (59 degrees Fahrenheit). Consequently, the Sun is much hotter than the Earth in terms of surface temperature.
However, if we look at the Earth's interior, the situation is different. The Earth's inner core, located at a depth of around 5,150 kilometers, is estimated to have a temperature of around 5,000 to 6,000 degrees Celsius (9,000 to 10,800 degrees Fahrenheit). This temperature is higher than the Sun's surface.
It's important to note that the heat of the Earth's core is not due to nuclear fusion, as occurs in the Sun. The heat of the Earth's core is mainly generated by the residual heat of the Earth's formation, the radioactive decay of elements present in the core, and the heat generated by chemical reactions.
In short, the Sun's surface is much hotter than the Earth's surface, but the Earth's inner core is hotter than the Sun's surface. The Sun is therefore hotter than the Earth in terms of surface temperature, but the comparison becomes more complex when we examine the inner layers of both objects.