Free chemistry tool
Lewis dot structure generator with formal charges
Type a formula such as CO2, NH3, or SO4 2- and this Lewis structure maker counts the valence electrons, picks the central atom, draws the bonds and lone pairs, and reports the formal charge on every atom along with the VSEPR electron geometry, molecular shape, and bond angle.
Write the charge after a space: SO4 2-. A bare + or - means a single charge, so NH4+ works.
- Valence electrons
- 16
- Central atom
- C (Carbon)
- Electrons on centre
- 8
- Electron domains
- 2
- Electron geometry
- Linear
- Molecular shape
- Linear
- Bond angle
- 180°
- Overall charge
- Neutral
| Atom | Bond | Lone pairs | Formal charge |
|---|---|---|---|
| C (central) | — | 0 | 0 |
| O | Double | 2 | 0 |
| O | Double | 2 | 0 |

How to draw a Lewis dot structure
A Lewis structure accounts for every valence electron in a molecule, showing which are shared in bonds and which sit as lone pairs. The procedure is mechanical once you know the steps, and the tool above follows exactly these.
- Count the valence electrons. Add up the group-derived valence count for every atom, then add one electron for each negative charge and subtract one for each positive charge. CO2 gives 4 + 6 + 6 = 16; SO4 2- gives 6 + 24 + 2 = 32.
- Pick the central atom. It is the least electronegative atom that is not hydrogen. Hydrogen only ever forms one bond, so it is always terminal.
- Join every terminal atom to the centre with a single bond, using two electrons each.
- Complete the octets on the terminal atoms, giving hydrogen a duet of two rather than eight.
- Place any remaining electrons on the central atom as lone pairs.
- If the centre is still short of an octet, convert a lone pair from a terminal atom into a second or third bond.
- Check the formal charges and confirm they add up to the overall charge on the species.
Formal charge, and why it decides the structure
Formal charge is the bookkeeping that tells you which of several possible structures is the one to draw. It is calculated as valence electrons minus lone-pair electrons minus the number of bonds.
- Formal charge = valence − (lone-pair electrons) − (number of bonds). For the oxygen in a C=O double bond: 6 − 4 − 2 = 0.
- The best structure is the one with formal charges closest to zero, and with any negative formal charge sitting on the most electronegative atom.
- This is why CO2 is drawn with two double bonds. With two single bonds carbon carries +2 and each oxygen −1; with two double bonds every atom is neutral.
- It is also why BF3 keeps boron electron-deficient at six electrons. Forming a B=F double bond would complete boron’s octet but put +1 on fluorine, the most electronegative element of all, which is worse than leaving boron short.
- Formal charges must sum to the overall charge on the species: zero for a neutral molecule, −2 for the sulfate ion.
When the octet rule does not apply
The octet rule is a strong guideline for period 2 elements and a weaker one below that. Three classes of exception come up constantly in coursework.
- Electron-deficient centres. Beryllium is stable with four electrons and boron with six. BF3 and BeCl2 are the standard examples, and forcing an octet on them produces a worse structure.
- Expanded octets. From period 3 downward an atom can hold more than eight electrons, because d orbitals are energetically accessible. PCl5 has ten electrons on phosphorus, SF6 has twelve on sulfur, and XeF4 has twelve on xenon.
- Odd-electron species. Radicals such as NO and NO2 have an odd total, so one electron necessarily stays unpaired and no arrangement satisfies every octet.
- A useful check: if your central atom is in period 2, it can never exceed eight electrons. Nitrogen with four bonds carries a positive formal charge, as in the ammonium ion, rather than an expanded octet.
From Lewis structure to molecular shape
Once the structure is drawn, VSEPR theory converts it into a three-dimensional shape. Electron domains repel each other and settle as far apart as possible, and a lone pair takes more room than a bonding pair.
- Count electron domains on the central atom: each bond counts once regardless of whether it is single, double, or triple, and each lone pair counts once.
- Two domains give linear at 180°, three trigonal planar at 120°, four tetrahedral at 109.5°, five trigonal bipyramidal, six octahedral.
- The molecular shape is what you see when the lone pairs are made invisible. Four domains with one lone pair is trigonal pyramidal, like NH3; with two lone pairs it is bent, like H2O.
- Lone pairs compress the remaining angles: 109.5° in methane becomes about 107° in ammonia and about 104.5° in water, as each additional lone pair pushes harder.
- The tool reports the electron geometry and the molecular shape separately, because confusing the two is the most common VSEPR error.
Frequently asked questions
Is this Lewis dot structure generator free?
Yes. It runs entirely in your browser, needs no account, and exports PNG and SVG without a watermark. Nothing you type is uploaded to a server.
How do I enter an ion?
Write the charge after a space, as in "SO4 2-" or "NO3 -". A bare plus or minus with no space means a single charge, so "NH4+" and "OH-" both work. Writing "SO42-" without a space is ambiguous, because the 2 could be a subscript, so the tool reads it as a formula rather than a charge.
How does it choose the central atom?
The least electronegative atom that is not hydrogen. Hydrogen forms only one bond so it is always terminal. For most formulas this reproduces the conventional choice: carbon in CO2, sulfur in SO4 2-, nitrogen in NH3.
Why does BF3 not have a double bond?
Because completing boron’s octet would cost more than it gains. A B=F bond leaves fluorine with a formal charge of +1, and fluorine is the most electronegative element, so that structure is worse than leaving boron with six electrons. The tool applies this formal-charge test rather than blindly forcing an octet.
Which elements does it handle?
Main-group elements through period 5, covering the ones that appear in general chemistry: H, Li through Ne, Na through Ar, K, Ca, Ga through Kr, plus I and Xe. Transition metals are out of scope, because their bonding is not well described by a simple Lewis structure.
Does it show resonance structures?
No. It draws one valid structure. Species such as ozone, the nitrate ion, and the carbonate ion have several equivalent resonance forms, and the real molecule is a hybrid of them. Where the tool distributes bonds unevenly, as in SO2, the other resonance form is the mirror image.
What is the difference between electron geometry and molecular shape?
Electron geometry counts every domain around the central atom, bonds and lone pairs alike. Molecular shape describes only the positions of the atoms, ignoring the lone pairs. Water has tetrahedral electron geometry but a bent molecular shape, because two of its four domains are lone pairs.
Related tools
Bohr Model Maker
Draw labelled atomic models with electron shells for any element.
Molecular Orbital Diagram
Build MO diagrams with bonding and antibonding levels.
Chemistry Diagram Generator
Draw reaction mechanisms, energy diagrams, and chemistry figures.
ChemDraw Alternative
When to use a structure editor and when an AI figure tool is faster.
Need a full chemistry figure?
SciFigure AI turns mechanisms, structures, and reaction schemes into publication-ready figures for papers and slides.
Explore the chemistry toolsLast checked: September 20, 2026. Sources: OpenStax Chemistry 2e: Lewis Symbols and Structures; OpenStax Chemistry 2e: Molecular Structure and Polarity (VSEPR).



