Lewis structure generator with formal charges

Formal Charges and Resonance in Lewis Structures

Formal charge is a bookkeeping tool for comparing candidate Lewis structures. Resonance is used when the same atom arrangement can support more than one valid electron placement.

The formal-charge equation

Formal charge = valence electrons − nonbonding electrons − ½(bonding electrons)

For line-bond drawings, a convenient shortcut is: formal charge = valence electrons − dots − bond lines. A double bond counts as two bond lines and a triple bond counts as three.

How to calculate formal charge

  1. Identify the atom's normal valence-electron count.
    Use the main-group number: carbon 4, nitrogen 5, oxygen 6, halogens 7.
  2. Count all nonbonding electrons assigned to the atom.
    Count individual dots, not lone-pair groups.
  3. Count half of the bonding electrons.
    Each ordinary bond line assigns one electron to the atom.
  4. Subtract and label the charge.
    Write nonzero formal charges next to the correct atoms.
  5. Verify the total.
    All formal charges must add to the molecule or ion's overall charge.

Example: oxygen in a single bond

An oxygen with three lone pairs and one single bond has formal charge 6 − 6 − 1 = −1.

Example: oxygen in a double bond

An oxygen with two lone pairs and one double bond has formal charge 6 − 4 − 2 = 0.

Rules for choosing a better Lewis structure

  • The formal charges must sum to the overall charge.
  • Prefer smaller formal-charge magnitudes when octet requirements are comparable.
  • Prefer less charge separation when alternatives are otherwise similar.
  • Negative formal charge is generally more plausible on a more electronegative atom.
  • Do not violate the duet rule for hydrogen or force second-period atoms above an octet.
  • Remember that formal charge is not the same as measured partial charge or oxidation state.

What resonance means

Resonance contributors have the same atom connectivity but different placements of electrons, bond orders or formal charges. The real molecule is not switching between drawings; it is a resonance hybrid described collectively by the valid contributors.

Only electrons move. Do not move atomic nuclei or break the sigma-bond skeleton when drawing resonance contributors.

How to draw resonance contributors

  1. Keep the atom skeleton fixed.
    If an atom changes neighbors, you have drawn an isomer or reaction product, not resonance.
  2. Move lone pairs or π electrons.
    Use electron-pushing logic while preserving the total electron count.
  3. Recalculate formal charges.
    Charges commonly move with the electron pair.
  4. Connect contributors with a double-headed resonance arrow.
    Do not use an equilibrium arrow.
  5. Compare contributor importance.
    Equivalent contributors contribute equally; nonequivalent contributors can have different weights.

Common mistakes

  • Dividing bonding electrons incorrectly or counting lone pairs instead of electrons.
  • Forgetting that the formal charges must sum to the overall charge.
  • Moving atoms when drawing resonance.
  • Showing a resonance hybrid as if it were one ordinary localized Lewis structure.
  • Assuming the structure with zero formal charges is always best even when it violates a second-period octet.

Last reviewed: July 15, 2026.