Lewis Structure Electron Calculator

Count valence electrons, bonding pairs, and lone pairs for a simple molecule.
Enter the central atom and surrounding atoms to see the electron accounting.

Electron Accounting

A Lewis structure shows how the valence electrons of all atoms in a molecule are arranged: which atoms are bonded, where the lone pairs sit, and where any formal charges live. Drawing a correct Lewis structure is the entry point to predicting molecular geometry, polarity, and reactivity.

The procedure (simplified):

  1. Sum all valence electrons across all atoms. For ions, add electrons for each negative charge or subtract for each positive charge. The result is the total electron budget for the structure.

  2. Place the least electronegative atom in the center (usually the unique atom in the formula). Surround it with the others.

  3. Connect each surrounding atom to the central atom with a single bond (2 electrons each).

  4. Distribute remaining electrons as lone pairs on outer atoms first (giving them octets), then on the central atom.

  5. If the central atom does not have an octet, convert lone pairs from neighbors into double or triple bonds until it does.

This calculator does the electron accounting step. It tells you total valence electrons, how many electrons go to bonds (assuming all single bonds first), and how many remain as lone pairs.

Worked example: methane CH₄. Central C has 4 valence electrons. Four H atoms contribute 1 each, totaling 4 + 4 = 8 valence electrons. Four C-H single bonds use 8 electrons. Zero lone pairs. C now has an octet through bonding. Done.

Worked example: water H₂O. Central O has 6 valence electrons. Two H atoms contribute 2 more, total 8. Two O-H bonds use 4 electrons. Remaining 4 electrons become 2 lone pairs on O. O has the octet (4 bonding + 4 lone pair). Done.

Worked example: carbon dioxide CO₂. Central C has 4. Two oxygens contribute 12. Total 16. Single bonds use 4. The remaining 12 distribute as lone pairs but C lacks an octet, so promote two lone pairs to a second bond on each oxygen. Result: O=C=O with two lone pairs on each O. C has 8 electrons through 4 bonding pairs, each O has 8 (4 bonding + 4 lone pair).

Three cases where “make a double bond” is the wrong advice

Step 5 of the procedure is the one that goes wrong most often, because it only works if the geometry allows it.

The first case is boron. BF₃ and BH₃ genuinely stop at six electrons on the central atom, and every experiment agrees. Fluorine holds its lone pairs far too tightly to share one back, so a B=F double bond is a paper structure that nature does not build. Boron is the classic member of the electron-deficient club, along with beryllium.

The second case is a central atom whose neighbors are all hydrogen. Hydrogen has no lone pair to donate, so there is physically nothing to promote. CH₃⁺, the methyl cation, sits at six electrons for exactly this reason and is famous for being desperate to react with anything that will hand it a pair.

The third case runs the other way. Sulfur, phosphorus, chlorine and the rest of period 3 and below can hold more than eight, because their valence shell has room. SF₆ puts twelve electrons around sulfur and PCl₅ puts ten around phosphorus. Neither is a mistake in the count.

This calculator checks all three before it suggests a double bond.

Limitations: it assumes every atom you list is bonded straight to the central atom, which is wrong for a molecule like sulfuric acid where the hydrogens hang off the oxygens. It does not draw the structure, weigh resonance forms, or compute formal charges.


How we build and check this calculator

This calculator runs entirely in your browser, so the numbers you enter stay on your device. The math behind it is written by hand and tested against worked examples and standard references before the page goes live.

SuperGlobalCalculator is independently built and maintained. See how we build and verify our calculators.

Embed This Calculator

Copy the code below and paste it into your website or blog.
The calculator will work directly on your page.