In astronomy, stellar classification is the classification of stars based on their spectral characteristics. Showing the relationship between the stars’ luminosities versus their spectral classifications is done in the Hertzsprung-Russell diagram.
The spectral class of a star is a short code summarizing the ionization state, giving an objective measure of the photosphere’s temperature and density. Most stars are currently classified under the Morgan-Keenan (MK) system using the letters O, B, A, F, G, K, and M, a sequence from the hottest (Class O to the coolest (Class M).
Each letter class is then subdivided using a numeric digit with 0 being hottest and 9 being coolest (e.g. A8, A9, F0, F1 form a sequence from hotter to cooler). In the MK system, a luminosity class is added to the spectral class using Roman numerals.
This is based on the width of certain absorption lines in the star’s spectrum, which vary with the density of the atmosphere and so distinguish giant stars from dwarfs. Class I stars is for supergiants, class II for bright giants, class III for regular giants, class IV for sub-giants and class V for main-sequence stars
The full spectral class for the Sun is then G2V, indicating a main-sequence star with a temperature around 5,800 Kelvin.