Skip to content
Astronomy & Space Simple #spectral-class#obafgkm

Stellar Spectral Classes (OBAFGKM)

O hottest, M coolest. Color, temperature, mass, lifetime all correlate.

A free, animated stellar spectral classes (obafgkm) you can read here or embed on any website, from Scrollchart.

Stellar Spectral Classes (OBAFGKM)

Stellar Spectral Classes (OBAFGKM)Temperature spans 10x from O to M; lifetime spans a billion-fold3k5k8k15k30kSurface Temperature (K, log)O~20 M☉3 MyrB~5 M☉100 MyrA~2 M☉1 GyrF~1.3 M☉3 GyrG~1 M☉10 GyrK~0.7 M☉50 GyrM~0.3 M☉>1 Tyr35 000 K20 000 K8 750 K6 750 K5 500 K4 000 K3 000 KO: hottest, rarest, shortest-lived. M: coolest, most common, near-eternal. Sun is a middle-of-the-road G dwarf.

Bar chart of seven classes with temperature, mass, color, and lifetime annotated. Sun is G2 in the middle. M-class dominates by count; O-class is rarest.

Good for

  • Stellar classification explainer articles
  • Introductory astronomy courses
  • Science journalism on star diversity

Source & accuracy

This stellar spectral classes (obafgkm) is an editorial illustration built to represent the concept accurately. Where it shows figures, they are typical or representative values chosen to make the relationship clear, not a single underlying dataset. The diagram and its explainer are reviewed and maintained centrally, and updated over time as understanding improves.

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.

Embed this diagram

Add this animated stellar spectral classes (obafgkm) to your own site. Copy one line of HTML, or use the embed builder for theme and sizing options.

Reference

What this is
A free, embeddable, animated stellar spectral classes (obafgkm) for any website.
Who uses it
Astronomy enthusiasts.
How to embed
Copy one line of HTML. No signup. No watermark. Works in WordPress, Webflow, Ghost, Substack, plain HTML.
File size
iframe embed, ~80 KB gzipped (loads on demand, does not block your page paint).
License
Free forever. Editorial explainer text included; updated centrally over time.

Embed format options

Copy the universal HTML snippet, the WordPress shortcode, or an iframe fallback - see the WordPress plugin page for details. Any format keeps the same Core Web Vitals profile and the same explainer text.

Embed snippet
<div data-scrollchart="spectral-classes" data-scrollchart-v="1"></div>
<script src="https://scrollchart.com/embed.js" async></script>

Frequently asked questions

Where can I get a free animated "Stellar Spectral Classes (OBAFGKM)" for my website?
Scrollchart provides "Stellar Spectral Classes (OBAFGKM)" as a free, embeddable animated diagram you can add to any website with one line of HTML. No signup is required and there is no watermark. The diagram and its explainer text are served from scrollchart.com, so the embed stays current without any maintenance on your end.
How do I embed a stellar spectral classes (obafgkm) in WordPress or a static site?
Paste the HTML snippet from the Scrollchart diagram page into your WordPress post (in HTML/code view), your Webflow embed block, or directly into a static HTML file. No plugin is needed. The diagram loads from scrollchart.com and paints in as the reader scrolls.