The OBAFGKM sequence and stellar temperature
Stellar spectral classes divide stars into seven main categories by temperature and color. O-type stars are the hottest (above 30,000 Kelvin) and appear blue. B-type stars are hot (10,000 to 30,000 K) and blue-white. A-type stars are warm (7,500 to 10,000 K) and white. F-type stars are moderately hot (6,000 to 7,500 K) and yellow-white. G-type stars (like our sun) are moderate (5,200 to 6,000 K) and yellow. K-type stars are cool (3,700 to 5,200 K) and orange. M-type stars are the coolest (below 3,700 K) and red. The sequence OBAFGKM is memorized by generations of astronomers using the mnemonic Oh Be A Fine Girl/Guy, Kiss Me. The spectral class not only reveals temperature but correlates tightly with mass, luminosity, and lifetime. An O-type star is typically 30 or more times the sun's mass and lives for mere millions of years. An M-type star is often less than half the sun's mass and will live for longer than the universe's current age.
Subdivisions and brightness classes
Within each spectral class, stars are subdivided into finer gradations (e.g., G5 is between G0 and K0). Additionally, Roman numerals indicate luminosity class: I for supergiants, III for giants, and V for main-sequence dwarfs. The sun is classified as G2V, meaning it is a yellow main-sequence star with temperature around 5,800 K. Betelgeuse is M1 I, a cool red supergiant with immense luminosity despite its relatively low temperature. This classification system, refined over more than a century, encodes a wealth of stellar physics. A star's spectral class can be determined from its light spectrum alone, making it one of the most practical tools in observational astronomy.