Roboculator
Online CalculatorsCategoriesDate & EventsNews
Get Started
Online CalculatorsCategoriesDate & EventsNewsGet Started
Roboculator

Smart calculators for every challenge. Free, fast, and private.

Categories

  • Finance
  • Health
  • Math
  • Construction
  • Conversion
  • Everyday Life

Popular Tools

  • Date & Events
  • Loan Calculator
  • BMI Calculator
  • Percentage Calc
  • Latest News
  • Search All

Resources

  • Glossary
  • Topic Tags
  • News & Insights

Company

  • About
  • Contact

Legal

  • Privacy Policy
  • Terms of Service
  • Editorial Policy
  • Disclaimer
© 2026 Roboculator. All rights reserved.
Roboculator

roboculator.com

  1. Home
  2. /Astronomy
  3. /Astronomy & Astrophysics Calculators
  4. /HR Diagram Calculator

HR Diagram Calculator

Last updated: March 18, 2026

Calculator

Results

Spectral Class Code

4

Absolute Magnitude

4.83

mag

Radius

1

R_sun

Radius

695,700,000

m

Peak Wavelength

501.5

nm

B-V Color Index Approx

0.666

mag

Main Sequence Luminosity Estimate

1

L_sun

Luminosity vs Main Sequence

1

x

Luminosity Class Code

5

Results

Spectral Class Code

4

Absolute Magnitude

4.83

mag

Radius

1

R_sun

Radius

695,700,000

m

Peak Wavelength

501.5

nm

B-V Color Index Approx

0.666

mag

Main Sequence Luminosity Estimate

1

L_sun

Luminosity vs Main Sequence

1

x

Luminosity Class Code

5

The HR Diagram Calculator places a star on the Hertzsprung-Russell diagram — the most important tool in stellar astrophysics — using its surface temperature and luminosity. Independently developed by Ejnar Hertzsprung (1911) and Henry Norris Russell (1913), the HR diagram plots stars by their luminosity (or absolute magnitude) versus temperature (or spectral class/color), revealing fundamental patterns of stellar structure and evolution.

Given a star's temperature T and luminosity L, this calculator determines its spectral class (OBAFGKM), absolute magnitude, radius (from the Stefan-Boltzmann law), peak emission wavelength, approximate B−V color index, and — critically — whether the star lies on the main sequence or is a giant/supergiant. It compares the actual luminosity with the expected main-sequence luminosity at that temperature to assign a luminosity class.

The radius is derived from the Stefan-Boltzmann law: $$R = R_\odot \sqrt{\frac{L/L_\odot}{(T/T_\odot)^4}} = R_\odot \sqrt{L/L_\odot}\;\left(\frac{T_\odot}{T}\right)^2$$ This is exact for blackbodies and provides the fundamental link between the HR diagram axes and physical stellar size. Lines of constant radius run diagonally across the HR diagram — from upper left (hot, luminous, large) to lower right (cool, faint, small).

The spectral classification system (O, B, A, F, G, K, M — from hottest to coolest) was established at Harvard Observatory in the early 1900s. Each class spans a temperature range: O stars exceed 30,000 K with strong ionized helium lines; M stars are below 3,700 K with prominent molecular bands. The Sun is a G2V star — spectral class G, subtype 2, luminosity class V (main sequence).

The luminosity class distinguishes stars of the same temperature but different sizes. A K-type main sequence star (V) has L ≈ 0.5 L☉, while a K-type giant (III) might have L ≈ 100 L☉ and a K-type supergiant (I) might exceed 10,000 L☉. The calculator estimates luminosity class by comparing actual luminosity to the main-sequence expectation at that temperature.

Astronomers use the HR diagram to determine stellar ages (isochrone fitting), identify evolutionary stages (main sequence, red giant branch, horizontal branch, asymptotic giant branch), discover unusual objects (blue stragglers, subdwarfs), and calibrate distance measurements. This calculator provides instant HR diagram classification for any observed star, making it an essential tool for stellar astrophysics education and quick-look analysis.

Visual Analysis

How It Works

The calculator derives HR diagram properties from temperature and luminosity:

Spectral Class: Assigned by temperature ranges: O (≥30,000 K), B (10,000–30,000), A (7,500–10,000), F (6,000–7,500), G (5,200–6,000), K (3,700–5,200), M (<3,700).

Absolute Magnitude:

$$M_V = 4.83 - 2.5\log_{10}(L/L_\odot)$$

Radius (Stefan-Boltzmann):

$$R/R_\odot = \sqrt{L/L_\odot} \times (5778/T)^2$$

Color Index: B−V is approximated from temperature using piecewise calibrations.

Main Sequence Check: Compares actual luminosity to expected MS luminosity at the given temperature. The ratio determines luminosity class: V (main sequence), IV (subgiant), III (giant), II (bright giant), I (supergiant).

Understanding Your Results

The spectral class tells you the star's temperature group and dominant spectral features. The absolute magnitude places it on the vertical axis of the HR diagram — the main sequence runs from M_V ≈ −6 (bright O stars) to M_V ≈ +16 (faint M dwarfs). The radius reveals physical size: main-sequence stars range from ~0.1 to ~15 R☉, while giants and supergiants can exceed 1,000 R☉. The luminosity class is the key diagnostic: if L greatly exceeds the MS expectation, the star is a giant or supergiant — evolved off the main sequence with an expanded envelope.

Worked Examples

The Sun (G2V Star)

Inputs

T5778
L1

Results

spectral class4
abs mag4.83
radius solar1
radius meters695700000
peak wavelength501.4
color index0.666
ms luminosity1
luminosity class5

The Sun at T = 5,778 K and L = 1 L☉ is classified as spectral class G (code 4), luminosity class V (main sequence), with R = 1 R☉, M_V = 4.83, and B−V ≈ 0.67 — matching its known properties precisely.

Aldebaran (K5III Giant)

Inputs

T3900
L518

Results

spectral class5
abs mag-1.97
radius solar49.9693
radius meters34750000000
peak wavelength743.1
color index1.551
ms luminosity0.1524
luminosity class1

Aldebaran at T ≈ 3,900 K and L ≈ 518 L☉ is classified as spectral class K (code 5). Its luminosity is ~3,400× the MS expectation at this temperature, confirming it is a giant star. The calculated radius of ~50 R☉ matches observations. The calculator assigns luminosity class I (supergiant threshold), though Aldebaran is officially III — the boundary is approximate.

Frequently Asked Questions

The HR diagram is a scatter plot of stars showing luminosity (or absolute magnitude) versus surface temperature (or spectral type/color). Most stars fall along the main sequence — a diagonal band from hot, luminous O-stars to cool, faint M-dwarfs. Above the main sequence lie giants and supergiants (same temperature but larger and more luminous). Below lie white dwarfs (hot but tiny and faint). The HR diagram is the fundamental tool for understanding stellar properties, classification, and evolution.

The spectral classes are a temperature sequence: O (>30,000 K, blue, ionized helium), B (10,000–30,000 K, blue-white, neutral helium), A (7,500–10,000 K, white, strong hydrogen), F (6,000–7,500 K, yellow-white, calcium), G (5,200–6,000 K, yellow, calcium/iron — the Sun), K (3,700–5,200 K, orange, metal lines), M (<3,700 K, red, molecular bands). The classic mnemonic is 'Oh Be A Fine Girl/Guy Kiss Me.' Each class is subdivided 0–9 (e.g., G2 for the Sun).

The main sequence is the band on the HR diagram where stars spend most of their lives burning hydrogen in their cores. It runs diagonally from hot, luminous, massive O-stars (upper left) to cool, faint, low-mass M-dwarfs (lower right). About 90% of all stars are on the main sequence at any given time. A star's position on the main sequence is determined primarily by its mass — more massive stars are hotter and more luminous. Stars leave the main sequence when they exhaust their core hydrogen.

Luminosity class distinguishes stars of similar temperature but different luminosities (and therefore different sizes and evolutionary stages). Class V = main sequence (dwarfs), IV = subgiants, III = giants, II = bright giants, I = supergiants (Ia, Ib for subdivision). The Sun is classified G2V — a G2 main-sequence star. Betelgeuse is M2Iab — an M2 supergiant. Luminosity class is determined spectroscopically from line widths and ratios that are sensitive to surface gravity (log g).

A star begins on the main sequence and evolves rightward and upward when core hydrogen is exhausted. A solar-mass star becomes a red giant (expanding and cooling while luminosity increases), then moves to the horizontal branch (helium burning), ascends the asymptotic giant branch, and finally sheds its envelope to become a white dwarf (lower left). Massive stars evolve faster, become red supergiants, and end as supernovae. The entire evolutionary track can be traced on the HR diagram.

B−V is the difference between a star's magnitude measured through blue (B, ~440 nm) and visual (V, ~550 nm) filters. Hot blue stars have negative B−V (e.g., −0.3 for O-stars), the Sun has B−V ≈ 0.65, and cool red stars have large positive B−V (e.g., 1.5 for M-stars). B−V correlates tightly with temperature and is the standard color measurement used as the horizontal axis in observational HR diagrams (color-magnitude diagrams).

Sources & Methodology

Carroll, B. W. & Ostlie, D. A. (2017). An Introduction to Modern Astrophysics (2nd ed.). Cambridge University Press. | Gray, D. F. (2005). The Observation and Analysis of Stellar Photospheres (3rd ed.). Cambridge University Press. | Binney, J. & Merrifield, M. (1998). Galactic Astronomy. Princeton University Press.
R

Roboculator Team

The Roboculator Team explains calculations, planning tools, and practical formulas in clear language for real-life situations.

How helpful was this calculator?

Be the first to rate!

Related Calculators

Telescope Magnification Calculator

Astronomy & Astrophysics Calculators

Planet Weight Calculator

Astronomy & Astrophysics Calculators

Star Age Calculator

Astronomy & Astrophysics Calculators

Star Mass Calculator

Astronomy & Astrophysics Calculators

Stellar Luminosity Calculator

Astronomy & Astrophysics Calculators

Hertzsprung-Russell Diagram Calculator

Astronomy & Astrophysics Calculators