Lewis structure generator
Draw Lewis dot structures for atoms, ions, molecules and ionic compounds, with charges, formal charges, resonance and shape.
Type a formula (CO2, SO4^2-, CaCl2), a compound name (glucose, aspirin, glycine) or a condensed formula that shows how the atoms connect (CH3CH2OH, CH3COOCH3, CH2=CHCH3). Write charges after a ^, like NH4^+ or O^2-. Formulas are case-sensitive.
How to draw a Lewis structure
1. Add up the valence electrons of every atom. Add one for each negative charge and subtract one for each positive charge. 2. Pick the central atom: the least electronegative one, never hydrogen. 3. Connect every outer atom to it with a single bond (2 electrons each). 4. Give the outer atoms lone pairs until they have octets (hydrogen only needs 2). 5. Put any electrons left over on the central atom. 6. If the central atom still has fewer than 8, turn outer lone pairs into double or triple bonds.
Formal charge
Formal charge = valence electrons − lone pair electrons − number of bonds. The best structure has formal charges as close to zero as possible, with any negative charge on the more electronegative atom. The formal charges always add up to the overall charge.
Ionic compounds and ions
Ionic compounds aren’t drawn with bond lines. The metal loses its valence electrons and is written with just its symbol and charge; the nonmetal gains electrons to complete its octet and is written in brackets with its charge. Polyatomic ions like NO₃⁻ are drawn with covalent bonds inside brackets, with the overall charge outside.
Larger molecules
A molecular formula like C₆H₁₂O₆ doesn’t say which atoms are bonded to which: glucose, fructose and galactose all share it. So for larger molecules, type the compound’s name or a condensed formula such as CH3CH2OH, where the order of the groups shows the connections. The tool then gives every atom its usual number of bonds (C 4, N 3, O 2, H 1), adds double or triple bonds where needed, and completes each octet with lone pairs.
Exceptions to the octet rule
Boron, beryllium and aluminum compounds can be stable with fewer than 8 electrons (BF₃, BeCl₂). Molecules with an odd number of electrons, like NO and NO₂, have an unpaired electron. Elements in period 3 and below, like S, P, Cl and Xe, can hold more than 8 (SF₆, PCl₅, XeF₄).