The octet rule states that atoms tend to gain, lose, or share electrons until they have eight electrons in their outermost energy level (called the valence shell). This drive toward eight outer electrons explains why atoms bond with each other in the first place and predicts how they’ll do it. It’s one of the most fundamental ideas in chemistry because it lets you figure out molecular structures, understand chemical reactions, and predict which compounds are stable.
How the Octet Rule Works
Every atom has electrons arranged in layers, or “shells,” around its nucleus. The outermost shell is the one that matters for bonding. Atoms with fewer than eight electrons in that shell are chemically reactive. They will form bonds with other atoms to reach that magic number of eight, achieving the same electron arrangement as the nearest noble gas (helium, neon, argon, and so on).
Noble gases already have full outer shells, which is why they’re famously unreactive. Neon has eight valence electrons. Argon has eight. They don’t need to bond with anything because they’re already stable. The octet rule is essentially the observation that other atoms “want” to look like noble gases, electronically speaking.
There are three ways atoms accomplish this:
- Losing electrons: Sodium has one valence electron. It’s much easier to give that one away than to find seven more. When sodium loses it, the shell beneath (which already has eight electrons) becomes the new outer shell. Sodium becomes a positively charged ion.
- Gaining electrons: Chlorine has seven valence electrons. Picking up one more completes the octet. Chlorine becomes a negatively charged ion. This is why sodium and chlorine combine so readily to form table salt: one gives, the other takes, and both end up satisfied.
- Sharing electrons: Two nonmetal atoms often share electrons rather than transferring them outright. In a water molecule, oxygen shares electrons with two hydrogen atoms. Each shared pair counts toward the octet of both atoms involved.
Why It Matters in Chemistry
The octet rule is important because it’s predictive. If you know how many valence electrons an atom has, you can figure out how many bonds it will form, what kinds of molecules it will build, and how it will react with other elements. Carbon has four valence electrons, so it forms four bonds. Nitrogen has five, so it forms three (keeping two as a non-bonding “lone pair”). Oxygen has six, so it forms two. These patterns hold across thousands of compounds.
This predictability is what makes the octet rule so useful in practice. When chemists draw Lewis structures (diagrams showing how electrons are arranged in a molecule), the octet rule is the primary guide. You place electrons around atoms until each one has eight, and the resulting structure tells you the molecule’s shape, its reactivity, and many of its physical properties. Without this rule, figuring out molecular structure would require complex quantum mechanical calculations every time.
The rule also explains trends across the periodic table. Elements on the left side (metals) have one, two, or three valence electrons and tend to lose them. Elements on the right side (nonmetals) have five, six, or seven and tend to gain or share. This is why metals and nonmetals behave so differently and why they form such stable compounds when combined.
The Duet Rule for Small Atoms
Hydrogen and helium are exceptions to the “eight” part of the rule. Their outermost shell is the first energy level, which can only hold two electrons. So hydrogen follows a “duet rule,” seeking two electrons instead of eight. This is why hydrogen forms one bond: it has one electron and needs one more. Helium already has two, so it doesn’t bond at all. Lithium, with one valence electron in its second shell, also sometimes satisfies a duet by losing that electron and exposing a full first shell beneath.
When the Octet Rule Breaks Down
The octet rule works beautifully for elements in the first two rows of the periodic table, especially carbon, nitrogen, oxygen, and fluorine. But it has real limitations, and recognizing where it fails is just as important as knowing the rule itself.
Incomplete Octets
Some atoms are stable with fewer than eight electrons. Boron is the classic example. In boron trifluoride, boron has only six valence electrons and doesn’t complete an octet, yet the molecule exists and is perfectly stable. Beryllium compounds sometimes have only four electrons around the central atom. These “electron-deficient” molecules are reactive in specific ways (boron trifluoride is a strong Lewis acid, for instance), but they don’t spontaneously fall apart.
Expanded Octets
Elements in the third row and beyond can hold more than eight electrons in their valence shell. Phosphorus can bond with five other atoms (as in phosphorus pentachloride), giving it ten electrons. Sulfur can accommodate twelve in sulfur hexafluoride. This is possible because these larger atoms have access to additional orbital space that second-row elements lack. If you only applied the strict octet rule, you’d incorrectly predict that these common, well-known compounds couldn’t exist.
Odd-Electron Molecules
A few molecules have an odd total number of electrons, making it mathematically impossible for every atom to have eight. Nitric oxide has eleven electrons. Nitrogen dioxide has an unpaired electron on the nitrogen atom. These molecules, called free radicals, are typically more reactive than their even-electron counterparts, which actually reinforces the octet rule in a roundabout way: violating it usually comes with a cost in stability.
The Physics Behind the Rule
The octet rule isn’t an arbitrary pattern. It comes from quantum mechanics. Electrons occupy regions of space called orbitals, and the second energy level (which governs bonding for the most common elements) contains one s orbital and three p orbitals. Each orbital holds two electrons. That’s 2 + 6 = 8 electrons total, and that’s where the number eight comes from.
When all four orbitals are filled, the electron configuration is exceptionally stable because every available space is occupied. Adding more electrons would require jumping to a higher, more energetic shell, which costs energy. Removing electrons from a full shell also costs energy. This creates an energy “sweet spot” at eight that atoms naturally settle into. The octet rule is really a shorthand for this quantum mechanical reality, translated into a simple counting exercise that works remarkably well for everyday chemistry.
Applying the Rule to Lewis Structures
The most common place you’ll use the octet rule is when drawing Lewis structures. The process is straightforward: count the total valence electrons for all atoms in the molecule, arrange the atoms with the least electronegative one in the center, distribute electrons as bonding pairs first, then place remaining electrons as lone pairs to satisfy octets.
When you run short on electrons and can’t give every atom eight, that’s a signal to form double or triple bonds. In carbon dioxide, for example, a single bond between carbon and each oxygen wouldn’t provide enough electrons to complete all three octets. Forming two double bonds solves the problem, and this matches the actual structure of the molecule. The octet rule doesn’t just describe reality here; it actively guides you toward the correct answer.
For molecules where the octet rule gives you two or more possible structures that look equally valid, the concept of formal charge helps you decide which arrangement is best. The structure where atoms carry the smallest formal charges, with any negative charges on the more electronegative atoms, is generally the most accurate representation.

