A stars temperature is determined by the balance among its mass, gravitational structure, energy generation, composition and energy transport, with different temperatures applying to different regions of the star. The core is vastly hotter than the photosphere because nuclear reactions require extreme temperatures and densities, while the outer atmosphere is cooler. For the visible surface, astronomers commonly use effective temperature, which represents the temperature of a blackbody emitting the same total energy per unit surface area.
A stars mass is one of the most important determinants of its internal temperature because greater mass produces stronger gravitational compression and higher central pressure. This generally leads to hotter cores and faster nuclear reaction rates. Surface temperature is then influenced by how energy moves outward and by the stars radius and luminosity. Temperature is therefore not an independent property imposed from outside but an emergent result of stellar structure and energy balance.
Gravity establishes much of the temperature structure inside a star. A newly forming star begins as gas and dust collapsing under gravity. As the material contracts, gravitational potential energy is converted into thermal energy, raising the internal temperature. In a mature star, gravity compresses the plasma while pressure generated by thermal motion and other pressure sources provides opposing support. The deeper regions therefore experience enormous pressure and density, producing high temperatures.
The core temperature must be sufficient for whatever nuclear reactions are active at that evolutionary stage. In a main sequence star, hydrogen fusion supplies energy that maintains the thermal structure. As hydrogen becomes depleted, the core composition changes and the core can contract, increasing temperature and density and allowing new fusion reactions to begin if the star is sufficiently massive.
Stellar mass strongly influences both core and surface temperatures, but the relationship is not simply proportional. Massive stars have much stronger gravity and typically develop hotter cores, allowing hydrogen fusion to proceed rapidly. Their high energy output can produce high surface temperatures, especially for massive main sequence stars. Lower mass stars have cooler interiors and generally lower surface temperatures.
The mass luminosity relationship on the main sequence is steep, meaning a modest increase in mass can correspond to a much larger increase in luminosity. Because massive stars consume nuclear fuel rapidly, they also have shorter main sequence lifetimes. Low mass stars burn their hydrogen more slowly and can remain stable for vastly longer periods. Mass therefore acts as a fundamental control parameter linking gravity, temperature, luminosity, fuel consumption and stellar lifetime.
The surface temperature is also determined by luminosity and radius. The Stefan Boltzmann law states that a stars luminosity is proportional to its surface area multiplied by the fourth power of its effective temperature. Consequently, if luminosity and radius are known, effective temperature can be inferred, and if temperature and luminosity are known, radius can be estimated. This explains why stars of similar luminosity can have very different temperatures if their radii differ.
A compact hot star may emit strongly from a small surface area, while a giant cool star can achieve comparable or greater luminosity because its surface area is enormous. Stellar evolution frequently changes radius dramatically, so surface temperature can rise or fall even when the total energy output behaves differently. Temperature must therefore always be interpreted together with luminosity and radius.
Composition influences stellar temperature because it affects opacity, nuclear reaction rates, mean molecular weight and energy transport. Opacity describes how readily radiation is absorbed or scattered within stellar material. High opacity can make radiative energy transport less efficient, steepening temperature gradients and potentially promoting convection. Chemical composition also determines the availability of nuclear fuels and catalysts. Helium rich material has a different mean molecular weight from hydrogen rich material, altering the relationship between pressure, density and temperature.
Metals, meaning elements heavier than helium in astronomical terminology, can strongly affect opacity and atmospheric structure even when they constitute only a small fraction of the total mass. Stellar evolution changes composition over time, so temperature is not simply a fixed consequence of initial mass.
Energy transport determines how efficiently heat moves from the core towards the surface. In radiative regions, photons transport energy through repeated absorption and emission or scattering. In convective regions, bulk motion of plasma transports heat. The boundary between radiative and convective regions depends on the local temperature gradient, opacity and energy generation. The Sun has a radiative zone surrounding its core and a convective envelope beneath its photosphere.
More massive stars can have convective cores because their energy generation is highly concentrated and radiative transport becomes insufficient to carry the required flux without producing instability. The structure of these regions influences the temperature gradient and therefore the observable surface properties. Stellar temperature is consequently inseparable from the mechanisms by which energy moves through the interior and atmosphere.
Stellar atmospheres can have temperature structures that differ substantially from a simple single temperature model. The photosphere is the region from which much of the visible continuum radiation escapes, but above it lie additional atmospheric layers such as the chromosphere and, in Sun like stars, the much hotter corona. The solar corona reaches temperatures of millions of kelvin even though the photosphere is roughly 5800 kelvin, demonstrating that temperature can increase again in the outer atmosphere.
Magnetic fields and plasma processes are important in maintaining and heating such hot outer layers. Stellar winds can also carry energy and particles away from the surface. Consequently, the phrase a stars temperature must be interpreted carefully because a star has a strong radial temperature gradient and potentially complex atmospheric structure rather than one uniform temperature.
Astronomers determine stellar temperatures using spectroscopy, photometry and stellar models. Spectral line ratios are especially useful because the populations of atomic energy levels and ionisation states depend strongly on temperature. The presence or strength of particular absorption lines can therefore constrain the effective temperature. Broadband colours provide another estimate because hotter stars emit relatively more short wavelength radiation. Spectral energy distribution fitting can provide more detailed measurements, while interferometry can sometimes combine angular diameter with luminosity to constrain temperature. Temperature estimates are affected by uncertainties in composition, surface gravity, reddening and atmospheric models. A common misconception is that a stars colour alone gives an exact temperature. Colour is an important indicator, but precise stellar temperature determination generally requires calibrated observations and physical modelling.