Lewis Structure Generator & Lewis Dot Structure Maker
Type a formula — CO2, NH4+, SO4 2- — and the structure is computed on the spot: valence electrons, bonds, lone pairs, formal charges and resonance. The AI then draws it as a clean textbook figure, dot for dot.
Or start from an example
Lewis structure finishes
One real render per finish, each a different molecule — click a card to apply the finish, or take its prompt into the composer.
What is a Lewis structure?
A Lewis structure (Lewis dot structure, electron dot diagram) shows how the valence electrons of a molecule or ion are arranged: shared pairs as bond lines between element symbols, unshared pairs as dots. It is the first model of bonding taught in chemistry and the starting point for predicting shape, polarity and reactivity.
About this Lewis structure generator
- Type a formula anywhere in the description — CO2, H2SO4, NH4+, SO4 2-, [NO3]- or SO₄²⁻ — or a common name such as ammonia or ozone.
- The structure is computed by code with the octet method: valence electrons are counted, the skeleton is built around the least electronegative atom, and every arrangement of single, double and triple bonds is scored by formal charge.
- Equivalent resonance structures are counted, and expanded octets (SF6, XeF4, SO4 2-) and incomplete ones (BF3, BeCl2) are handled.
- It covers diatomics, molecules and ions with one central atom, and two identical centres such as C2H4, N2H4 and H2O2; rings and longer chains are refused rather than guessed.
- VSEPR geometry, the bond angle and polarity are shown next to the structure before anything is generated — a free Lewis structure calculator in the box itself.
How formal charge is calculated
Formal charge is the charge an atom would carry if every bond were shared equally: its valence electrons minus the electrons it keeps as lone pairs minus half the electrons in its bonds. The best Lewis structure keeps formal charges as close to zero as possible, with any negative charge on the most electronegative atom.
FC = V − N − B/2
In words
V is the atom’s number of valence electrons, N the number of electrons in its lone pairs and B the number of electrons in its bonds. In carbon monoxide, carbon has 4 − 2 − 6/2 = −1 and oxygen 6 − 2 − 6/2 = +1, and the two add up to the molecule’s charge of 0.
The formal charges of all atoms always add up to the charge of the molecule or ion — a quick check on any structure.
How to draw a Lewis structure
Type the formula
Write the molecule or ion in the box — NH3, CO3 2-, XeF4. The computed structure appears above the box straight away, with its valence electron count, geometry and resonance.
Pick a finish
Textbook black on white for worksheets and papers, element colors for slides, chalkboard for teaching. The finish changes the look, never a bond or a dot.
Generate and refine
The AI draws exactly the computed bonds, lone pairs and charges. Keep editing in chat — ask for all resonance structures or a different molecule — then export as PNG, SVG or PPTX.
The octet method, step by step
Every structure this generator draws follows the method taught in general chemistry — here it is applied to the sulfate ion, SO4 2-.
| Step | What you do | SO4 2- example |
|---|---|---|
| 1. Count valence electrons | Add the valence electrons of every atom; add one per negative charge, subtract one per positive charge | 6 + 4 × 6 + 2 = 32 |
| 2. Build the skeleton | Put the least electronegative atom in the center (never H) and join each outer atom with a single bond | S in the center, four S–O bonds (8 electrons) |
| 3. Complete the outer octets | Give each outer atom lone pairs until it has 8 electrons (H needs only 2) | Three lone pairs on each O (24 electrons) |
| 4. Place what is left | Any remaining electrons go on the central atom as lone pairs | None left: 32 − 8 − 24 = 0 |
| 5. Complete the central octet | If the center has fewer than 8, turn outer lone pairs into double or triple bonds | S already has 8 (octet form, S +2) |
| 6. Minimize formal charges | Prefer the arrangement with formal charges closest to zero; atoms from period 3 on may exceed 8 | Two S=O double bonds: S 0, two O −1 |
Steps 5 and 6 are where hand-drawn structures most often go wrong — this generator scores every arrangement of single, double and triple bonds and keeps the one with the lowest formal charges.
Lewis structure vs structural formula vs molecular geometry
A Lewis structure shows every valence electron, a structural formula shows only the bonds, and a molecular geometry (VSEPR) model shows the 3D shape.
| Question | Lewis structure | Structural formula | Molecular geometry (VSEPR) |
|---|---|---|---|
| Lone pairs | Shown as dots | Usually left out | Count toward the shape; drawn as lobes, if at all |
| Formal charges | Shown on each atom | Only net charges | Not shown |
| 3D shape | Not shown — a flat 2D drawing | Sometimes, with wedges and dashes | Shown, with bond angles |
| Typical use | Counting electrons, formal charge, resonance | Organic chemistry, reaction schemes | Predicting polarity and bond angles |
| Made with | This generator | A chemical structure editor | A 3D model kit or molecular viewer |
The generator draws the Lewis structure and lists the VSEPR geometry and bond angle beside it; ask in the description if you want the shape written on the figure.
Where Lewis structures are used
Lewis structures are used wherever you need to see where the electrons are — in class, on exams and as the first step in predicting how a molecule behaves.
Worksheets and exams
Clean, correct structures for answer keys, practice sheets and quiz questions, in black and white that photocopies well.
Lecture slides
Element-colored structures that read from the back of a lecture hall, with formal charges and brackets where they belong.
Resonance and formal charge lessons
The equivalent resonance structures of nitrate, carbonate or ozone side by side, joined by resonance arrows.
Predicting shape and polarity
The Lewis structure is the input to VSEPR: count the bonding and lone pairs around the central atom to get the geometry and bond angle.
Lewis structure questions, answered
How do you draw a Lewis structure?
Count the valence electrons, join the atoms with single bonds around the least electronegative atom, complete the outer octets, put leftover electrons on the center, then form double or triple bonds until the center has an octet. Type a formula in the box above to see the result of each step computed instantly.
How do you find the number of valence electrons?
Add the valence electrons of every atom (its group number for main-group elements), then add one for each negative charge and subtract one for each positive charge. CO2 has 4 + 2 × 6 = 16; NH4+ has 5 + 4 − 1 = 8; SO4 2- has 6 + 24 + 2 = 32.
What is the Lewis dot structure of water (H2O)?
Oxygen in the center bonded to two hydrogens by single bonds, with two lone pairs on the oxygen — 8 valence electrons in all. The molecule is bent, with an H–O–H angle of 104.5°.
How does the generator choose the central atom?
It puts the least electronegative atom other than hydrogen in the center — carbon before nitrogen, sulfur or phosphorus before oxygen, never hydrogen or fluorine. Oxyacids written H-first, such as H2SO4 or HNO3, get their hydrogens on oxygen.
Does it show formal charges?
Yes — every non-zero formal charge is drawn next to its atom, and ions are drawn in square brackets with the overall charge at the top right. Among the possible structures, the one with formal charges closest to zero wins.
Can it draw resonance structures?
Yes. It counts the equivalent resonance structures — 3 for nitrate, 2 for ozone, 6 for sulfate — and draws one by default. Ask for “all resonance structures” to get up to three side by side with resonance arrows.
What about expanded or incomplete octets?
Both are handled: atoms from period 3 on can hold more than 8 electrons (PCl5, SF6, XeF4), and boron and beryllium keep fewer (BF3 has 6 around boron). When an expanded octet lowers the formal charges, as in SO4 2-, the preview says so and names the all-octet alternative.
Which molecules does it not handle?
Rings, chains of three or more heavy atoms, condensed formulas such as CH3OH, C3H8 or C6H6, and ionic compounds like NaCl. It refuses these with a clear message instead of letting the AI guess a structure.
Is a Lewis dot structure the same as an electron dot diagram?
Yes — Lewis structure, Lewis dot structure, Lewis dot diagram and electron dot diagram all name the same drawing. Some textbooks keep “Lewis symbol” for a single atom with its valence dots.
Does it show the molecular shape?
The preview lists the VSEPR class, the molecular geometry, the bond angle and the polarity next to the structure. The figure itself is the flat Lewis structure; ask in the description if you want the geometry written on it.
Is this Lewis structure generator free?
Yes to start — every new account gets 100 free credits and no card is required to sign up. The computed structure in the preview costs nothing; credits are spent only when you generate the figure. Search for a Lewis structure maker, a Lewis structure drawer or a Lewis structure calculator and you land on the same thing: a formula in, an exact electron dot diagram out.
Sources
- 7.3 Lewis Symbols and Structures — OpenStax Chemistry 2e
- 7.4 Formal Charges and Resonance — OpenStax Chemistry 2e
- Lewis formula (electron dot or Lewis structure) — IUPAC Gold Book
Keep exploring
Our other diagram tools, and the guides behind them.
Draw your Lewis structure
From a formula to a textbook-clean electron dot diagram in about a minute — every bond and dot computed, the drawing handled by the AI.
Start drawing