# Lewis Structure Generator - Formal Charges, Resonance and Electron-Dot Formulas

> Draw Lewis structures and electron-dot formulas online, with valence electrons, formal charges, resonance, expanded octets, radicals and ionic compounds.

- URL: https://qilingtools.com/en/chemistry/lewis
- Category: Chemistry Tools (https://qilingtools.com/en/chemistry)
- Tags: [Chemistry](https://qilingtools.com/en/tags/chemistry)
- Last updated: 2026-10-29
- Price: Free, no sign-up
- Privacy: Runs locally in the browser; files are never uploaded

A Lewis structure shows valence electrons as bonds (lines for shared pairs) and dots (lone pairs). An electron-dot formula, the style used in many school textbooks, draws the shared pairs as dots too. This tool builds both with the textbook recipe. It counts valence electrons, adjusting for an ion's charge, and puts the least electronegative atom in the centre. It completes the octets of the terminal atoms first (H needs 2) and puts the leftover electrons on the central atom. If the centre is still short of 8, terminal lone pairs become double or triple bonds. Formal charges are FC = valence − non-bonding − bonds. The best structure is chosen by satisfying octets, then minimising the sum of |formal charges|, then placing negative charge on the more electronegative atoms. CO₂ (16 valence electrons) gives O=C=O with zero formal charges. NO₃⁻ (24 electrons) gives N +1 and two single-bonded O −1, with 3 equivalent resonance structures. SO₄²⁻ is shown both as the minimum-formal-charge expanded octet and as the strict octet structure with S +2. BF₃ leaves boron with 6 electrons, XeF₄ has 2 lone pairs on Xe (12 electrons), and NO, NO₂ and ClO₂ are odd-electron radicals. Ionic compounds such as NaCl, MgCl₂, Na₂O, CaF₂, NH₄Cl and Na₂O₂ are written as ions, with bracketed anions and charges and identical ions kept separate. Binary salts also get a formation diagram using × and · electrons.

## How to use

1. Type a formula such as CO2, NO3-, SO4^2-, XeF4, NaCl or NH4Cl, or click an example
2. Choose Lewis structure (lines for bonds) or electron-dot formula (all dots)
3. Read the diagram, resonance structures, formal-charge table and drawing steps; ionic compounds also show the formation diagram

## Features

- Switch between Lewis structures and all-dot electron-dot formulas
- Total valence electrons, bonding pairs and lone pairs
- Formal charge for every atom, circled on the diagram
- Equivalent and minor resonance structures (NO₃⁻, CO₃²⁻, O₃, N₂O, SCN⁻)
- Expanded octets (SF₆, PCl₅, XeF₄, I₃⁻) shown alongside strict-octet forms
- Electron-deficient (BF₃, BeCl₂) and odd-electron radicals (NO, NO₂, ClO₂)
- Ionic compounds and their formation from atoms (NaCl, MgCl₂, Na₂O, Na₂O₂, NH₄Cl)
- Common two-centre molecules: H₂O₂, N₂H₄, C₂H₄, C₂H₂, ethanol, acetic acid

## FAQ

### What is the difference between a Lewis structure and an electron-dot formula?

Both show how valence electrons are arranged. A Lewis structure uses a line for each shared pair and dots for lone pairs. An electron-dot formula draws the shared pairs as dots as well, so water becomes H:O:H with two lone pairs on oxygen. Ionic compounds are always shown as separate ions, with simple cations written as ion symbols and anions bracketed with their charge.

### How do you calculate formal charge?

Formal charge = valence electrons − non-bonding electrons − number of bonds (a double bond counts as 2). In NO₃⁻, nitrogen has 5 valence electrons, no lone electrons and 4 bonds, so its formal charge is +1. Each single-bonded oxygen has 6 − 6 − 1 = −1. The formal charges always add up to the overall charge. The best structure keeps them near zero, with negative charge on the most electronegative atoms, which is why CO is C≡O and cyanate is mainly N≡C–O⁻.

### Which molecules break the octet rule?

There are three common exceptions. Electron-deficient molecules: boron in BF₃ has 6 electrons and beryllium in BeCl₂ has 4. Odd-electron molecules: NO (11 valence electrons), NO₂ (17) and ClO₂ (19) must leave one atom with 7 electrons, so they are radicals. Expanded octets: central atoms from period 3 onward can exceed 8, such as P in PCl₅ (10), S in SF₆ (12) and Xe in XeF₄ (12: 4 bonds plus 2 lone pairs). Period-2 atoms C, N, O and F never exceed 8.

### Should sulfate be drawn with S=O double bonds or all single bonds?

Both appear in textbooks. Minimising formal charge gives two S=O double bonds and two S–O⁻ bonds, with 12 electrons around sulfur and 6 resonance forms. Modern calculations show sulfur's d orbitals barely take part in bonding, so many university texts prefer the octet structure. That structure has four S–O single bonds, S at +2 and each O at −1, and treats the bonds as strongly polar. The tool shows both so you can match your course.

## Related tools

- [Significant Figures Calculator](https://qilingtools.com/en/math/significant-figures): Free online sig fig calculator: count significant figures digit by digit, round to N sig figs or decimals with six rounding modes, and compute by sig fig rules.
- [Chemical Equation Balancer](https://qilingtools.com/en/chemistry/chemical-equation): Balance chemical equations by the algebraic method: smallest whole-number coefficients, brackets, hydrates, ionic charges, electrons, atom and charge checks.
- [Molar Mass Calculator](https://qilingtools.com/en/chemistry/molar-mass): Molar mass of any formula with IUPAC atomic weights: brackets and hydrates, mass percent of each element, grams ↔ moles ↔ particles and solution molarity.
- [Interactive Periodic Table](https://qilingtools.com/en/chemistry/periodic-table): Interactive periodic table of all 118 elements: colour by category, block, electronegativity, atomic mass, phase or melting point; search and click for details.
- [pH Calculator](https://qilingtools.com/en/chemistry/ph): Free pH calculator for strong and weak acids and bases, polyprotic acids, salts and buffers, with an exact charge-balance solution and species plots.
- [Titration Curve](https://qilingtools.com/en/chemistry/titration): Free acid-base titration curve simulator: exact curves for strong, weak and polyprotic acids and bases, equivalence-point pH, the jump and indicator picks.
- [Gas Law Calculator](https://qilingtools.com/en/chemistry/gas-law): Free gas law calculator: solve PV=nRT for any variable, combined gas laws, gas density, Dalton's partial pressures, gas over water and van der Waals Z.
- [Solution & Dilution Calculator](https://qilingtools.com/en/chemistry/solution): Free dilution calculator: solve C1V1=C2V2, convert molarity, % w/w, ppm and molality, mix solutions, plan serial dilutions and dilute stock acids.
