thumb|upright=1.5|Infrared spectrum of [[HH 46/47 (image in inset), with vibrational bands of several molecules labelled in colour]]
This is a list of molecules that have been detected in the interstellar medium and circumstellar envelopes, grouped by the number of component atoms. The chemical formula is listed for each detected compound, along with any ionized form that has also been observed.
Background
thumb|class=skin-invert-image|right|upright=1.33|Idealised example of the rotational spectrum (bottom) produced by transitions between different rotational energy levels (top) of a simple [[linear molecule. <math>B</math> is the rotational constant of the molecule, <math>J</math> is the rotational quantum number, <math>J'</math> is the upper level and <math>J</math> is the lower level.]]
The molecules listed below were detected through astronomical spectroscopy. Their spectral features arise because molecules either absorb or emit a photon of light when they transition between two molecular energy levels. The energy (and thus the wavelength) of the photon matches the energy difference between the levels involved. Molecular electronic transitions occur when one of the molecule's electrons moves between molecular orbitals, producing a spectral line in the ultraviolet, optical or near-infrared parts of the electromagnetic spectrum. Alternatively, a vibrational transition transfers quanta of energy to (or from) vibrations of molecular bonds, producing signatures in the mid- or far-infrared. Gas-phase molecules also have quantised rotational levels, leading to transitions at microwave or radio wavelengths.
The spectrum of a particular molecule is governed by the selection rules of quantum chemistry and by its molecular symmetry. Some molecules have simple spectra which are easy to identify, whilst others (even some small molecules) have extremely complex spectra with flux spread among many different lines, making them far harder to detect. Interactions between the atomic nuclei and the electrons sometimes cause further hyperfine structure of the spectral lines. If the molecule exists in multiple isotopologues (versions containing different atomic isotopes), the spectrum is further complicated by isotope shifts.
Detection of a new interstellar or circumstellar molecule requires identifying a suitable astronomical object where it is likely to be present, then observing it with a telescope equipped with a spectrograph working at the required wavelength, spectral resolution and sensitivity. The first molecule detected in the interstellar medium was the methylidyne radical (CH<sup>•</sup>) in 1937, through its strong electronic transition at 4300 angstroms (in the optical). showing the class of molecules is very common in space, but it took until 2021 to identify any specific PAHs through their rotational lines.
|align="center"|37||align="center"|ArH<sup>+</sup>
|-
|align="center"|C<sub>2</sub>||Diatomic carbon
|align="center"|5||align="center"|HeH<sup>+</sup>
|-
|align="center"|H<sub>2</sub>||Molecular hydrogen
|align="center"|66||align="center"|—
|-
|align="center"|FeCN||Iron(I) cyanide
|-
|align="center"|l-C<sub>3</sub>H||Propynylidyne
|align="center"|52||align="center"|—
|-
|align="center"|HOOH||Hydrogen peroxide
|align="center"|34||align="center"|—
|-
|align="center"|HNCO||Isocyanic acid
|-
|align="center"|CH<sub>4</sub>||Methane
|align="center"|40||align="center"|—
|-
|align="center"|CH<sub>3</sub>NC||Methyl isocyanide
|align="center"|32||align="center"|—
|-
|align="center"|CH<sub>3</sub>SH||Methanethiol
|align="center"| ||align="center"|—
|-
|align="center"|C<sub>5</sub>H||Pentynylidyne
|align="center"|53||align="center"|—
|-
|align="center"|H<sub>2</sub>CHCOH||Vinyl alcohol
|align="center"|61||align="center"|—
|-
|align="center"|11||align="center"|HC<sub>8</sub>CN||Cyanotetraacetylene
|align="center"|69||align="center"|—
|-
|align="center"|13||align="center"|CH<sub>3</sub>OCH<sub>2</sub>CH<sub>2</sub>OH||2-methoxyethanol
|-
|align="center"|5||NH<sub>3</sub>D<sup>+</sup>||Ammonium ion
</references>
