Why are blue stars hotter than red stars?
Stars exhibit different colors primarily because they have different surface temperatures. In astronomy, a star's color is a direct indicator of its temperature, which is categorized through stellar classification.1
The relationship between color and temperature is governed by the physics of blackbody radiation. As a star's surface temperature increases, the peak wavelength of the light it emits shifts toward the shorter, higher-energy end of the visible spectrum, which corresponds to blue light. Conversely, cooler stars emit more of their energy at longer, lower-energy wavelengths, appearing red.213
This temperature-color correlation is reflected in the standard spectral sequence, where the hottest stars (classes O and B) are blue or bluish white, with surface temperatures typically exceeding 10,000 K. In contrast, the coolest stars (class M) appear red, with surface temperatures around 3,000 K.21