Hertzsprung-Russell Diagram Classifier

Enter a star's surface temperature and luminosity to get its full Morgan-Keenan spectral classification and H-R diagram position.

🌟 Hertzsprung-Russell Diagram Classifier
Surface Temperature5,778 K
K
2,000 K50,000 K
Stellar Luminosity1.000 L☉
L☉
MK Classification
Luminosity Class
H-R Diagram Region
Absolute Magnitude
Color

🌟 What is the Hertzsprung-Russell Diagram Classifier?

The Hertzsprung-Russell (H-R) diagram is a scatter plot of stellar luminosity versus surface temperature, the most important diagram in stellar astronomy. Stars cluster in well-defined regions: a diagonal main sequence where hydrogen-burning dwarfs live, a giant branch to the upper right, a supergiant zone at the very top, and a white dwarf sequence at the lower left. This classifier takes a star's temperature and luminosity and returns its full Morgan-Keenan (MK) spectral classification, pinpointing exactly where the star sits on the diagram.

The spectral type letter (O, B, A, F, G, K, M) comes from the surface temperature. O and B are hot blue stars; A and F are white to yellow-white; G (including the Sun) are yellow; K are orange; M are cool red stars. Within each letter, a numeral 0-9 gives finer resolution (0 = hottest, 9 = coolest within the type). The Sun is G2. This notation, developed by Annie Jump Cannon at Harvard in the early 1900s, encodes the strength of spectral absorption lines, which depend directly on photospheric temperature.

The luminosity class Roman numeral (Ia, Ib, II, III, IV, V, D) distinguishes stars of the same temperature that occupy very different positions on the diagram. A K5V and a K5III both have orange-colored photospheres near 4,000 K, but the K5V is a main-sequence star like our Sun's future, while the K5III is a giant 10-100 times larger. Luminosity class reveals the evolutionary state: V = main sequence (hydrogen burning), IV = subgiant (transitioning), III = giant, II = bright giant, Ib = supergiant, Ia = bright supergiant, D = white dwarf remnant.

This calculator also outputs the absolute magnitude (M = 4.83 - 2.5 log10(L/L☉)), which is used by astronomers to determine stellar distances via the distance modulus, and a color description based on the temperature band. It is used in introductory astronomy and astrophysics courses to verify manual classifications, explore how temperature and luminosity determine stellar identity, and build intuition about the H-R diagram before studying stellar evolution in detail.

📐 Formula

Spectral type: T determines O→B→A→F→G→K→M
T ≥ 30,000 K = O-type (blue-violet)
10,000 to 30,000 K = B-type (blue-white)
7,500 to 10,000 K = A-type (white)
6,000 to 7,500 K = F-type (yellow-white)
5,200 to 6,000 K = G-type (yellow)
3,700 to 5,200 K = K-type (orange)
T below 3,700 K = M-type (red)
Absolute magnitude: M = 4.83 − 2.5 × log10(L / L☉)
M = absolute magnitude (apparent magnitude at 10 parsecs)
4.83 = absolute magnitude of the Sun
L = stellar luminosity in solar luminosities (L☉)
Example: L = 25.4 L☉ → M = 4.83 − 2.5 × log10(25.4) = +1.32

📘 How to Use This Calculator

Steps

1
Enter the surface temperature - Type the star's effective surface temperature in Kelvin and adjust the slider. The Sun is 5,778 K; O-type blue stars exceed 30,000 K; cool M-type red dwarfs are below 3,700 K.
2
Enter the stellar luminosity - Type the star's luminosity in solar units (L☉). The Sun is 1 L☉; red giant branch stars are typically 10 to 1,000 L☉; supergiants exceed 10,000 L☉.
3
Read the classification - The calculator returns the full MK designation (e.g., G2V), the luminosity class name, the H-R diagram region, absolute magnitude, and photospheric color description.

💡 Example Calculations

Example 1 - The Sun

T = 5,778 K, L = 1 L☉ (our Sun)

1
T = 5,778 K falls in the G range (5,200 to 6,000 K). Subtype = round(9 × (1 − (5778−5200)/(6000−5200))) = round(9 × 0.278) = 2 → G2.
2
log10(1) = 0. No luminosity class criteria for giant/supergiant/subgiant met. Default: V (Main Sequence). Region: Middle main sequence (3,700 K to 6,000 K range; 5,778 K fits here).
3
Absolute magnitude: M = 4.83 − 2.5 × log10(1) = +4.83. Color: Yellow.
Result: G2V | Main Sequence (Dwarf) | Abs mag: +4.83 | Color: Yellow
Try this example →

Example 2 - Red Supergiant

T = 3,500 K, L = 100,000 L☉ (Betelgeuse-type)

1
T = 3,500 K falls in the M range (2,000 to 3,700 K). Subtype = round(9 × (1 − (3500−2000)/(3700−2000))) = round(1.06) = 1 → M1.
2
log10(100,000) = 5.0 ≥ 5.0 → Luminosity class Ia (Bright Supergiant).
3
Absolute magnitude: M = 4.83 − 2.5 × 5.0 = −7.67. Color: Red.
Result: M1Ia | Bright Supergiant | Abs mag: −7.67 | Color: Red
Try this example →

Example 3 - Sirius A (Hot Main-Sequence Star)

T = 9,940 K, L = 25.4 L☉ (Sirius A)

1
T = 9,940 K falls in the A range (7,500 to 10,000 K). Subtype = round(9 × (1 − (9940−7500)/(10000−7500))) = round(0.22) = 0 → A0.
2
log10(25.4) = 1.40. T = 9,940 K does not satisfy the subgiant condition (T must be below 8,000 K) or the giant condition (T must be below 12,000 K with logL ≥ 1.5; 1.40 does not meet the 1.5 threshold). Default: V (Main Sequence). Region: Upper main sequence (T ≥ 6,000 K).
3
Absolute magnitude: M = 4.83 − 2.5 × log10(25.4) = 4.83 − 3.51 = +1.32. Color: White.
Result: A0V | Main Sequence (Dwarf) | Abs mag: +1.32 | Color: White
Try this example →

❓ Frequently Asked Questions

What is the Hertzsprung-Russell diagram and what does it show?+
The H-R diagram is a scatter plot of stellar luminosity versus surface temperature. Luminosity increases upward; temperature increases to the left (an astronomical convention). Stars cluster in distinct regions: the diagonal main sequence (hydrogen-burning dwarfs), the giant branch (upper right), the supergiant zone (top), and the white dwarf sequence (lower left). The diagram reveals a star's evolutionary state, size, mass, and age from two measurable quantities.
What do the spectral types O B A F G K M mean?+
The spectral sequence orders stars by photospheric temperature: O above 30,000 K (blue-violet), B 10,000 to 30,000 K (blue-white), A 7,500 to 10,000 K (white), F 6,000 to 7,500 K (yellow-white), G 5,200 to 6,000 K (yellow), K 3,700 to 5,200 K (orange), M below 3,700 K (red). The sequence originally classified stars alphabetically by hydrogen line strength; the modern temperature ordering scrambles the letters.
What are luminosity classes in the Morgan-Keenan system?+
Luminosity classes use Roman numerals to indicate evolutionary state: Ia (bright supergiants, L above 100,000 L☉), Ib (supergiants, 10,000 to 100,000 L☉), II (bright giants), III (giants, 10 to 1,000 L☉), IV (subgiants), V (main-sequence dwarfs). White dwarfs are labeled D. Two stars with the same spectral letter can differ enormously in size if they have different luminosity classes.
What spectral type is the Sun?+
The Sun is G2V. G indicates a yellow photosphere at 5,200 to 6,000 K (the Sun's effective temperature is 5,778 K). The numeral 2 places it near the hotter end of the G range. V confirms it is a main-sequence hydrogen-burning dwarf. Its absolute magnitude is +4.83 and its luminosity is by definition 1 L☉ = 3.828 × 1026 W.
How does this classifier determine the luminosity class?+
The classifier uses log10 of the luminosity and the temperature together. Stars with logL above 5 are bright supergiants (Ia). LogL 4 to 5 are supergiants (Ib). LogL 3 to 4 below 25,000 K are bright giants (II). LogL 1.5 to 3 below 12,000 K are giants (III). LogL 0.5 to 1.5 between 5,000 and 8,000 K are subgiants (IV). Hot stars with logL below -1 are white dwarfs (D). All others are main-sequence (V).
What is the difference between a giant and a supergiant?+
Giants (class III) are evolved stars that have left the main sequence as core hydrogen is depleted. They are typically 10 to 100 solar radii and 10 to 1,000 L☉. Supergiants (Ia and Ib) are the most massive and luminous stars, often 100 to 1,500 solar radii and 10,000 to 1,000,000 L☉. Betelgeuse (M1Iab) is roughly 700 solar radii, large enough that if placed at the center of our solar system it would engulf Mars.
What is absolute magnitude and how is it related to luminosity?+
Absolute magnitude M is the apparent magnitude a star would have at 10 parsecs. It is related to luminosity by M = 4.83 − 2.5 log10(L/L☉). A decrease of 5 in M corresponds to 100 times more luminosity. The Sun at M = +4.83 is middling. Eta Carinae at M ≈ -7 is about 4 million times more luminous. Faint red dwarfs at M ≈ +16 are 10,000 times less luminous than the Sun.
Can this classifier identify white dwarf stars?+
Yes. White dwarfs are identified by high temperature (above 5,000 K) combined with very low luminosity (log L below -1, meaning less than 0.1 L☉). A typical young white dwarf at 25,000 K and 0.007 L☉ is classified as D. White dwarfs are Earth-sized remnant cores supported by electron degeneracy pressure, slowly cooling over billions of years after shedding the envelope as a planetary nebula.
What is a subgiant star?+
Subgiants (class IV) are stars slightly above the main sequence that are beginning to exhaust their core hydrogen and expanding toward the giant branch. They are 1.5 to 4 times more luminous than main-sequence stars of the same spectral type. Eta Boötis (G0IV) is a classic example. The Sun will become a subgiant in about 5 billion years, brightening and expanding slowly before the rapid red giant phase begins.
Why does the H-R diagram have a diagonal main sequence?+
On the main sequence, more massive stars maintain higher core temperatures and pressures, fusing hydrogen at far greater rates and generating much more luminosity. They also have hotter photospheres. This creates the diagonal: upper-left stars are hot, blue, massive, and luminous; lower-right stars are cool, red, less massive, and dim. The main sequence is fundamentally a mass sequence for hydrogen-burning stars, spanning from 0.08 M☉ (bottom of M) to over 100 M☉ (top of O).
What is the Morgan-Keenan (MK) luminosity classification system?+
The MK system, developed by William Morgan and Philip Keenan at Yerkes Observatory in 1943, classifies stellar spectra by spectral type (letter O through M plus a numeral 0-9 for temperature) and luminosity class (Roman numerals Ia through V and D for white dwarfs). A designation like G2V fully specifies a star's position on the H-R diagram from purely spectroscopic data, without needing a distance measurement. This makes MK classification one of the most powerful observational tools in stellar astronomy.
How do astronomers use the H-R diagram in stellar evolution studies?+
Astronomers plot all stars in a cluster on a single H-R diagram. Because all cluster stars formed at the same time and distance, the diagram reveals the cluster's age: the main-sequence turnoff point (where stars are leaving for the giant branch) directly gives the age, because more massive stars evolve off the main sequence first. Young clusters have turnoffs at the hot O/B end; old clusters like globular clusters have turnoffs near the F/G boundary. This method gives ages from a few million to over 10 billion years.

What is the Hertzsprung-Russell diagram and what does it show?

The Hertzsprung-Russell (H-R) diagram is a scatter plot of stellar luminosity versus surface temperature, with luminosity increasing upward and temperature increasing left to right. Stars cluster in distinct regions: the diagonal main sequence, the giant branch, the supergiant region at the top, and the white dwarf sequence at the lower left. The diagram reveals a star's evolutionary state, size, and internal physics from just two observable quantities.

What do the spectral types O B A F G K M mean?

The Morgan-Keenan spectral sequence (OBAFGKM) orders stars by surface temperature from hottest to coolest. O-type stars exceed 30,000 K and appear blue-violet. B-type are blue-white (10,000-30,000 K). A-type are white (7,500-10,000 K). F-type are yellow-white (6,000-7,500 K). G-type, including the Sun, are yellow (5,200-6,000 K). K-type are orange (3,700-5,200 K). M-type red dwarfs and giants are below 3,700 K.

What are luminosity classes in the Morgan-Keenan system?

Luminosity classes refine spectral classification by indicating the size and evolutionary state of a star: Ia (bright supergiants, logL above 5), Ib (supergiants, logL 4-5), II (bright giants), III (giants), IV (subgiants), V (main sequence dwarfs), and D or VII (white dwarfs). Two stars with identical spectral type can differ enormously in radius and luminosity if they have different luminosity classes.

What spectral type is the Sun?

The Sun is classified as G2V. The G indicates a yellow star with surface temperature 5,200-6,000 K (the Sun is 5,778 K). The numeral 2 places it near the hotter end of the G range (0 = hottest, 9 = coolest within the type). The V indicates it is a main-sequence dwarf, fusing hydrogen in its core. Its absolute magnitude is +4.83 and its luminosity is by definition 1 L☉.

How does this classifier determine the luminosity class?

The classifier uses the logarithm of luminosity and surface temperature together to place the star in one of the standard H-R diagram regions. Stars with logL above 5 are bright supergiants (Ia), logL 4-5 are supergiants (Ib), logL 3-4 below 25,000 K are bright giants (II), logL 1.5-3 below 12,000 K are giants (III), logL 0.5-1.5 in the 5,000-8,000 K range are subgiants (IV), and very hot low-luminosity stars are classified as white dwarfs.

What is the difference between a giant and a supergiant star?

Giants (luminosity class III) are stars that have left the main sequence and expanded as hydrogen in the core is depleted. They are typically 10-100 times the solar radius and 10-1000 times the solar luminosity. Supergiants (Ia and Ib) are the most luminous and massive stars, often 100-1500 times the solar radius and 10,000 to over 1,000,000 times the solar luminosity. Betelgeuse is a famous M-type supergiant with roughly 700 solar radii.

What is absolute magnitude and how is it related to luminosity?

Absolute magnitude M is the apparent magnitude a star would have at a standard distance of 10 parsecs (32.6 light-years). It is related to luminosity by M = 4.83 - 2.5 log10(L/L☉), where 4.83 is the Sun's absolute magnitude. A decrease of 1 in M corresponds to a factor of 2.512 increase in luminosity. The most luminous stars have very negative M (Eta Carinae is about -7), while faint red dwarfs can reach M = +16.

Can this classifier identify white dwarf stars?

Yes. White dwarfs are identified by a combination of high surface temperature (above 5,000 K) and very low luminosity (logL below -1). A typical young white dwarf at 25,000 K and 0.007 L☉ is classified as D (white dwarf). They are the compact remnants of stars that have shed their outer envelopes and are slowly cooling over billions of years. Their small radius (roughly Earth-sized) causes the low luminosity despite the high temperature.

What is a subgiant star?

Subgiants (luminosity class IV) are stars slightly above the main sequence that have begun to exhaust their core hydrogen and are expanding toward the giant branch. They are 1.5-4 times more luminous than main-sequence stars of the same spectral type. The Sun will become a subgiant in about 5 billion years before expanding into a red giant. Subgiants occupy a narrow band between the main sequence (V) and the giant branch (III) on the H-R diagram.

Why does the H-R diagram have a diagonal main sequence?

On the main sequence, more massive stars have higher core pressures and temperatures, burning hydrogen faster and generating more luminosity. They also have hotter photospheres. This creates a diagonal band: more massive (hotter, bluer) stars are in the upper-left, and less massive (cooler, redder) stars are in the lower-right. The main sequence is essentially a mass sequence for hydrogen-burning stars, spanning from 0.08 solar masses (bottom of M type) to over 100 solar masses (top of O type).

What is the Morgan-Keenan (MK) luminosity classification system?

The MK system, developed by William Morgan and Philip Keenan at Yerkes Observatory in 1943, classifies stellar spectra by two parameters: spectral type (temperature, indicated by a letter O through M and a numeral 0-9) and luminosity class (evolutionary state, indicated by Roman numerals I through V and D for white dwarfs). A full MK designation like G2V completely describes a star's position on the H-R diagram using only spectroscopic data, without requiring a distance measurement.

How do astronomers use the H-R diagram in practice?

Astronomers use H-R diagrams of star clusters to determine cluster ages: the point where stars leave the main sequence (the turnoff point) gives the age because more massive stars evolve off the main sequence first. Individual star spectra are compared against standard MK templates to assign types. The MK class then predicts the absolute magnitude (luminosity), which combined with apparent magnitude gives the distance via the distance modulus: d = 10^((m-M+5)/5) parsecs.