Lewis Structures

Build Lewis dot structures step by step: count valence electrons, place bonds and complete octets

Beginner
NOOO5 e⁻6 e⁻6 e⁻6 e⁻
changed in this step

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.

Electron pool0 placed, 24 left of 24
AtomVLP e⁻Bond e⁻AroundFC
N (central)5000/8+5
O₁6000/8+6
O₂6000/8+6
O₃6000/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

Only the outer-shell electrons take part in bonding. For main-group elements it is 1 or 2 in groups 1 and 2, and the group number minus 10 in groups 13 to 18.

Bonding pairs and lone pairs

A line is a shared pair of electrons; a double bond shares two pairs, a triple bond three. Pairs that belong to only one atom are lone pairs, drawn as dots.

Formal charge

A bookkeeping charge that assumes bonding electrons are split evenly. The best structure keeps formal charges small and puts any negative charge on the more electronegative atom.

Resonance

When a double bond could sit in several equivalent places, no single drawing is correct. The real molecule is a blend (hybrid) of all of them.

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

ElementGroupValence e⁻Usual pattern (formal charge 0)
H111 bond, no lone pairs (duet)
B1333 bonds, often only 6 electrons
C1444 bonds, no lone pairs
N1553 bonds + 1 lone pair
O1662 bonds + 2 lone pairs
F, Cl, Br, I1771 bond + 3 lone pairs
P, S, Cl, Xe (as central atoms)15–185–8can exceed 8 electrons (expanded octet)

How to use this visualizer

  1. 1
    Choose a molecule or ion from the list. The drawing starts with the bare atoms and their valence electron counts.
  2. 2
    Press Next step (or Play) to run the algorithm. Anything added or changed in the current step is drawn in amber.
  3. 3
    Watch the electron pool: grey dots are already placed, amber dots are still to place. It should reach zero by the end.
  4. 4
    Read 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.
  5. 5
    On the last step, formal charges appear on the drawing. For SO₂, O₃, NO₃⁻ and CO₃²⁻, switch between the resonance forms.
  6. 6
    Compare 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

Draw the Lewis structure of the nitrite ion, NO₂⁻. Give the formal charge on each atom, the number of resonance forms and the average N–O bond order.
Show 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

Nitrous oxide, N₂O, has 16 valence electrons. Compare the skeletons N–N–O and N–O–N using formal charges. Which skeleton is correct, and which resonance form of it is the best single picture?
Show 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.