MolDraw › Chemistry tools › Lewis Structure Generator

Lewis Structure Generator

In short: Lewis dot structure generator: enter a formula (SO4 2-, NH3, XeF4) to get bonds, lone pairs, formal charges and VSEPR shape, with step-by-step help. It is free, works in your web browser and needs no download.

Enter a molecule or ion to draw its Lewis dot structure, with bonding pairs, lone pairs and formal charges. You also get the VSEPR geometry and a step-by-step explanation of how the structure was built.

Quick answer: for water, O has 6 valence electrons and each H has 1, giving 8. Two O–H bonds use 4, and the other 4 sit on O as two lone pairs, so the molecule is bent (≈104.5°).

How to use the lewis structure generator

  1. Type the formula (NH4) and choose the charge, or type it with the charge (NO3-, SO4^2-).
  2. The generator counts valence electrons and picks the central atom (the least electronegative atom, never H).
  3. It completes the octets of the outer atoms, places leftover electrons on the central atom, and forms double or triple bonds where the central atom is short of an octet.
  4. Read the structure, formal charges, resonance note and VSEPR shape. Download the SVG for worksheets or slides.

Worked examples

Ammonia, NH3 (8 e⁻)

3 N–H bonds (6 e⁻) + 1 lone pair on N

Trigonal pyramidal, ≈107°

Carbon dioxide, CO2 (16 e⁻)

O=C=O, two lone pairs on each O, formal charges 0

Linear, 180°

Nitrate, NO3− (24 e⁻)

One N=O and two N–O⁻; N is +1, the two single-bonded O are −1

Trigonal planar, 3 resonance structures

Xenon tetrafluoride, XeF4 (36 e⁻)

4 Xe–F bonds + 2 lone pairs on Xe (expanded octet)

Square planar, 90°

How to draw a Lewis structure

  1. Count valence electrons from the group number (C 4, N 5, O 6, halogens 7). Add one for each negative charge and subtract one for each positive charge.
  2. Draw the skeleton. The least electronegative atom goes in the centre. H and F are always terminal.
  3. Complete octets on outer atoms with lone pairs (H only needs 2 electrons).
  4. Put leftover electrons on the central atom.
  5. Form multiple bonds if the central atom has fewer than 8 electrons, by turning outer lone pairs into shared pairs.
  6. Check formal charges: FC = valence e⁻ − lone-pair e⁻ − bonds. The best structure has charges closest to zero, with any negative charge on the more electronegative atom.
Formal charge = V − L − B (V = valence electrons, L = non-bonding electrons, B = number of bonds)

Exceptions to the octet rule

Incomplete octets: B and Be (BF3, BeCl2). Expanded octets: period 3 and heavier atoms (PCl5, SF6, XeF4). Odd-electron radicals: NO and NO2. For sulfate, phosphate and similar ions, the tool shows the formal-charge-minimised structure with S=O double bonds. Many textbooks also accept the octet structure with only single bonds and S2+.

VSEPR shapes

Bonded atoms + lone pairsShapeExample
2 + 0LinearCO2, BeCl2
3 + 0 / 2 + 1Trigonal planar / bentBF3 / SO2
4 + 0 / 3 + 1 / 2 + 2Tetrahedral / trigonal pyramidal / bentCH4 / NH3 / H2O
5 + 0 / 4 + 1 / 3 + 2Trigonal bipyramidal / seesaw / T-shapedPCl5 / SF4 / ClF3
6 + 0 / 5 + 1 / 4 + 2Octahedral / square pyramidal / square planarSF6 / BrF5 / XeF4

For bond angles, hybridization, polarity and a 3D model of each shape, use the VSEPR molecular geometry calculator.

The generator covers molecules with one central atom, diatomics and X3 ions such as I3− and O3. For larger molecules (ethanol, benzene) draw the skeletal structure in the MolDraw editor.

Drawing bigger molecules? Use the full MolDraw editor for skeletal structures, lone pairs, charges and curved-arrow mechanisms, free in your browser.

Open MolDraw editor

Frequently asked questions

How do you draw a Lewis structure step by step?

Count valence electrons, put the least electronegative atom in the centre, connect atoms with single bonds, complete the outer octets, put leftover electrons on the centre, then form multiple bonds until the central atom has an octet.

How do you count valence electrons for an ion?

Add the valence electrons of all atoms, then add one electron per negative charge or subtract one per positive charge. SO4 2− has 6 + 4 × 6 + 2 = 32.

What is formal charge?

Formal charge = valence electrons − non-bonding electrons − number of bonds. It shows how electrons are distributed; the best Lewis structure keeps formal charges small.

Which atom is the central atom?

Usually the least electronegative atom that is not hydrogen, often the one that appears only once in the formula (S in SO4 2−, C in CO2, N in NH3).

Can atoms have more than 8 electrons?

Yes. Elements in period 3 and below (P, S, Cl, Xe…) can have expanded octets, as in PCl5 (10 electrons) and SF6 (12).

What does the Lewis structure tell me about shape?

Counting bonded atoms and lone pairs on the central atom gives the VSEPR shape, for example 3 bonds + 1 lone pair = trigonal pyramidal (NH3).

Related chemistry tools

Need to sketch molecules for a report? Draw chemical structures online with MolDraw, a free online ChemDraw alternative (see the ChemDraw vs MolDraw comparison).

Last updated: