spectral type
/ SPEK-trul /
Spread a star's light through a prism and instead of a smooth rainbow you see a rainbow crossed by dark gaps — missing slices of colour where particular atoms in the star's atmosphere have absorbed light. These dark absorption lines are a fingerprint. The spectral type is a label that sorts stars by the pattern of those fingerprints, which turns out to be mostly a sorting by temperature.
Each chemical element absorbs only at specific wavelengths, but which lines appear strongly in a star depends sharply on surface temperature, because temperature controls how atoms are excited and ionized. A hot star shows strong helium lines and weak hydrogen; a cooler star shows powerful hydrogen lines; a cool star shows molecular bands from titanium oxide, which can only survive at low temperatures. By reading which lines dominate, astronomers assign a spectral type without ever needing to know the star's distance.
Spectral type is one of the most information-dense single labels in astronomy: from it you can estimate temperature, infer colour, and narrow down luminosity and mass. The modern system, refined at Harvard in the early 1900s largely through the work of Annie Jump Cannon, runs O, B, A, F, G, K, M from hottest to coolest, with cooler classes L, T, Y added later for the faintest objects. Combined with a luminosity class, it becomes the two-part Morgan-Keenan label that pins a star's place on the Hertzsprung-Russell diagram.
The Sun is a type G2V star. The 'G2' says its temperature is around 5,800 K (cool-yellow), and the 'V' says it is an ordinary main-sequence star — a label that fits roughly on one line and tells a trained astronomer most of what they need to know.
One short code carries temperature, colour, and the kind of star it is.
A common misconception is that spectral type mainly measures chemical composition. It is overwhelmingly a temperature sequence — most stars have rather similar compositions, and it is temperature that decides which lines show up strongly.