Stellar

Stellar Spectral Classification

Sorting stars by OBAFGKM and their lines

Stellar spectral classification is the system that sorts stars by surface temperature into the seven-class sequence O, B, A, F, G, K, M — read from the pattern of absorption lines carved into each star's spectrum. O stars blaze blue at ~30,000–50,000 K; M dwarfs glow red at ~2,400–3,700 K, with the Sun a yellow G2V near 5,772 K. Each letter splits into ten subtypes (O0–O9, B0–B9, …) and pairs with a luminosity class (I–V) in the modern Morgan–Keenan system. The order is famously memorized as "Oh Be A Fine Guy/Girl, Kiss Me."

  • SequenceO B A F G K M (hot → cool)
  • O-star temperature~30,000–50,000 K (blue)
  • M-star temperature~2,400–3,700 K (red)
  • The SunG2V · ~5,772 K · yellow
  • Subdivisions0–9 per class + luminosity I–V
  • Established byHarvard / Annie Jump Cannon (1901–1924)

Interactive visualization

Press play, or step through manually. The visualization is yours to drive — try it before reading on.

Open visualization fullscreen ↗

Watch the 60-second explainer

A condensed visual walkthrough — narrated, captioned, under a minute.

What spectral classification measures

A star's spectrum is its fingerprint. Spread starlight through a prism or diffraction grating and the smooth rainbow is interrupted by dark absorption lines — narrow gaps where atoms and molecules in the star's outer atmosphere have soaked up specific wavelengths. The pattern of which lines are present and how strong they are encodes, above all, one quantity: the surface temperature of the star. Spectral classification is the act of reading that pattern and assigning the star to a class.

The crucial and counterintuitive insight is that line strength does not track chemical abundance. Nearly every star is roughly 71% hydrogen and 27% helium by mass, with everything heavier (astronomers lump these together as "metals") under 2%. Yet hydrogen lines vary wildly from class to class. What changes is the excitation and ionization state of the atoms — governed by temperature through the Saha and Boltzmann equations. An atom can only absorb a given wavelength if its electrons sit in the right starting energy level, and temperature decides how the electron populations are distributed.

The OBAFGKM sequence

The seven classes, from hottest to coolest, are O, B, A, F, G, K, M. Each is divided into ten decimal subtypes — B0 is the hottest B star, B9 the coolest, just before A0. The color shifts smoothly from blue-violet through blue-white, white, yellow-white, yellow, orange, to deep red. The dominant spectral features shift in lockstep:

ClassTemperature (K)ColorDominant linesFraction of stars*Example
O30,000–50,000BlueIonized He II, weak H~0.00003%Zeta Puppis (O4)
B10,000–30,000Blue-whiteNeutral He I, growing H~0.12%Rigel (B8 Ia)
A7,500–10,000WhiteStrongest H Balmer, weak metals~0.6%Sirius A (A1 V), Vega (A0 V)
F6,000–7,500Yellow-whiteH weakening, ionized Ca II rising~3%Procyon (F5 IV-V)
G5,200–6,000YellowCa II H & K, many neutral metals~7.6%Sun (G2 V)
K3,700–5,200OrangeNeutral metals dominate, CH band~12%Arcturus (K1.5 III)
M2,400–3,700RedTiO molecular bands, neutral metals~76%Proxima Centauri (M5.5 V), Betelgeuse (M1-2 Ia-ab)

*Approximate fraction of main-sequence stars in the solar neighborhood. The galaxy is overwhelmingly made of dim M dwarfs; bright O and B stars are vanishingly rare and short-lived.

Notice the hydrogen story across the table. In O stars, the surface is hot enough (>30,000 K) to strip the electron clean off most hydrogen atoms, so neutral-hydrogen Balmer lines are weak and ionized-helium lines appear. As we cool through B into A, more hydrogen stays neutral with electrons in the n=2 level that produces the visible Balmer lines — strength peaks near 9,500 K in class A. Cool further and the electrons sink into the n=1 ground state, which absorbs only ultraviolet, so Balmer lines fade again through F, G, K. By class M the atmosphere is cool enough for molecules like titanium oxide (TiO) to survive, carving broad bands that swamp the spectrum.

From Harvard letters to a temperature ladder

The lettering looks scrambled because of its history. The original Harvard classification, developed in the 1880s–1890s from the Henry Draper Memorial photographic survey, ran A, B, C, D… ordered by the strength of hydrogen lines — A stars had the strongest. As physicists understood that temperature, not hydrogen content, was the underlying variable, Annie Jump Cannon reorganized the scheme between 1901 and 1924. She discarded redundant letters, merged others, and moved O and B (originally defined by helium and other features) ahead of A so the whole list became monotonic in temperature. The surviving order — O, B, A, F, G, K, M — is therefore a temperature ladder wearing the labels of an older, abandoned alphabet.

Cannon personally classified roughly 350,000 stars by eye, at times more than three per minute, work compiled into the Henry Draper Catalogue. This was the foundation that turned spectral classification from a curiosity into a precise observational science.

The MK system: adding luminosity

Temperature alone doesn't pin down a star. A red M-class point of light could be a tiny dwarf a few light-years away or a vast supergiant a thousand times farther. In 1943, William Morgan, Philip Keenan, and Edith Kellman introduced the MK (Morgan–Keenan) system, adding a Roman-numeral luminosity class that is read from the width of the spectral lines:

ClassTypeExample
Ia / IbLuminous / less luminous supergiantsBetelgeuse (M1-2 Ia-ab)
IIBright giantsPolaris (F7 Ib historically; ~II class kin)
IIINormal giantsArcturus (K1.5 III), Aldebaran (K5 III)
IVSubgiantsProcyon (F5 IV-V)
VMain-sequence dwarfsSun (G2 V), Sirius A (A1 V)
VI / sdSubdwarfsKapteyn's Star (sdM1)
VII / DWhite dwarfsSirius B (DA2)

The physics behind the line width is pressure broadening. A giant's atmosphere is enormous and tenuous; with few atomic collisions, its absorption lines stay sharp and narrow. A dwarf packs the same temperature gas into a much smaller, denser atmosphere, so frequent collisions smear each line wider. By comparing line widths against calibrated standards, a classifier separates a luminous giant from a compact dwarf at the same temperature. The full label combines both axes: the Sun is G2V — a G-class star, subtype 2, on the main sequence.

Beyond M: brown dwarfs, carbon stars, and the hot extreme

The classical seven classes were extended as instruments reached cooler and stranger objects. L, T, and Y classes were defined in the late 1990s and 2000s for brown dwarfs and the coolest free-floating bodies: L (~1,300–2,400 K) shows metal hydrides and neutral alkali metals; T (~500–1,300 K) is marked by methane absorption; Y (below ~500 K, colder than the human body in some cases) shows ammonia and water. At the hot extreme, Wolf–Rayet (WR) stars display broad emission lines from a fierce stellar wind rather than absorption. Branch classes C (carbon stars) and S (zirconium-oxide stars) split off the cool giant track where dredged-up carbon or s-process elements rewrite the surface chemistry.

Why spectral classification matters

  • Temperature without a thermometer. A single spectrum yields surface temperature to within a few hundred kelvin, no distance required.
  • The HR diagram. Spectral class (the x-axis) plus luminosity (the y-axis) builds the Hertzsprung–Russell diagram — the single most important map in stellar astrophysics.
  • Spectroscopic parallax. Knowing a star's luminosity class gives its absolute brightness; comparing to apparent brightness yields distance, even far beyond geometric parallax range.
  • Habitability. A star's class sets the size and location of its habitable zone — long-lived K and M dwarfs are prime exoplanet targets.
  • Stellar evolution. Mass, age, and fate all correlate with class; an O star burns out in a few million years, an M dwarf can outlive the present universe.
  • Composition. Beyond temperature, fine line ratios reveal metallicity and abundance anomalies — the chemical history of a star.

Common misconceptions

  • Line strength equals abundance. No — it tracks excitation/ionization state, which is set by temperature. All classes are ~75% hydrogen.
  • O stars are the most common. The opposite — roughly 76% of stars are M dwarfs; O stars are about one in three million.
  • The Sun is yellow because it's a "yellow dwarf." The Sun's light is essentially white; the "yellow" label is a class descriptor, and "dwarf" just means main-sequence (class V).
  • The letters were chosen for the words in the mnemonic. Reversed — the mnemonic was invented to remember an order fixed by temperature and history.
  • Color tells you everything. Color gives temperature, but luminosity class (line width) is needed to distinguish a dwarf from a giant of the same color.

Frequently asked questions

What does OBAFGKM stand for?

OBAFGKM is the order of the seven main stellar spectral classes, sorted from hottest to coolest surface temperature. O stars are ~30,000–50,000 K and blue; B ~10,000–30,000 K; A ~7,500–10,000 K; F ~6,000–7,500 K; G (the Sun's class) ~5,200–6,000 K; K ~3,700–5,200 K; M ~2,400–3,700 K and red. The classic mnemonic is "Oh Be A Fine Guy/Girl, Kiss Me."

Why is the order O B A F G K M and not alphabetical?

The Harvard scheme was originally A, B, C... ordered by the strength of hydrogen Balmer lines. When astronomers realized the real ordering parameter was temperature, Annie Jump Cannon reordered and merged the classes — dropping redundant letters and shuffling O and B ahead of A — to make the sequence monotonic in temperature. The leftover letters are a historical artifact.

If all stars are mostly hydrogen, why don't hydrogen lines look the same in every star?

Line strength depends on how many atoms sit in the right energy state to absorb, not just on abundance. Balmer (visible hydrogen) lines need electrons in the n=2 level. That population peaks near ~9,500 K (class A). Hotter O/B stars ionize hydrogen so few neutral atoms remain; cooler K/M stars leave electrons in the ground state. So hydrogen lines are strongest in A stars even though every class is ~75% hydrogen by mass.

What is the difference between spectral type and luminosity class?

Spectral type (the OBAFGKM letter plus a 0–9 subdivision) encodes temperature. Luminosity class (Roman numerals I–VII) encodes size and luminosity, read from how narrow the spectral lines are — low-density giant atmospheres make sharp lines, dense dwarf atmospheres broaden them via pressure. Combined in the MK system: the Sun is G2V (a G2 main-sequence dwarf), Betelgeuse is M1-2 Ia-ab (a red supergiant).

What spectral type is the Sun?

The Sun is a G2V star: a G-class yellow dwarf, subdivision 2, luminosity class V (main sequence). Its surface (photosphere) temperature is about 5,772 K. Its spectrum shows strong neutral metal lines — especially the Fraunhofer H and K lines of ionized calcium — moderate hydrogen Balmer lines, and the G band of CH molecules.

Are there classes beyond M?

Yes. Classes L, T, and Y were added to cover brown dwarfs and the coolest objects: L (~1,300–2,400 K, metal hydrides and alkali metals), T (~500–1,300 K, methane bands), and Y (below ~500 K, ammonia and water). Carbon stars (C) and zirconium-oxide S stars also branch off the cool end. WR (Wolf–Rayet) stars sit at the hot extreme with broad emission, not absorption, lines.