At slightly elevated temperatures, the halogens bromine (Br2) and iodine (I2) also form diatomic gases.[3] All halogens have been observed as diatomic molecules, except for astatine, which is uncertain.

Other elements form diatomic molecules when evaporated, but these diatomic species repolymerize when cooled. Heating ("cracking") elemental phosphorus gives diphosphorus, P2. Sulfur vapor is mostly disulfur (S2). Dilithium (Li2) is known in the gas phase. Ditungsten (W2) and dimolybdenum (Mo2) form with sextuple bonds in the gas phase. The bond in a homonuclear diatomic molecule is non-polar.

Many 1:1 binary compounds are not normally considered diatomic because they are polymeric at room temperature, but they form diatomic molecules when evaporated, for example gaseous MgO, SiO, and many others.

Hundreds of diatomic molecules have been identified[4] in the environment of the Earth, in the laboratory, and in interstellar space. About 99% of the Earth's atmosphere is composed of two species of diatomic molecules: nitrogen (78%) and oxygen (21%). The natural abundance of hydrogen (H2) in the Earth's atmosphere is only of the order of parts per million, but H2 is the most abundant diatomic molecule in the universe. The interstellar medium is, indeed, dominated by hydrogen atoms.

Diatomic elements played an important role in the elucidation of the concepts of element, atom, and molecule in the 19th century, because some of the most common elements, such as hydrogen, oxygen, and nitrogen, occur as diatomic molecules. John Dalton's original atomic hypothesis assumed that all elements were monatomic and that the atoms in compounds would normally have the simplest atomic ratios with respect to one another. For example, Dalton assumed water's formula to be HO, giving the atomic weight of oxygen as eight times that of hydrogen[citation needed], instead of the modern value of about 16. As a consequence, confusion existed regarding atomic weights and molecular formulas for about half a century.

As early as 1805, Gay-Lussac and von Humboldt showed that water is formed of two volumes of hydrogen and one volume of oxygen, and by 1811 Amedeo Avogadro had arrived at the correct interpretation of water's composition, based on what is now called Avogadro's law and the assumption of diatomic elemental molecules. However, these results were mostly ignored until 1860, partly due to the belief that atoms of one element would have no chemical affinity toward atoms of the same element, and partly due to apparent exceptions to Avogadro's law that were not explained until later in terms of dissociating molecules.

Diatomic molecules are normally in their lowest or ground state, which conventionally is also known as the state. When a gas of diatomic molecules is bombarded by energetic electrons, some of the molecules may be excited to higher electronic states, as occurs, for example, in the natural aurora; high-altitude nuclear explosions; and rocket-borne electron gun experiments.[7] Such excitation can also occur when the gas absorbs light or other electromagnetic radiation. The excited states are unstable and naturally relax back to the ground state. Over various short time scales after the excitation (typically a fraction of a second, or sometimes longer than a second if the excited state is metastable), transitions occur from higher to lower electronic states and ultimately to the ground state, and in each transition results a photon is emitted. This emission is known as fluorescence. Successively higher electronic states are conventionally named , , , etc. (but this convention is not always followed, and sometimes lower case letters and alphabetically out-of-sequence letters are used, as in the example given below). The excitation energy must be greater than or equal to the energy of the electronic state in order for the excitation to occur.

In quantum theory, an electronic state of a diatomic molecule is represented by

where is the total electronic spin quantum number, is the total electronic angular momentum quantum number along the internuclear axis, and is the vibrational quantum number. takes on values 0, 1, 2, …, which are represented by the electronic state symbols , , ,…. For example, the following table lists the common electronic states (without vibrational quantum numbers) along with the energy of the lowest vibrational level () of diatomic nitrogen (N2), the most abundant gas in the Earth's atmosphere.[8] In the table, the subscripts and superscripts after give additional quantum mechanical details about the electronic state.

State

Energy (, cm−1)
See note below

0.0

49754.8

59306.8

59380.2

65851.3

67739.3

68951.2

71698.4

Note: The "energy" units in the above table are actually the reciprocal of the wavelength of a photon emitted in a transition to the lowest energy state. The actual energy can be found by multiplying the given statistic by the product of c (the speed of light) and h (Planck's constant), i.e., about 1.99 × 10−25 Joule metres, and then multiplying by a further factor of 100 to convert from cm−1 to m−1.

The aforementioned fluorescence occurs in distinct regions of the electromagnetic spectrum, called "emission bands": each band corresponds to a particular transition from a higher electronic state and vibrational level to a lower electronic state and vibrational level (typically, many vibrational levels are involved in an excited gas of diatomic molecules). For example, N2- emission bands (a.k.a. Vegard-Kaplan bands) are present in the spectral range from 0.14 to 1.45 μm (micrometres).[7] A given band can be spread out over several nanometers in electromagnetic wavelength space, owing to the various transitions that occur in the molecule's rotational quantum number, . These are classified into distinct sub-band branches, depending on the change in .[9] The branch corresponds to , the branch to , and the branch to . Bands are spread out even further by the limited spectral resolution of the spectrometer that is used to measure the spectrum. The spectral resolution depends on the instrument's point spread function.

The molecular term symbol is a shorthand expression of the angular momenta that characterize the electronic quantum states of a diatomic molecule, which are eigenstates of the electronic molecular Hamiltonian. It is also convenient, and common, to represent a diatomic molecule as two point masses connected by a massless spring. The energies involved in the various motions of the molecule can then be broken down into three categories: the translational, rotational, and vibrational energies.

Another type of motion of a diatomic molecule is for each atom to oscillate—or vibrate—along the line connecting the two atoms. The vibrational energy is approximately that of a quantum harmonic oscillator: