The octet rule is a chemical rule of thumb that reflects observation that atoms of main-group elements tend to combine in such a way that each atom has eight electrons in its valence shell, giving it the same electron configuration as a noble gas. The rule is especially applicable to carbon, nitrogen, oxygen, and the halogens, but also to metals such as sodium or magnesium.
The valence electrons can be counted using a Lewis electron dot diagram as shown at the right for carbon dioxide. The electrons shared by the two atoms in a covalent bond are counted twice, once for each atom. In carbon dioxide each oxygen shares four electrons with the central carbon, two (shown in red) from the oxygen itself and two (shown in black) from the carbon. All four of these electrons are counted in both the carbon octet and the oxygen octet.
A chlorine atom has seven electrons in its outer electron shell, the first and second shells being filled with two and eight electrons respectively. The first electron affinity of chlorine (the energy release when chlorine gains an electron) is +328.8 kJ per mole of chlorine atoms. Adding a second electron to chlorine requires energy, energy that cannot be recovered by formation of a chemical bond. The result is that chlorine will very often form a compound in which it has eight electrons in its outer shell (a complete octet).
A sodium atom has a single electron in its outermost electron shell, the first and second shells again being full with two and eight electrons respectively. To remove this outer electron requires only the first ionization energy, which is +495.8 kJ per mole of sodium atoms, a small amount of energy. By contrast, the second electron resides in the deeper second electron shell, and the second ionization energy required for its removal is much larger: +4562.4 kJ per mole. Thus sodium will, in most cases, form a compound in which it has lost a single electron and have a full outer shell of eight electrons, or octet.
The energy required to transfer an electron from a sodium atom to a chlorine atom (the difference of the 1st ionization energy of sodium and the electron affinity of chlorine) is small: +495.8 - 328.8 = +167 kJ mol-1. This energy is easily offset by the lattice energy of sodium chloride: -787.3 kJ mol-1. This completes the explanation of the octet rule in this case.
In the late 19th century it was known that coordination compounds (formerly called "molecular compounds") were formed by the combination of atoms or molecules in such a manner that the valencies of the atoms involved apparently became satisfied. In 1893, Alfred Werner showed that the number of atoms or groups associated with a central atom (the "coordination number") is often 4 or 6; other coordination numbers up to a maximum of 8 were known, but less frequent. In 1904 Richard Abegg was one of the first to extend the concept of coordination number to a concept of valence in which he distinguished atoms as electron donors or acceptors, leading to positive and negative valence states that greatly resemble the modern concept of oxidation states. Abegg noted that the difference between the maximum positive and negative valences of an element under his model is frequently eight. In 1916, Gilbert N. Lewis referred to this insight as Abegg's rule and used it to help formulate his cubical atom model and the "rule of eight", which began to distinguish between valence and valence electrons. In 1919 Irving Langmuir refined these concepts further and renamed them the "cubical octet atom" and "octet theory". The "octet theory" evolved into what is now known as the "octet rule".
The quantum theory of the atom explains the eight electrons as a closed shell with an s2p6 electron configuration. A closed-shell configuration is one in which low-lying energy levels are full and higher energy levels are empty. For example, the neon atom ground state has a full shell (2s2 2p6) and an empty shell. According to the octet rule, the atoms immediately before and after neon in the periodic table (i.e. C, N, O, F, Na, Mg and Al), tend to attain a similar configuration by gaining, losing, or sharing electrons.
The argon atom has an analogous 3s2 3p6 configuration. There is also an empty 3d level, but it is at considerably higher energy than 3s and 3p (unlike in the hydrogen atom), so that 3s2 3p6 is still considered a closed shell for chemical purposes. The atoms immediately before and after argon tend to attain this configuration in compounds. There are, however, some hypervalent molecules in which the 3d level may play a part in the bonding, although this is controversial (see below).
For helium there is no 1p level according to the quantum theory, so that 1s2 is a closed shell with no p electrons. The atoms before and after helium (H and Li) follow a duet rule and tend to have the same 1s2 configuration as helium.
Some stable molecular radicals (e.g. nitric oxide, NO) obtain octet configurations by means of a three-electron bond which contributes one shared and one unshared electron to the octet of each bonded atom. In NO, the octet on each atom is completed by four electrons from two two-electron bonds, plus a lone pair of non-bonding electrons on that atom alone. The bond order is 2.5, since each two-electron bond counts as one bond while the three-electron bond has only one shared electron and therefore corresponds to a half-bond.
Dioxygen is sometimes represented as obeying the octet rule with a double bond (O=O) containing two pairs of shared electrons. However the ground state of this molecule is paramagnetic, indicating the presence of unpaired electrons. Pauling proposed that this molecule actually contains two three-electron bonds and one normal covalent (two-electron) bond. The octet on each atom then consists of two electrons from each three-electron bond, plus the two electrons of the covalent bond, plus one lone pair of non-bonding electrons.
Main-group elements in the third and later rows of the periodic table can form hypercoordinate or hypervalent molecules in which the central main-group atom is bonded to more than four other atoms, such as phosphorus pentachloride, PCl5, and sulfur hexafluoride, SF6. For example, in PCl5, if it is supposed that there are five true covalent bonds in which five distinct electron pairs are shared, then the phosphorus would be surrounded by 10 valence electrons in violation of the octet rule. In the early days of quantum mechanics, Pauling proposed that third-row atoms can form five bonds by using one s, three p and one d orbitals, or six bonds by using one s, three p and two d orbitals. To form five bonds, the one s, three p and one d orbitals combine to form five sp3d hybrid orbitals which each share an electron pair with a halogen atom, for a total of 10 shared electrons, two more than the octet rule predicts. Similarly to form six bonds, the six sp3d2 hybrid orbitals form six bonds with 12 shared electrons. In this model the availability of empty d orbitals is used to explain the fact that third-row atoms such as phosphorus and sulfur can form more than four covalent bonds, whereas second-row atoms such as nitrogen and oxygen are strictly limited by the octet rule.
However other models describe the bonding using only s and p orbitals in agreement with the octet rule. A valence bond description of PF5 uses resonance between different PF4+ F- structures, so that each F is bonded by a covalent bond in four structures and an ionic bond in one structure. Each resonance structure has eight valence electrons on P. A molecular orbital theory description considers the highest occupied molecular orbital to be a non-bonding orbital localized on the five fluorine atoms, in addition to four occupied bonding orbitals, so again there are only eight valence electrons on the phosphorus. The validity of the octet rule for hypervalent molecules is further supported by ab initio molecular orbital calculations, which show that the contribution of d functions to the bonding orbitals is small.