Home › Calculators › Lewis Structure Generator

Lewis Structure Generator

Type a formula such as H2O, NO3- or SO4^2- to draw its Lewis dot structure. You get the valence electron count, bonds, lone pairs, formal charges, resonance forms and the VSEPR shape, with every step explained.

Last updated:

Write charges after a caret or space: SO4^2-, CO3 2-, NH4+. Condensed formulas like CH3COOH fix the skeleton.

Advertisement
Advertisement

How to use the Lewis Structure Generator

  1. Type a formula, ion or name, for example CO2, NH4+, SO4^2- or ozone. Put the charge after a caret or a space so it isn't read as a subscript.
  2. Press Draw structure or tap one of the examples.
  3. Read the drawing: lines are shared pairs, green dots are lone-pair electrons and orange circles show nonzero formal charges.
  4. Step through resonance forms when the molecule has more than one equivalent structure.
  5. Check the steps and atom table, then download the structure as an SVG or PNG for homework or slides.

How to draw a Lewis structure

  1. Count valence electrons. Add up the group valence electrons of every atom, add one for each negative charge and subtract one for each positive charge.
  2. Draw the skeleton. Put the least electronegative atom (never H or F) in the center and connect every outer atom to it with a single bond. Each bond uses two electrons.
  3. Complete the outer atoms. Give each outer atom lone pairs until it has an octet (hydrogen needs only two electrons).
  4. Put leftover electrons on the central atom. Period 3 and heavier atoms may go beyond eight electrons.
  5. Form multiple bonds if needed. If the central atom still lacks an octet, move a lone pair from an outer atom into a double or triple bond.
  6. Check formal charges. Choose the arrangement with formal charges closest to zero, putting negative charges on the most electronegative atoms.

Formal charge of an atom = valence electrons − lone-pair electrons − number of bonds (each single, double or triple bond counts as 1, 2 or 3).

Valence electrons of main-group elements

GroupValence e⁻ElementsUsual bonds (neutral)
11H, Li, Na, K1 (H); metals form cations
22Be, Mg, Ca2 (Be); metals form cations
133B, Al3, often with an incomplete octet
144C, Si4
155N, P, As3 plus one lone pair
166O, S, Se2 plus two lone pairs
177F, Cl, Br, I1 plus three lone pairs
188Ne, Ar, Kr, Xe0 (Xe and Kr can form expanded-octet compounds)

VSEPR shapes at a glance

Electron domainsLone pairsShapeExample
20Linear (180°)CO₂
30 / 1Trigonal planar / bentBF₃ / SO₂
40 / 1 / 2Tetrahedral / trigonal pyramidal / bentCH₄ / NH₃ / H₂O
50 / 1 / 2 / 3Trigonal bipyramidal / seesaw / T-shaped / linearPCl₅ / SF₄ / ClF₃ / XeF₂
60 / 1 / 2Octahedral / square pyramidal / square planarSF₆ / BrF₅ / XeF₄

A Lewis structure shows which atoms are connected and where the electrons are. It is a flat drawing, so the angles in the picture are not the real bond angles. The VSEPR shape describes the actual 3D geometry. To work out molar masses for the same formulas, use the Molar Mass Calculator.

Frequently asked questions

How do you count valence electrons for a Lewis structure?

Add the valence electrons of every atom (the group number for main-group elements: H 1, C 4, N 5, O 6, halogens 7), then add one electron for each negative charge or subtract one for each positive charge. For SO4²⁻: 6 + 4 × 6 + 2 = 32.

How is the central atom chosen?

The central atom is usually the least electronegative atom that is not hydrogen, often the one that appears only once in the formula, such as C in CO2 or S in SO4²⁻. Hydrogen and fluorine are always terminal because they form only one bond.

What is formal charge?

Formal charge = valence electrons − nonbonding (lone-pair) electrons − number of bonds. The best Lewis structure usually 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.

Why does sulfate show two double bonds instead of all single bonds?

Sulfur is in period 3 and can hold more than eight electrons. Two S=O double bonds give sulfur a formal charge of 0 instead of +2, so many textbooks draw it that way. If your course requires the octet rule, untick "Allow expanded octets" to get the all-single-bond structure with S at +2.

What are resonance structures?

When the same atoms can be connected with the double bonds in different places, such as the three equivalent forms of nitrate (NO3⁻), each drawing is a resonance form. The real ion is a blend of them, with all N–O bonds the same length. Use Next resonance form to see each one.

Which molecules can this tool draw?

Molecules and ions of main-group elements with up to 24 atoms and no rings: simple molecules, polyatomic ions, oxyacids, small organic molecules and simple ionic compounds. Rings (benzene), transition-metal complexes and very large molecules are not supported. For formulas with several isomers, write a condensed formula such as CH3OCH3 to choose the skeleton.

Why are some atoms short of an octet?

Boron, beryllium and aluminum are stable with fewer than eight electrons (BF3, BeCl2), and molecules with an odd number of electrons, such as NO and NO2, must have one unpaired electron.

Are all the tools on FreeToolCabin tested for quality and accuracy?

Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

Related tools

Molar Mass CalculatorMolar mass of any chemical formula with an element-by-element mass % breakdown.Chemical Equation BalancerBalance chemical, ionic and redox equations with the matrix method and steps.Interactive Periodic TableAll 118 elements with colour modes, filters, search and full element details.pH CalculatorConvert pH, pOH, [H+] and [OH-], or find the pH of strong and weak acids and bases.Ohm's Law CalculatorSolve voltage, current, resistance and power from any two values.Resistor Color Code CalculatorRead 4, 5 and 6 band resistor colors, or find colors for a value.Electricity Cost CalculatorEstimate kWh usage and electricity costs.Capacitor Code CalculatorDecode 3-digit capacitor codes to pF, nF and µF, and back.Power Factor CalculatorCalculate power factor, kW, kVA and kVAR, and correction capacitor size.EV Charging Cost CalculatorCost to charge an electric car, per charge, per mile and per km.LED Resistor CalculatorFind the resistor for an LED, with nearest standard value and wattage.Voltage Divider CalculatorVout from R1, R2 and Vin, with loaded and unloaded output.Battery Life CalculatorEstimate how long a battery lasts from its mAh or Wh and the load.Series & Parallel Resistor CalculatorAdd resistors in series or parallel and find standard value combinations.555 Timer CalculatorAstable frequency, duty cycle and monostable pulse width for the NE555 timer.Wire Size CalculatorFind the AWG or kcmil wire size for a load from amps, distance, voltage and allowed voltage drop.Solar Panel CalculatorEstimate solar system size, number of panels and roof area from your monthly kWh and sun hours.Voltage Drop CalculatorVoltage drop in volts and percent for copper or aluminum wire, AWG or mm², 1- or 3-phase.RC Time Constant Calculatorτ = RC, charge % at 1-5τ, and capacitor charge or discharge voltage at any time t.Resonant Frequency CalculatorLC resonant frequency f = 1/(2π√LC), or solve the inductance or capacitance you need.Capacitor Series and Parallel CalculatorTotal capacitance of capacitors in series or parallel, plus stored energy ½CV² and charge.Generator Size CalculatorAdd appliance running and starting watts to find the generator size you need.LED Savings CalculatorYearly savings, kWh saved and payback time when switching old bulbs to LED.Battery Bank Size CalculatorSize a solar or off-grid battery bank: Ah, kWh and battery count from daily Wh and autonomy.Battery Charge Time CalculatorHow long to charge a battery: mAh or Ah, charger current, efficiency and current charge %.Circuit Breaker Size CalculatorBreaker size from watts or amps, voltage and the 125% continuous rule, with a wire gauge.Conduit Fill CalculatorCheck conduit fill % against the NEC 40% limit for EMT, PVC, RMC and more, with pass/fail.Home Electrical Load CalculatorHome service load in VA and amps with NEC demand factors and a 100/150/200 A recommendation.EV Charging Time CalculatorHow long to charge an EV: battery kWh, charge levels and charger kW, with Level 1/2/DC presets.RLC Impedance CalculatorSeries or parallel RLC impedance, phase angle, resonant frequency and Q at any frequency.Inverter Size CalculatorFind the inverter size for your appliances: continuous watts, surge and battery current.ND Filter CalculatorLong exposure shutter speed for any ND filter in stops, ND number or density.Op Amp Gain CalculatorInverting, non-inverting or differential op amp gain in V/V and dB, with output voltage.PCB Trace Width CalculatorMinimum PCB trace width for a current per IPC-2221, for internal and external layers.RC Filter Cutoff CalculatorRC low-pass or high-pass cutoff frequency, solve R or C, with a Bode magnitude chart.Reactance CalculatorInductive and capacitive reactance at any frequency, or solve for L, C or frequency.SMD Resistor Code CalculatorDecode 3-digit, 4-digit and EIA-96 SMD resistor codes, or find the code for a value.Solar Panel Tilt Angle CalculatorBest fixed tilt, seasonal and monthly solar panel angles and direction for any latitude.E-Bike Range CalculatorEstimate e-bike miles or km per charge from battery Wh, assist level, weight, speed and hills.LM317 CalculatorLM317 output voltage from R1 and R2, standard resistors for a target voltage, current limiter.Motor Full Load Current CalculatorFull load amps from motor hp or kW, voltage, phase, efficiency and power factor, with NEC values.Population Growth CalculatorExponential or logistic population growth over time with carrying capacity, table and chart.Rocket Launch ScheduleUpcoming orbital rocket launches with live countdowns, launch windows, pads and filters.Transformer Sizing CalculatorTransformer kVA needed from volts and amps or kW and PF, next standard size and full-load amps.Wire Resistance CalculatorWire resistance from material, AWG or diameter, length and temperature, plus voltage drop.Transformer Turns Ratio CalculatorSolve transformer voltage, turns or turns ratio, with primary/secondary current and VA.UPS Runtime CalculatorEstimate UPS battery backup time from battery V, Ah, count, efficiency and load, with Peukert.PC Power Supply CalculatorEstimate your PC's load watts and the PSU wattage you need, with efficiency running costs.Power to Weight Ratio CalculatorVehicle hp per tonne, lb per hp and kW/kg from power and weight; compare cars and bikes.Solar Charge Controller Size CalculatorSize an MPPT or PWM charge controller in amps from panel watts, Voc, Isc and battery voltage.4-20mA CalculatorScale a 4-20 mA signal to a process value and back, with percent and shunt voltage.Antenna Length CalculatorDipole, quarter-wave and 5/8-wave antenna lengths for any frequency or radio band.Battery Pack Calculator18650, 21700 or LiFePO4 series/parallel pack: voltage, Ah, Wh, max current and weight.DC Circuit SimulatorDraw batteries, resistors, bulbs and switches and see voltages and currents flow live.
See all 51 Electrical & Electronics Calculators →