Skip to main content

Lewis Structure Generator

Generate Lewis structures, count valence electrons, calculate formal charges, and learn bonding with step-by-step visuals.

Background

Lewis structures show how valence electrons are arranged as bonds and lone pairs. This generator helps students build structures, check octets, compare formal charges, and recognize resonance for common general chemistry molecules and polyatomic ions.

Generate a Lewis structure

Choose mode

Use guided generator, electron count, formal charge helper, or resonance examples.

Formula input

Best for common Gen Chem structures: H2O, H2S, NH3, PH3, CH4, CCl4, CH2O, CO2, SO2, SO3, NO2-, NO3-, ClO3-, ClO4-, SO4^2-, CO3^2-, O3, BF3, PCl5, SF6, XeF2, XeF4, HCN, and similar formulas. Parentheses such as Ca(OH)2 are not supported yet.

Valence electron count

Formal charge helper

Bond order sum counts a single bond as 1, double bond as 2, and triple bond as 3.

Resonance example

Learning options

Result

No result yet. Enter a formula, then click Generate.

How to use this generator

  • Enter a formula such as CO2, NH3, NO3-, or SO4^2-.
  • Use auto charge detection or choose the charge manually.
  • Click Generate to see valence electron count, bonding layout, lone pairs, formal charges, and octet notes.
  • Use resonance mode for ions and molecules with multiple valid electron arrangements.

How this calculator works

The generator first parses the formula and charge, then counts total valence electrons. For supported Gen Chem examples, it uses a curated preset so the structure, lone pairs, formal charges, expanded-octet notes, and resonance contributors are shown with higher confidence. For other simple formulas, it builds a guided skeleton by choosing a central atom, connecting terminal atoms, distributing lone pairs, and asking you to verify octets and formal charges.

The result area is designed for learning: it shows the structure confidence badge, the reason for the central atom choice, bracketed ion drawings, resonance previews when relevant, an octet/duet status table, and copyable summaries for notes.

Formula & Rules Used

Total valence electrons: add valence electrons for each atom, add electrons for negative charge, subtract electrons for positive charge.

Formal charge: FC = valence − nonbonding electrons − bond order sum.

Octet rule: second-row atoms usually prefer 8 electrons; hydrogen prefers 2 electrons.

Resonance: when multiple valid structures differ only in electron placement, the real structure is represented by resonance contributors.

Example Problems & Step-by-Step Solutions

Example 1: CO2

CO2 has 16 valence electrons. Carbon goes in the center, and two C=O double bonds give every atom an octet with formal charges of 0.

Example 2: NH3

NH3 has 8 valence electrons. Nitrogen forms three N–H bonds and keeps one lone pair.

Example 3: NO3-

NO3- has 24 valence electrons. One N=O bond and two N–O bonds can be drawn in three equivalent resonance positions.

Frequently Asked Questions

What is a Lewis structure?

A Lewis structure is a diagram that shows valence electrons as bonds and lone pairs around atoms.

How do I choose the central atom?

Hydrogen is never central. In many simple molecules, the least electronegative non-hydrogen atom is central.

What is formal charge?

Formal charge estimates how electrons are assigned in a Lewis structure and helps compare possible structures.

Why do some structures have resonance?

Resonance occurs when the same atoms can be connected with equivalent electron arrangements that differ only in bond and lone-pair placement.

Ions
2. Atoms & Elements
3 problems
Topic
Jules
Polyatomic Ions
3. Chemical Reactions
3 problems
Topic
Jules
Valence Electrons of Elements
10. Periodic Properties of the Elements
4 problems
Topic
Jules
Periodic Trend: Electronegativity
10. Periodic Properties of the Elements
2 problems
Topic
Jules
Lewis Dot Symbols
11. Bonding & Molecular Structure
5 problems
Topic
Jules
Chemical Bonds
11. Bonding & Molecular Structure
4 problems
Topic
Jules
Octet Rule
11. Bonding & Molecular Structure
2 problems
Topic
Jules
Formal Charge
11. Bonding & Molecular Structure
4 problems
Topic
Jules
Lewis Dot Structures: Neutral Compounds
11. Bonding & Molecular Structure
6 problems
Topic
Jules
Lewis Dot Structures: Sigma & Pi Bonds
11. Bonding & Molecular Structure
5 problems
Topic
Jules
Lewis Dot Structures: Ions
11. Bonding & Molecular Structure
1 problem
Topic
Jules
Lewis Dot Structures: Exceptions
11. Bonding & Molecular Structure
4 problems
Topic
Jules
Lewis Dot Structures: Acids
11. Bonding & Molecular Structure
2 problems
Topic
Jules
Resonance Structures
11. Bonding & Molecular Structure
6 problems
Topic
Jules
Average Bond Order
11. Bonding & Molecular Structure
1 problem
Topic
Jules
2. Atoms & Elements - Part 1 of 4
6 topics 13 problems
Chapter
Jules
2. Atoms & Elements - Part 2 of 4
6 topics 12 problems
Chapter
Jules
2. Atoms & Elements - Part 3 of 4
6 topics 11 problems
Chapter
Jules
2. Atoms & Elements - Part 4 of 4
5 topics 8 problems
Chapter
Jules
3. Chemical Reactions - Part 1 of 3
5 topics 10 problems
Chapter
Jules
3. Chemical Reactions - Part 2 of 3
6 topics 10 problems
Chapter
Jules
3. Chemical Reactions - Part 3 of 3
5 topics 12 problems
Chapter
Jules
10. Periodic Properties of the Elements - Part 1 of 3
5 topics 11 problems
Chapter
Jules
10. Periodic Properties of the Elements - Part 2 of 3
6 topics 11 problems
Chapter
Jules
10. Periodic Properties of the Elements - Part 3 of 3
6 topics 13 problems
Chapter
Jules
11. Bonding & Molecular Structure - Part 1 of 4
4 topics 11 problems
Chapter
Jules
11. Bonding & Molecular Structure - Part 2 of 4
4 topics 11 problems
Chapter
Jules
11. Bonding & Molecular Structure - Part 3 of 4
5 topics 11 problems
Chapter
Jules
11. Bonding & Molecular Structure - Part 4 of 4
4 topics 11 problems
Chapter
Jules
Octet Rule
1. A Review of General Chemistry
2 problems
Topic
Ernest
Formal Charges
1. A Review of General Chemistry
5 problems
Topic
Johnny
Lewis Structure
1. A Review of General Chemistry
7 problems
Topic
Johnny
Resonance Structures
1. A Review of General Chemistry
7 problems
Topic
Johnny
1. A Review of General Chemistry - Part 1 of 3
7 topics 14 problems
Chapter
Johnny
1. A Review of General Chemistry - Part 2 of 3
5 topics 13 problems
Chapter
Johnny
1. A Review of General Chemistry - Part 3 of 3
6 topics 13 problems
Chapter
Johnny
27. Transition Metals
6 topics 14 problems
Chapter
Johnny
Covalent Bonds
2. Chemistry
4 problems
Topic
Jason
2. Chemistry
7 topics 12 problems
Chapter
Jason
Covalent Bonds
2. Cell Chemistry & Cell Components
4 problems
Topic
Bruce
2. Cell Chemistry & Cell Components - Part 1 of 4
11 topics 12 problems
Chapter
Bruce
2. Cell Chemistry & Cell Components - Part 2 of 4
10 topics 12 problems
Chapter
Bruce
2. Cell Chemistry & Cell Components - Part 3 of 4
8 topics 10 problems
Chapter
Bruce
2. Cell Chemistry & Cell Components - Part 4 of 4
10 topics 11 problems
Chapter
Bruce
Ions and the Octet Rule
2. Atoms and the Periodic Table
3 problems
Topic
Jules
Polyatomic Ions
3. Ionic Compounds
3 problems
Topic
Jules
Covalent Bonds
4. Molecular Compounds
4 problems
Topic
Jules
Multiple Bonds
4. Molecular Compounds
1 problem
Topic
Jules
Lewis Dot Structures: Multiple Bonds
4. Molecular Compounds
3 problems
Topic
Jules
2. Atoms and the Periodic Table - Part 1 of 3
6 topics 14 problems
Chapter
Jules
2. Atoms and the Periodic Table - Part 2 of 3
12 topics 14 problems
Chapter
Jules
2. Atoms and the Periodic Table - Part 3 of 3
10 topics 14 problems
Chapter
Jules
3. Ionic Compounds - Part 1 of 2
5 topics 9 problems
Chapter
Jules
3. Ionic Compounds - Part 2 of 2
6 topics 9 problems
Chapter
Jules
4. Molecular Compounds - Part 1 of 2
8 topics 13 problems
Chapter
Jules
4. Molecular Compounds - Part 2 of 2
8 topics 12 problems
Chapter
Jules
Polyatomic Ions
5. Molecules and Compounds
5 problems
Topic
Ions and the Octet Rule
9. Electrons in Atoms and the Periodic Table
5 problems
Topic
Covalent Bonds
10. Chemical Bonding
5 problems
Topic
Multiple Bonds
10. Chemical Bonding
5 problems
Topic
Lewis Dot Structures: Multiple Bonds
10. Chemical Bonding
5 problems
Topic
5. Molecules and Compounds
11 topics 33 problems
Chapter
9. Electrons in Atoms and the Periodic Table - Part 3 of 4
12 topics 36 problems
Chapter
10. Chemical Bonding - Part 1 of 2
12 topics 35 problems
Chapter
10. Chemical Bonding - Part 2 of 2
4 topics 12 problems
Chapter
Covalent Bonds
3. Chemical Principles of Microbiology
4 problems
Topic
Monica
3. Chemical Principles of Microbiology
7 topics 12 problems
Chapter
Nicole
Chemical Bonds
2. Chemical Components of Cells
7 problems
Topic
2. Chemical Components of Cells
5 topics 14 problems
Chapter
Chemical Bonds
1. Introduction to Biochemistry
7 problems
Topic
1. Introduction to Biochemistry - Part 1 of 4
5 topics 14 problems
Chapter
1. Introduction to Biochemistry - Part 2 of 4
5 topics 13 problems
Chapter
1. Introduction to Biochemistry - Part 3 of 4
5 topics 13 problems
Chapter
1. Introduction to Biochemistry - Part 4 of 4
5 topics 13 problems
Chapter
All calculators