Lewis Structures
Build Lewis dot structures step by step: count valence electrons, place bonds and complete octets
Step 1 of 7
Count valence electrons
N: 1 × 5 = 5, O: 3 × 6 = 18; add 1 for the −1 charge. Total: 24 valence electrons (12 pairs) to place.
| Atom | V | LP e⁻ | Bond e⁻ | Around | FC |
|---|---|---|---|---|---|
| N (central) | 5 | 0 | 0 | 0/8 | +5 |
| O₁ | 6 | 0 | 0 | 0/8 | +6 |
| O₂ | 6 | 0 | 0 | 0/8 | +6 |
| O₃ | 6 | 0 | 0 | 0/8 | +6 |
V = valence electrons, LP e⁻ = electrons in lone pairs, Bond e⁻ = electrons in bonds touching the atom, Around = LP e⁻ + Bond e⁻ against the octet (or duet for H) target. FC = V − LP e⁻ − ½ Bond e⁻. Amber means short of the target; violet means an expanded octet.
What a Lewis structure shows
A Lewis structure is a map of where a molecule's valence electrons are: which atoms share them in bonds and which atoms keep them as lone pairs. It is built on the octet rule: main-group atoms are most stable with eight electrons around them (hydrogen with two).
The method in the visualizer works for almost every molecule with a single central atom. Count the electrons you have, connect the skeleton with single bonds, fill the outer atoms first, put leftovers on the central atom and, if the central atom is still short of an octet, turn outer lone pairs into double or triple bonds. Finally, check formal charges to confirm the structure is sensible.
There are well-known exceptions. Boron is often happy with six electrons (BF₃). Elements from period 3 down, such as P, S, Cl and Xe, can hold more than eight (PCl₅, SF₆, XeF₄). And molecules with an odd number of electrons, like NO, must leave one atom with an unpaired electron.
Valence electrons
Bonding pairs and lone pairs
Formal charge
Resonance
Key formulas
Total valence electrons
total = Σ V − q
- V
- valence electrons of each atom
- q
- overall charge of the ion (−1 for NO₃⁻, +1 for NH₄⁺)
Formal charge
FC = V − N − B/2
- V
- valence electrons of the free atom
- N
- nonbonding electrons on the atom (2 per lone pair)
- B
- bonding electrons around the atom (2 per bond line)
Counting bonds (N − A = S)
S = N − A, bonds = S / 2
- N
- electrons needed: 8 per atom, 2 per H
- A
- electrons available (total valence electrons)
- S
- electrons shared; the number of bonds is S/2
Valence electrons and typical bonding
| Element | Group | Valence e⁻ | Usual pattern (formal charge 0) |
|---|---|---|---|
| H | 1 | 1 | 1 bond, no lone pairs (duet) |
| B | 13 | 3 | 3 bonds, often only 6 electrons |
| C | 14 | 4 | 4 bonds, no lone pairs |
| N | 15 | 5 | 3 bonds + 1 lone pair |
| O | 16 | 6 | 2 bonds + 2 lone pairs |
| F, Cl, Br, I | 17 | 7 | 1 bond + 3 lone pairs |
| P, S, Cl, Xe (as central atoms) | 15–18 | 5–8 | can exceed 8 electrons (expanded octet) |
How to use this visualizer
- 1Choose a molecule or ion from the list. The drawing starts with the bare atoms and their valence electron counts.
- 2Press Next step (or Play) to run the algorithm. Anything added or changed in the current step is drawn in amber.
- 3Watch the electron pool: grey dots are already placed, amber dots are still to place. It should reach zero by the end.
- 4Read the bookkeeping table. Around shows how many electrons each atom has against its target (8, or 2 for H), and FC is the formal charge.
- 5On the last step, formal charges appear on the drawing. For SO₂, O₃, NO₃⁻ and CO₃²⁻, switch between the resonance forms.
- 6Compare BF₃ (incomplete octet) with PCl₅, SF₆ and XeF₄ (expanded octets), and CO with N₂ (same electron count, different formal charges).
Common misconception: resonance is not flipping
Resonance forms are not different molecules that switch back and forth. In nitrate all three N–O bonds are identical, each with a bond order of 4/3, and they are shorter than a single bond but longer than a double bond. The separate drawings exist only because one Lewis structure cannot show electrons spread over several bonds at once.Limits of Lewis structures
Lewis structures show connectivity, not shape: water is drawn flat but is actually bent at 104.5°. They also predict O₂ to have all its electrons paired, yet O₂ is paramagnetic (it has two unpaired electrons), which needs molecular orbital theory to explain. For SO₂, some textbooks prefer an expanded-octet structure with two S=O double bonds, which gives every atom a formal charge of 0; the octet structure shown here is the other common convention.Practice problems
Problem 1: The nitrite ion
Show solutionHide solution
Valence electrons: N 5 + 2 × O 6 + 1 (charge) = 18
Two N–O single bonds use 4 → 14 left
Each O gets 3 lone pairs (6 e⁻ each) → 12 used, 2 left
The last 2 go on N as a lone pair; N now has 2 + 4 = 6 electrons
Turn one O lone pair into a bond: O=N–O, N has 8
FC(N) = 5 − 2 − 3 = 0
FC(O, double) = 6 − 4 − 2 = 0; FC(O, single) = 6 − 6 − 1 = −1
Sum = −1 ✓ (matches the charge)
2 resonance forms; average N–O bond order = (2 + 1)/2 = 1.5
Problem 2: Choosing a skeleton with formal charges
Show solutionHide solution
Total: 2 × 5 + 6 = 16 electrons
N–O–N, best octet form N=O=N:
FC(N) = 5 − 4 − 2 = −1 (each); FC(O) = 6 − 0 − 4 = +2
N–N–O, form N=N=O:
FC = −1 (end N), +1 (middle N), 0 (O)
N–N–O, form N≡N–O:
FC(end N) = 5 − 2 − 3 = 0; FC(middle N) = 5 − 0 − 4 = +1; FC(O) = 6 − 6 − 1 = −1
N–O–N puts +2 on O, the most electronegative atom: rejected
Skeleton N–N–O. N≡N–O is the best single form (its −1 sits on O, the more electronegative atom); N=N=O is a second resonance form.
Related topics
Discussion
Questions, ideas or a different approach? Join the conversation.