Lewis structure generator
Type a molecule, an ion or an ionic compound. You get the structure, where every electron went, and the working, drawn one stage at a time.
Charges go at the end: NH4+, SO4 2-. Organic molecules in bonding order:
CH3CH2OH.
CH3COOH Lewis structure
- 24 valence e−
- trigonal planar
- 120° bond angle
- sp2
- polar
CH3COOH has 24 valence electrons, drawn as one C–C bond, one C=O bond, one C–O bond and four bonds to hydrogen. The central C is sp2 hybridized and the shape is trigonal planar.
Draw it step by step
-
Skeleton. Join every connected pair with one bond. 7 bonds spends 14 electrons.
-
Outer octets. Spend electrons as lone pairs on the outer atoms. That uses the entire budget, and the central atom has nothing left over.
-
Multiple bonds. The central atom is still short of an octet, so one lone pair on the outer atoms moves in to be shared. The electron count does not change - the same electrons are just counted by both atoms now.
Count the valence electrons
Add up the outer-shell electrons every atom brings. That total is the budget for the whole structure - every line and every dot has to come out of it, and nothing may be added.
2 x 4 (C) + 4 x 1 (H) + 2 x 6 (O) = 24 valence electronsWork out what is bonded to what
Read as a condensed structural formula: each atom bonds to the one written before it that still has room, and hydrogens belong to the atom they follow. That is what tells CH3COOH apart from its isomers.
Join everything with single bonds first
Every connection starts as one shared pair. Draw them all before worrying about double bonds - the arithmetic in the next step is what tells you where the double bonds have to go.
7 bonds x 2 = 14 electrons used, 10 leftWork out how far short you are
Add up what every atom still needs to fill its shell - eight electrons for most atoms, two for hydrogen - minus what its single bonds already give it. Compare that with the electrons you have left. The difference decides everything that follows.
needs 12, has 10, short by 2Turn the shortfall into multiple bonds
Being short means atoms have to share more. Every pair that moves from a lone pair into a bond counts twice - once for each atom - so a shortfall of 2 is covered by 1 extra shared pair. That is where the double bond comes from.
C2=O1Fill in the lone pairs
Every electron not in a bond sits as a lone pair on an atom. Each atom takes exactly what it needs to finish its shell - there is no choice left at this point.
O1: 2, O2: 2 (8 electrons)Check the formal charges
Formal charge is valence electrons, minus lone-pair electrons, minus the number of bonds. Every atom here comes out at zero, which is the sign of a good structure.
all formal charges = 0Work out the shape
Count the electron domains on C: 3 bonded groups. A double or triple bond still counts as one domain, because it points in one direction. That gives trigonal planar electron geometry; ignore the lone pairs and the atoms themselves sit in a trigonal planar arrangement.
steric number 3 -> sp2 -> trigonal planar, bond angle 120Decide whether it is polar
The atoms around the centre are not all the same, so the bond dipoles are different sizes and cannot cancel.
dipoles do not cancel -> polar
What you can type
| You want | Type | Notes |
|---|---|---|
| A molecule | XeF4, SO2, HCN | The usual molecular formula. |
| A polyatomic ion | NO3-, SO4 2-, NH4+ | A charge of 2 or more needs a space before it, or SO42- reads as a subscript. |
| An organic molecule | CH3COOH, CH3OCH3, (CH3)2CO | Write the atoms in the order they are bonded. That is what tells ethanol from dimethyl ether. |
| An ionic compound | NaCl, CaCO3, Fe2(SO4)3 | Drawn as ions. Transition-metal charges are worked out from the anion. |
| An element's Lewis symbol | C, O, Cl- | One dot per side before any pair up. |
Lowercase is fine when there is only one sensible reading - co2 is CO2,
nacl is NaCl - and subscripts pasted from a textbook, like SO₄²⁻, are read as typed.
How it draws a structure
- Count the valence electrons, adding one for each negative charge and removing one for each positive charge. That total is the budget, and nothing may be added later.
- Decide what is bonded to what. For a simple molecule the least electronegative atom goes in the middle. An acid keeps its hydrogens on oxygen. A condensed formula is read in the order it is written.
- Join every connected pair with a single bond, then give each atom the lone pairs it needs to fill its shell.
- Try every arrangement of double and triple bonds the electron count allows, and keep the one that fills the most octets with the smallest formal charges. Structures that tie are resonance forms, and all of them are shown.
- Read the shape off the result. The electron domains on each central atom give the geometry, the bond angle and the hybridization - the same way the VSEPR chart is read.
Nothing is looked up: the structure for a formula no one has asked about before is found the same way as the one for CO2.
What it will not draw, and why
Molecular formulas with several isomers. C2H4O is acetaldehyde or
ethylene oxide, and drawing one of them as though it were the answer would be wrong half the
time. The generator asks for the condensed formula instead.
Transition-metal molecules. The octet rule does not describe how a transition metal bonds, so a Lewis structure of one would look confident and be wrong. Their salts - FeCl3, CuSO4 - are drawn as ions, which is how a course treats them.
Rings, other than benzene. A molecular formula does not say whether atoms close into a ring, so chains are drawn open.
Worked examples
These have their own pages, with the full explanation, common questions and related structures. The Lewis structure chart compares every one of them.
- CO2 Carbon dioxide
- SO2 Sulfur dioxide
- H2O Water
- HCN Hydrogen cyanide
- NO2 Nitrogen dioxide
- CH4 Methane
- CO Carbon monoxide
- N2 Nitrogen
- O3 Ozone
- O2 Oxygen
- SO3 Sulfur trioxide
- BF3 Boron trifluoride
- C2H2 Acetylene
- C2H4 Ethylene
- CH2O Formaldehyde
- H2S Hydrogen sulfide
- NH3 Ammonia
- XeF4 Xenon tetrafluoride
- CCl4 Carbon tetrachloride
- CH3OH Methanol
- SF4 Sulfur tetrafluoride
- XeF2 Xenon difluoride
- OF2 Oxygen difluoride
- CS2 Carbon disulfide
- ClF3 Chlorine trifluoride
- NF3 Nitrogen trifluoride
- NO3− Nitrate ion
- SO42− Sulfate ion
- CO32− Carbonate ion
- NO2− Nitrite ion
- NH4+ Ammonium ion
- PO43− Phosphate ion
- OH− Hydroxide ion
- CN− Cyanide ion
- ClO3− Chlorate ion
- SO32− Sulfite ion
- ClO− Hypochlorite ion
- SCN− Thiocyanate ion
- HCO3− Bicarbonate ion
- C2H3O2− Acetate ion
- H3O+ Hydronium ion
- I3− Triiodide ion
Common questions
What can I type into the Lewis structure generator?
A molecular formula (CO2, XeF4), an ion with its charge (SO4 2-, NH4+, NO3-), a condensed structural formula for organic molecules (CH3COOH, CH3CH2OH, (CH3)2CO), an ionic compound (NaCl, CaCO3, Fe2(SO4)3) or a single element for its Lewis dot symbol. Lowercase and pasted subscripts such as SO₄²⁻ are read too.
How do I enter the charge on an ion?
Put the charge after the formula. A single charge can go straight on the end (NO3-, NH4+). A charge of two or more needs a space so it is not read as a subscript: SO4 2-, PO4 3-, CO3 2-.
Why does it ask me to rewrite C2H4O?
Because C2H4O is more than one molecule - acetaldehyde and ethylene oxide share that formula. A molecular formula with two or more carbons does not say how the atoms are joined, so write it in bonding order as a condensed formula, such as CH3CHO, and the generator draws exactly that molecule.
How does it draw ionic compounds like NaCl?
As ions, not as a molecule. The metal gives up its valence electrons and the non-metal takes them, so NaCl is drawn as [Na]+ next to [Cl]- with a full octet of dots. There is no bond line, because nothing is shared.
Why does it show two structures for SO2 and SO4 2-?
Courses disagree about period 3 atoms. One convention keeps every atom at eight electrons and accepts formal charges; the other lets the central atom hold more than eight and minimises formal charge. The generator shows both and says which is which.
Is it free?
Yes. It runs entirely in your browser, with no sign-up and no limit on how many structures you draw.