Different stars have different surface temperatures, depending on their chemical composition, size, and age.
Astronomers have developed seven basic classifications for stars according to temperature, which are called spectral classes.
From hottest to coolest, the classes are 0, B, A, F, G, K, and M. Class 0 stars have surface temperatures greater than 30,000°K (53,540°F/29,727°C). Class M stars have temperatures less than 3,500°K (5,840°F/3,227°C).
The other classes fall in between. The Sun is a class G star, the class of stars whose temperatures range from 5,000° to 6,000°K (8,540° to 10,340°F/4,727° to 5,727°C).
The Hertzsprung-Russell diagram shows the correlation between temperature of a star (0 to M) and its magnitude (-10 to +15).
Mature stars, such as the Sun, are found along the main sequence. Old stars, giants and super giants, are bright, but cool.
They generally end up as hotter, but darker, white dwarfs.