Stellar classification
In astronomy, stellar classification is a classification of stars based initially on photospheric temperature and its associated spectral characteristics, and subsequently refined in terms of other characteristics. Stellar temperatures can be classified by using Wien's displacement law, but this poses difficulties for distant stars. Stellar spectroscopy offers a way to classify stars according to their absorption lines; particular absorption lines can be observed only for a certain range of temperatures because only in that range are the involved atomic energy levels populated. An early scheme (from the 19th century) ranked stars from A to Q, which is the origin of the currently used spectral classes.

# Secchi classes
During the 1860s and 1870s, pioneering stellar spectroscopist Father Angelo Secchi created the Secchi classes in order to classify observed spectra.  By 1868, he had developed four classes of stars:
- Class I: white and blue stars with broad heavy hydrogen lines (modern class A)
- Class II: yellow starshydrogen less strong, but evident metallic lines (modern classes G and K)
- Class III: orange to red stars with complex band spectra (modern class M)
- Class IV: red stars with significant carbon bands and lines (carbon stars)
In 1878, he added a fifth class:
- Class V: emission lines (e.g., Be, Bf, etc.)
In the late 1890s, this classification was superseded by the Harvard classification, which is discussed in the remainder of this article.

# Harvard spectral classification
Harvard one-dimensional (temperature) classification scheme (based on hydrogen Balmer line strengths) was developed at Harvard College Observatory in about 1912 by Annie Jump Cannon and Edward C. Pickering. The common classes are normally listed from hottest to coldest (with mass, radius and luminosity compared to the Sun) and are given in the following table.
The mass, radius, and luminosity listed for each class are appropriate only for stars on the main sequence portion of their lives and so are not appropriate for red giants. A popular mnemonic for remembering the order is "Oh Be A Fine Girl/Guy, Kiss Me" (there are many variants of this mnemonic). The Hertzsprung-Russell diagram relates stellar classification with absolute magnitude, luminosity, and surface temperature.
The reason for the odd arrangement of letters is historical. When people first started taking spectra of stars, they noticed that stars had very different hydrogen spectral lines strengths, and so they classified stars based on the strength of the hydrogen Balmer series lines from A (strongest) to Q (weakest). Other lines of neutral and ionized species then came into play (H and K lines of calcium, sodium D lines, etc). Later it was found that some of the classes were actually duplicates and those classes were removed. It was only much later that it was discovered that the strength of the hydrogen line was connected with the surface temperature of the star. The basic work was done by the "girls" of Harvard College Observatory, primarily Annie Jump Cannon, Henrietta Swan Leavitt and Antonia Maury, based on the work of Williamina Fleming. In the 1920s, the Indian physicist Megh Nad Saha derived a theory of ionization by extending well-known ideas in physical chemistry pertaining to the dissociation of molecules to the ionization of atoms. First applied to the solar chromosphere, he then applied it to stellar spectra. The Harvard astronomer Cecilia Helena Payne (later to become Cecilia Payne-Gaposchkin) then demonstrated that the OBAFGKM spectral sequence is actually a sequence in temperature.
Spectral classes are further subdivided by Arabic numerals (09). For example, A0 denotes the hottest stars in the A class and A9 denotes the coolest ones. Because the classification sequence predates our understanding that it is a temperature sequence, the precise values of these digits depend upon (largely subjective) estimates of the strengths of absorption features in stellar spectra. As a result, the subclasses are not evenly divided into any sort of mathematically representable intervals. The Sun is classified as G2.
O, B, and A stars are sometimes misleadingly called "early type", while K and M stars are said to be "late type". This stems from a early 20th century model of stellar evaluation in which stars were powered by gravitational contraction via the KelvinHelmholtz mechanism in which stars start their lives as very hot "early type" stars, and then gradually cool down, thereby evolving into "late type" stars.  This mechanism provided ages of the sun that were much smaller than what is observed, and was rendered obsolete by the discovery that stars are powered by nuclear fusion.  However, brown dwarfs, whose energy comes from gravitational attraction alone, cool as they age and so progress to later spectral types. The highest mass brown dwarfs start their lives with M-type spectra and will cool through the L, T, and Y spectral classes.

## Conventional and apparent colors
The Conventional color descriptions are traditional in astronomy, and represent colors relative to Vega, a star that is perceived as white under naked eye observational conditions, but which magnified appears as blue. The Apparent color descriptions is what the observer would see if trying to describe the stars under a dark sky without aid to the eye, or with binoculars. The table colors used, are D65 standard colors, which are what you would see if the star light would be  magnified to be filling non-dazzlingly bright areas.  Most stars in the sky, except the brightest ones, appear white or bluish white to the unaided eye because they are too dim for color vision to work.
Our Sun itself is white. It is sometimes called a yellow star (spectroscopically, relative to Vega), and may appear yellow or red (viewed through the atmosphere), or appear white (viewed when too bright for the eye to see any color). Astronomy images often use a variety of exaggerated colors (partially founded in faint light conditions observations, partially in conventions). But the Sun's own intrinsic color is white (aside from sunspots), with no trace of color, and closely approximates a black body of 5780 K (see color temperature). This is a natural consequence of the evolution of our optical senses: the response curve that maximizes the overall efficiency against solar illumination will by definition perceive the Sun as white. The sun is known as a G type star.

# Yerkes spectral classification
The Yerkes spectral classification, also called the MKK system from the authors' initials, is a system of stellar spectral classification introduced in 1943 by William Wilson Morgan, Phillip C. Keenan and Edith Kellman from Yerkes Observatory.
This classification is based on spectral lines sensitive to stellar surface gravity which is related to luminosity, as opposed to the Harvard classification which is based on surface temperature.
Later, in 1953, after some revisions of list of standard stars and classification criteria, the scheme was named MK (by William Wilson Morgan and Phillip C. Keenan initials).
Since the radius of a giant star is much larger than a dwarf star while their masses are roughly comparable, the gravity and thus the gas density and pressure on the surface of a giant star are much lower than for a dwarf.
These differences manifest themselves in the form of luminosity effects which affect both the width and the intensity of spectral lines which can then be measured.  Denser stars with higher surface gravity will exhibit greater pressure broadening of spectral lines.
A number of different luminosity classes are distinguished:
- I supergiants
Ia-0 (hypergiants or extremely luminous supergiants (later addition), Example: Eta Carinae (spectrum-peculiar)
Ia (luminous supergiants), Example: Deneb (spectrum is A2Ia)
Iab (intermediate luminous supergiants)
Ib (less luminous supergiants), Example: Betelgeuse (spectrum is M2Ib)
- Ia-0 (hypergiants or extremely luminous supergiants (later addition), Example: Eta Carinae (spectrum-peculiar)
- Ia (luminous supergiants), Example: Deneb (spectrum is A2Ia)
- Iab (intermediate luminous supergiants)
- Ib (less luminous supergiants), Example: Betelgeuse (spectrum is M2Ib)
- II bright giants
IIa, Example:  Scuti (HD 173764) (spectrum is G4 IIa)
IIab Example: HR 8752 (spectrum is G0Iab:)
IIb, Example: HR 6902 (spectrum is G9 IIb)
- IIa, Example:  Scuti (HD 173764) (spectrum is G4 IIa)
- IIab Example: HR 8752 (spectrum is G0Iab:)
- IIb, Example: HR 6902 (spectrum is G9 IIb)
- III normal giants
IIIa, Example:  Persei (spectrum is M4 IIIa)
IIIab Example:  Reticuli (spectrum is M2 IIIab)
IIIb, Example: Pollux (spectrum is K2 IIIb)
- IIIa, Example:  Persei (spectrum is M4 IIIa)
- IIIab Example:  Reticuli (spectrum is M2 IIIab)
- IIIb, Example: Pollux (spectrum is K2 IIIb)
- IV subgiants
IVa, Example:  Reticuli (spectrum is K1-2 IVa-III)
IVb, Example: HR 672 A (spectrum is G0.5 IVb)
- IVa, Example:  Reticuli (spectrum is K1-2 IVa-III)
- IVb, Example: HR 672 A (spectrum is G0.5 IVb)
- V main sequence stars (dwarfs)
Va, Example: AD Leonis (spectrum M4Vae)
Vb, Example: 85 Pegasi A (spectrum G5 Vb)
- Va, Example: AD Leonis (spectrum M4Vae)
- Vb, Example: 85 Pegasi A (spectrum G5 Vb)
- VI subdwarfs (rarely used)
- VII white dwarfs (rarely used)
Marginal cases are allowed; for instance a star classified as Ia0-Ia would be a very luminous supergiant, verging on hypergiant.  Examples are below.  The spectral type of the star are not a factor.

# Spectral types
The following illustration represents star classes with the colors very close to those actually perceived by the human eye.  The relative sizes are for main sequence or "dwarf" stars.

## Class O
Class O stars are very hot and very luminous, being bluish in color; in fact, most of their output is in the ultraviolet range. These are the rarest of all main sequence stars, constituting as few as 1 in 3,000,000 in the solar neighborhood (Note: these proportions are fractions of stars brighter than absolute magnitude 16; lowering this limit will render earlier types even rarer while generally adding only to the M class). O-stars shine with a power over a million times our Sun's output. These stars have dominant lines of absorption and sometimes emission for He II lines, prominent ionized (Si IV, O III, N III, and C III) and neutral helium lines, strengthening from O5 to O9, and prominent hydrogen Balmer lines, although not as strong as in later types. Because they are so huge, class O stars burn through their hydrogen fuel very quickly, and are the first stars to leave the main sequence. Recent observations by the Spitzer Space Telescope indicate that planetary formation does not occur around other stars in the vicinity of an O class star due to the photoevaporation effect.

## Class B
Class B stars are extremely luminous and blue. Their spectra have neutral helium, which are most prominent at the B2 subclass, and moderate hydrogen lines. Ionized metal lines include Mg II and Si II. As O and B stars are so powerful, they only live for a very short time, and thus they do not stray far from the area in which they were formed. These stars tend to cluster together in what are called OB associations, which are associated with giant molecular clouds. The Orion OB1 association occupies a large portion of a spiral arm of our galaxy and contains many of the brighter stars of the constellation Orion. They constitute about 1 in 800 main sequence stars in the solar neighborhood rare, but much more common than those of class O.

## Class A
Class A stars are amongst the more common naked eye stars, and are white or bluish-white. They have strong hydrogen lines, at a maximum by A0, and also lines of ionized metals (Fe II, Mg II, Si II) at a maximum at A5. The presence of Ca II lines is notably strengthening by this point. They comprise about 1 in 160 of the main sequence stars in the solar neighborhood.

## Class F
Class F stars have strengthening H and K lines of Ca II. Neutral metals (Fe I, Cr I) beginning to gain on ionized metal lines by late F. Their spectra are characterized by the weaker hydrogen lines and ionized metals. Their color is white with a slight tinge of yellow. These represent about 1 in 33 of the main sequence stars in the solar neighborhood.

## Class G
Class G stars are probably the best known, if only for the reason that our Sun is of this class. Most notable are the H and K lines of Ca II, which are most prominent at G2. They have even weaker hydrogen lines than F, but along with the ionized metals, they have neutral metals. There is a prominent spike in the G band of CH molecules. G is host to the "Yellow Evolutionary Void". Supergiant stars often swing between O or B (blue) and K or M (red). While they do this, they do not stay for long in the G classification as this is an extremely unstable place for a supergiant to be. G stars represent about 1 in 13 of the main sequence stars in the solar neighborhood.

## Class K
Class K are orangish stars which are slightly cooler than our Sun. Some K stars are giants and supergiants, such as Arcturus, while others, like Alpha Centauri B, are main sequence stars. They have extremely weak hydrogen lines, if they are present at all, and mostly neutral metals (Mn I, Fe I, Si I). By late K, molecular bands of titanium oxide become present. These make up 1 in 8 of the main sequence stars in the solar neighborhood.

## Class M
Class M is by far the most common class. About 76% of the main sequence stars in the solar neighborhood are red dwarfs (78.6% if we include all stars: see the note under Class O), such as Proxima Centauri. M is also host to most giants and some supergiants such as Antares and Betelgeuse, as well as Mira variables. The late-M group holds hotter brown dwarfs that are above the L spectrum. This is usually in the range of M6.5 to M9.5. The spectrum of an M star shows lines belonging to molecules and all neutral metals but hydrogen lines are usually absent. Titanium oxide can be strong in M stars, usually dominating by about M5. Vanadium oxide bands become present by late M.

# Extended spectral types
A number of new spectral types have been taken into use from newly discovered types of stars.

## Hot blue emission star classes
Spectra of some very hot and bluish stars exhibit marked emission lines from carbon or nitrogen, or sometimes oxygen.

### Class W: Wolf-Rayet
Class W or WR represents the superluminous Wolf-Rayet stars, notably unusual since they have mostly helium in their atmospheres instead of hydrogen. They are thought to be dying supergiants with their hydrogen layer blown away by hot stellar winds caused by their high temperatures, thereby directly exposing their hot helium shell. Class W is subdivided into subclasses WC (WCE early-type, WCL late-type), WN (WNE early-type, WNL late-type), and WO according to the dominance of carbon, nitrogen, or oxygen emission in their spectra (and outer layers).
- W:  Up to 70,000 K

### Classes OC, ON, BC, BN: Wolf-Rayet related O and B stars
Intermediary between the genuine Wolf-Rayet's and ordinary hot stars of classes O and early B, there are OC, ON, BC and BN stars. They seem to constitute a short continuum from the Wolf-Rayet's into the ordinary OB:s.

### The "class" OB
In lists of spectra, the "spectrum OB" may occur. This is in fact not a spectrum, but a marker which means that "the spectrum of this star is unknown, but it belongs to an OB association, so probably either a class O or class B star, or perhaps a fairly hot class A star."

## Cool red and brown dwarf classes
The novel spectral types L and T were created to classify infrared spectra of cool stars and brown dwarfs which were very faint in the visual spectrum.  The hypothetical spectral type Y has been reserved for objects cooler than T dwarfs having spectra which are qualitatively distinct from T dwarfs.

### Class L
Class L dwarfs get their designation because they are cooler than M stars and L is the remaining letter alphabetically closest to M. L does not mean lithium dwarf; a large fraction of these stars do not have lithium in their spectra. Some of these objects have mass large enough to support hydrogen fusion, but some are of substellar mass and do not, so collectively these objects should be referred to as L dwarfs, not L stars.  They are a very dark red in color and brightest in infrared.  Their atmosphere is cool enough to allow metal hydrides and alkali metals to be prominent in their spectra.  Due to low gravities in giant stars, TiO- and VO-bearing condensates never form.  Thus, larger L-type stars can never form in an isolated environment. It may be possible for these L-type supergiants to form through stellar collisions, however, an example of which is V838 Monocerotis.
- L: 1,3002,000 K, dwarfs (some stellar, some substellar) with metal hydrides and alkali metals prominent in their spectra.

### Class T: methane dwarfs
Class T dwarfs are cool brown dwarfs with surface temperatures of between ~1500 and 700K.  Their emission peaks in the infrared. Methane is prominent in their spectra.
- T: ~700-1,000 K, cooler brown dwarfs with methane in the spectrum
Class T and L could be more common than all the other classes combined, if recent research is accurate. From studying the number of proplyds (protoplanetary discs, clumps of gas in nebulae from which stars and solar systems are formed) then the number of stars in the galaxy should be several orders of magnitude higher than what we know about. It is theorized that these proplyds are in a race with each other. The first one to form will become a proto-star, which are very violent objects and will disrupt other proplyds in the vicinity, stripping them of their gas. The victim proplyds will then probably go on to become main sequence stars or brown dwarf stars of the L and T classes, but quite invisible to us. Since they live so long, these smaller stars will accumulate over time.

### Class Y
Class Y dwarfs are expected to be much cooler than T-dwarfs. They have been modelled, though there is no well-defined spectral sequence yet with prototypes. In March 2008, a 620 kelvin brown dwarf named CFBDS J005910.90-011401.3 was discovered, displaying wide ammonia absorption in the near-infrared. It is believed to be the first prototype of a Y0 dwarf. 
- Y: < 700 K, ultra-cool brown dwarfs (theoretical)

## Carbon related late giant star classes
Carbon related stars are stars whose spectra indicate production of carbon by helium triple-alpha fusion. With increased carbon abundance, and some parallel s-process heavy element production, the spectra of these stars are becoming increasingly deviant from the usual late spectral classes G, K and M. The giants among those stars are presumed to produce this carbon themselves, but not too few of this class of stars are believed to be double stars whose odd atmosphere once was transferred from a former carbon star companion that is now a white dwarf.

### Class C: carbon stars
Originally classified as R and N stars, these are also known as 'carbon stars'.  These are red giants, near the end of their lives, in which there is an excess of carbon in the atmosphere. The old R and N classes ran parallel to the normal classification system from roughly mid G to late M. These have more recently been remapped into a unified carbon classifier C, with N0 starting at roughly C6. Another subset of cool carbon stars are the J-type stars, which are characterized by the strong presence of molecules of 13CN in addition to those of 12CN. A few dwarf (that is, main sequence) carbon stars are known, but the overwhelming majority of known carbon stars are giants or supergiants.
- C: Carbon stars, e.g. R CMi
C-R: Formerly a class on its own representing the carbon star equivalent of late G to early K stars. Example: S Camelopardalis
C-N: Formerly a class on its own representing the carbon star equivalent of late K to M stars. Example: R Leporis
C-J: A subtype of cool C stars with a high content of 13C. Example: Y Canum Venaticorum
C-H: Population II analogues of the C-R stars. Examples: V Ari, TT CVn
C-Hd: Hydrogen-Deficient Carbon Stars, similar to late G supergiants with CH and C2 bands added. Example: HD 137613
- C-R: Formerly a class on its own representing the carbon star equivalent of late G to early K stars. Example: S Camelopardalis
- C-N: Formerly a class on its own representing the carbon star equivalent of late K to M stars. Example: R Leporis
- C-J: A subtype of cool C stars with a high content of 13C. Example: Y Canum Venaticorum
- C-H: Population II analogues of the C-R stars. Examples: V Ari, TT CVn
- C-Hd: Hydrogen-Deficient Carbon Stars, similar to late G supergiants with CH and C2 bands added. Example: HD 137613

### Class S
Class S stars have zirconium oxide lines in addition to (or, rarely, instead of) those of titanium oxide, and are in between the Class M stars and the carbon stars.  S stars have excess amounts of zirconium and other elements produced by the s-process, and have their carbon and oxygen abundances closer to equal than is the case for M stars. The latter condition results in both carbon and oxygen being locked up almost entirely in carbon monoxide molecules. For stars cool enough for carbon monoxide to form that molecule tends to "eat up" all of whichever element is less abundant, resulting in "leftover oxygen" (which becomes available to form titanium oxide) in stars of normal composition, "leftover carbon" (which becomes available to form the diatomic carbon molecules) in carbon stars, and "leftover nothing" in the S stars.  The relation between these stars and the ordinary M stars indicates a continuum of carbon abundance. Like carbon stars, nearly all known S stars are giants or supergiants.

### Classes MS and SC: intermediary carbon related classes
In between the M class and the S class, border cases are named MS stars. In a similar way border cases between the S class and the C-N class are named SC or CS. The sequence M  MS  S  SC  C-N is believed to be a sequence of increased carbon abundance with age for carbon stars in the asymptotic giant branch.

## White dwarf classifications
The class D is the modern classification used for white dwarfs, low-mass stars that are no longer undergoing nuclear fusion and have shrunk to planetary size, slowly cooling down. Class D is further divided into spectral types DA, DB, DC, DO, DQ, DX, and DZ.  The letters are not related to the letters used in the classification of other stars, but instead indicate the composition of the white dwarf's visible outer layer or atmosphere.
The white dwarf types are as follows:
- DA: a hydrogen-rich atmosphere or outer layer, indicated by strong Balmer hydrogen spectral lines.
- DB: a helium-rich atmosphere, indicated by neutral helium, He I, spectral lines.
- DO: a helium-rich atmosphere, indicated by ionized helium, He II, spectral lines.
- DQ: a carbon-rich atmosphere, indicated by atomic or molecular carbon lines.
- DZ: a metal-rich atmosphere, indicated by metal spectral lines.
- DC: no strong spectral lines indicating one of the above categories.
- DX: spectral lines are insufficiently clear to classify into one of the above categories.
The type is followed by a number giving the white dwarf's surface temperature.  This number is a rounded form of 50400/Teff, where Teff is the effective surface temperature, measured in kelvins.  Originally, this number was rounded to one of the digits 1 through 9, but more recently fractional values have started to be used, as well as values below 1 and above 9.
Two or more of the type letters may be used to indicate a white dwarf which displays more than one of the spectral features above.  Also, the letter V is used to indicate a variable white dwarf.
Extended white dwarf spectral types:
- DAB: a hydrogen- and helium-rich white dwarf displaying neutral helium lines.
- DAO: a hydrogen- and helium-rich white dwarf displaying ionized helium lines.
- DAZ: a hydrogen-rich metallic white dwarf.
- DBZ: a helium-rich metallic white dwarf.
Variable star designations:
- DAV or ZZ Ceti: a hydrogen-rich pulsating white dwarf., pp. 891, 895
- DBV or V777 Her: a helium-rich pulsating white dwarf., p. 3525
- GW Vir, DOV or PNNV: a hot helium-rich pulsating white dwarf (or pre-white dwarf.), 1.1, 1.2;

## Non-stellar spectral types: Class P & Q
Finally, the classes P and Q are occasionally used for certain non-stellar objects. Type P objects are planetary nebulae and type Q objects are novae.

# Spectral peculiarities
Additional nomenclature, in the form of lower-case letters, can follow the spectral type to indicate peculiar features of the spectrum.
For example, Epsilon Ursae Majoris is listed as spectral type A0pCr, indicating general classification A0 with a strong emission lines of the element chromium.  There are several common classes of chemically peculiar stars, where the spectral lines of a number of elements appear abnormally strong.

# Photometric classification
Stars can also be classified using photometric data from any photometric system. For example, we can calibrate color index diagrams of UB and BV in the UBV system according to spectral and luminosity classes. Nevertheless, this calibration is not straightforward, because many effects are superimposed in such diagrams: interstellar reddening, color changes due to metallicity, and the blending of light from binary and multiple stars.
Photometric systems with more colors and narrower passbands allow a star's class, and hence physical parameters, to be determined more precisely.  The most accurate determination comes of course from spectral measurements, but there is not always enough time to get qualitative spectra with high signal-to-noise ratio.