Chemistry Tools Molar Mass Calculator Balancing Equations Calculator Lewis Dot Structure Generator Stoichiometry Calculator 3D Molecule Builder pH Calculator Moles to Atoms Conversion
Maths Tools GCF Calculator Golden Ratio Calculator Pascal's Triangle
Physics Tools Circular Motion Calculator Centripetal Force Calculator
Home Feedback
Free · No Signup · Instant Diagrams

Lewis Dot Structure Generator

Type any molecular formula — CO₂, H₂O, N₂, SO₂, MgCl₂, Br₂ and more — and get a fully worked Lewis diagram with valence electrons, bonding pairs, lone pairs and formal charges calculated in real time.

0 ssetup time
1–20atoms supported
PNG/SVGexport ready

Share this tool

More Maths Calculators

GCF Calculator Golden Ratio Gradient Calculator Hyperbolic Functions Interval Notation Inverse Variation Matrix Power NOR Calculator Orthocenter Calculator Pascal's Triangle
Why use this tool

Everything you need to master Lewis structures

Built for students, teachers and anyone who wants a fast, accurate lewis diagram generator with real chemistry rules — not guesses.

Real octet-rule engine

Valence electrons, bonding pairs and lone pairs are computed live using the actual octet-filling algorithm, not a static image library.

Covalent & ionic support

Molecular compounds like CO₂ get shared dot pairs; salts like MgCl₂ automatically switch to a cation / anion charge diagram.

Formal charge breakdown

Every atom's formal charge is calculated and flagged, so you can double-check resonance structures and stability at a glance.

Real-time validation

The formula field checks capitalisation, element symbols and charge notation as you type, catching typos before you submit.

One-click export

Copy the structure summary to your clipboard or download the diagram as a PNG for assignments, slides and lab reports.

Instant results

No page reloads or waiting rooms — the generator solves and draws the structure client-side the moment you submit.

Method

How the Lewis structure builder works

The same four steps a chemistry teacher would use on a whiteboard, applied automatically to your formula.

01

Count valence electrons

Every atom's group-number electrons are added together (adjusted for any overall ionic charge you enter).

02

Pick the central atom

The least electronegative non-hydrogen atom becomes the skeleton's center; every other atom bonds to it.

03

Distribute lone pairs

Remaining electrons fill outer atoms to a full octet first, then the center, following standard bonding priority.

04

Complete the octet

If the central atom is short, a neighboring lone pair becomes a double or triple bond until every atom is stable.

The Generator

Build your Lewis dot structure

Enter a chemical formula exactly as written (case sensitive), e.g. H2O, CO2, SO2, MgCl2.

Use standard capitalisation: carbon is C, cobalt is Co, chlorine is Cl.

Structure summary

Formal charges

Guide

Understanding Lewis Dot Structures

A Lewis dot structure is a shorthand drawing that chemists use to show how the outermost, or valence, electrons of atoms are arranged when they join to form a molecule or an ion. Instead of memorising each shape from a textbook, a Lewis diagram generator applies the same logic a chemistry student would use by hand: count every valence electron in the formula, work out which atom sits in the middle, share electron pairs to form bonds, and then park whatever is left over as lone pairs until each atom has a full outer shell. That is exactly the process this lewis structure builder runs the moment you press generate, which is why the diagrams you get back match what you would draw on paper or see in a lab manual.

What is a Lewis dot structure used for?

Teachers introduce Lewis structures early in general chemistry because they explain, in one picture, why water bends into an angle, why carbon dioxide is a straight line, and why table salt does not behave like a typical molecule at all. Once you can read a diagram you can predict a molecule's shape, guess whether it will be polar, and reason about how reactive it might be. That is also why so many students search for a lewis diagram generator rather than working every formula out from scratch during an exam review session — the tool does the electron bookkeeping instantly and lets you focus on understanding the shape and the chemistry behind it.

How to build a structure step by step

Start by adding up the valence electrons contributed by every atom in the formula, remembering to add one electron for each negative charge or subtract one for each positive charge if you are drawing an ion. Next, choose the least electronegative atom that is not hydrogen as the centre of the molecule, since hydrogen can never take more than one bond. Connect every remaining atom to that centre with a single bond, which uses up two electrons per connection. Whatever electrons remain are placed on the outer atoms first, filling each one to eight electrons, and any leftover pairs go on the central atom. Finally, check whether the central atom has a full octet; if it does not, move a lone pair from a neighbouring atom into the bond to create a double or triple bond, repeating until every atom is satisfied.

Worked examples from common formulas

The lewis dot structure of CO2 is one of the clearest examples of this process in action: carbon sits in the centre with sixteen total valence electrons to place, and because a single bond to each oxygen leaves carbon two electrons short of an octet, both connections become double bonds, giving oxygen two lone pairs each and carbon none. Water works differently — with eight valence electrons total, oxygen keeps two lone pairs after forming single bonds to both hydrogens, which is also why the molecule bends into its familiar shape rather than staying straight. Nitrogen gas, written N2, only has two atoms to work with, so all ten valence electrons go into a triple bond between the nitrogens plus one lone pair on each side, explaining why the N2 triple bond is so difficult to break.

Sulfur dioxide is a slightly trickier case: sulfur is the centre of the lewis dot structure of SO2, and because sulfur can hold more than eight electrons, the real molecule is best described as a resonance hybrid with one double bond and one single bond to the two oxygens, plus a lone pair sitting on sulfur itself. Bromine, on the other hand, only ever appears as Br2, a simple diatomic molecule where two bromine atoms share a single bond and each keeps three lone pairs to complete its own octet. Compounds like the lewis dot structure of MgCl2 are different again, because magnesium and chlorine are not sharing electrons at all — magnesium gives up both of its valence electrons to become a 2+ ion, while each chlorine atom accepts one electron to become a 1− ion with a full set of four lone pairs, so the "structure" is really a pair of separate ions rather than a covalently bonded molecule.

FormulaNameBond typeCentral atom
H2OWaterCovalent, bentOxygen
CO2Carbon dioxideCovalent, linear (double bonds)Carbon
N2Nitrogen gasCovalent, triple bond
SO2Sulfur dioxideCovalent, bent (resonance)Sulfur
MgCl2Magnesium chlorideIonic
Br2BromineCovalent, single bond

Tips for getting accurate results

Type formulas with correct capitalisation, since "co" and "Co" mean carbon monoxide and cobalt respectively, and this lewis structure builder relies on that distinction to identify each element correctly. For ions, use the charge field rather than typing a plus or minus sign into the formula itself, and remember that very large or unusual formulas outside common general-chemistry coursework may not have a single definitive structure, in which case the tool will flag the result as approximate. With practice, most students find that comparing a hand-drawn attempt against the generator's output is one of the fastest ways to catch small mistakes, like forgetting a lone pair or miscounting valence electrons, before a quiz or lab report is due.

FAQ

Frequently asked questions

How do you do a Lewis dot structure step by step?+

Add up every atom's valence electrons, choose the least electronegative non-hydrogen atom as the centre, connect all other atoms to it with single bonds, fill outer atoms to a full octet with the remaining electrons, place any leftovers on the centre, and convert an outer lone pair into a double or triple bond if the centre still needs more electrons.

What is the Lewis dot structure of CO2?+

Carbon dioxide's structure has carbon in the middle double-bonded to each oxygen atom, giving every atom eight electrons overall — two lone pairs on each oxygen and none on carbon — in a straight, linear arrangement.

Why isn't MgCl2 drawn like a normal covalent molecule?+

Magnesium chloride is ionic, not covalent, so the diagram shows a magnesium ion with a 2+ charge and no dots, alongside two separate chloride ions, each in brackets with four lone pairs and a 1− charge, rather than shared bonding pairs.

Keep exploring science calculators

From molar mass to circular motion, SEOWebChecker has free tools for every unit of your coursework.