Valence Electrons Calculator
Type an element (symbol, name or atomic number) or a chemical formula, including ions such as NH4+ or SO4 2-. You get the valence electrons of each atom, the total for the whole species, electron pairs and an octet-rule bond estimate to start a Lewis structure.
Last updated:
Charge can be typed at the end: NH4+, CO3 2-, PO4^3-, Fe³⁺
e.g. -2 for a 2− ion; ignored when the formula has a charge
How to use the Valence Electrons Calculator
- Type an element or formula, e.g. N, chlorine, CO2 or NO3-. Symbols are case-sensitive: Co is cobalt, CO is carbon monoxide.
- Add a charge for ions, either in the formula (SO4 2-, NH4+) or in the charge box.
- Press Calculate to see the total valence electrons and the per-element table.
- Use the octet estimate (bonding and lone-pair electrons, central atom) as the starting point for a Lewis structure.
- Copy the result or download the table as CSV for your notes.
Valence electrons by group
Valence electrons are the electrons in an atom's outer shell (plus, for transition metals, the partly filled d subshell just inside it). They are the electrons that form bonds, so counting them is the first step in drawing a Lewis structure, predicting ion charges and working out molecular shapes with VSEPR.
| Group | Family | Valence electrons | Outer configuration | Examples | Typical ion |
|---|---|---|---|---|---|
| 1 | Hydrogen, alkali metals | 1 | ns¹ | H, Li, Na, K | +1 |
| 2 | Alkaline earth metals | 2 | ns² | Be, Mg, Ca | +2 |
| 3–12 | Transition metals | 3–12 (ns + (n−1)d) | (n−1)dˣ ns² | Fe 8, Cu 11, Zn 12 | varies |
| 13 | Boron group | 3 | ns² np¹ | B, Al, Ga | +3 |
| 14 | Carbon group | 4 | ns² np² | C, Si, Sn, Pb | varies |
| 15 | Nitrogen group (pnictogens) | 5 | ns² np³ | N, P, As | −3 |
| 16 | Oxygen group (chalcogens) | 6 | ns² np⁴ | O, S, Se | −2 |
| 17 | Halogens | 7 | ns² np⁵ | F, Cl, Br, I | −1 |
| 18 | Noble gases | 8 (He: 2) | ns² np⁶ | He, Ne, Ar | none |
Worked examples: total valence electrons
| Species | Working | Total | Lewis structure hint |
|---|---|---|---|
| H₂O | 2(1) + 6 | 8 | 2 O–H bonds, 2 lone pairs on O |
| CO₂ | 4 + 2(6) | 16 | O=C=O, 2 lone pairs on each O |
| NH₃ | 5 + 3(1) | 8 | 3 N–H bonds, 1 lone pair |
| CH₄ | 4 + 4(1) | 8 | 4 C–H bonds, no lone pairs |
| NH₄⁺ | 5 + 4(1) − 1 | 8 | 4 N–H bonds, positive formal charge on N |
| NO₃⁻ | 5 + 3(6) + 1 | 24 | one N=O and two N–O, resonance |
| SO₄²⁻ | 6 + 4(6) + 2 | 32 | S central, four S–O bonds |
| CO₃²⁻ | 4 + 3(6) + 2 | 24 | one C=O, two C–O⁻, resonance |
| SF₆ | 6 + 6(7) | 48 | expanded octet: 12 electrons around S |
Tips for Lewis structures
- Count first. The total valence electron count fixes how many dots and bonds the final structure can have; every correct Lewis structure uses exactly that many.
- Pick the central atom. It is usually the least electronegative atom that is not hydrogen (C in CO₂, S in SO₄²⁻). Hydrogen and fluorine are almost always on the outside.
- Bond, then fill. Connect the outer atoms with single bonds, complete their octets with lone pairs, put leftovers on the central atom, and form double or triple bonds if the central atom is still short.
- Know the exceptions. Boron and beryllium are often electron-deficient, odd-electron species are radicals, and atoms from period 3 down (P, S, Cl, Xe) can hold more than eight electrons.
Frequently asked questions
How do you find the number of valence electrons?
For main-group elements, read the group number: groups 1 and 2 have 1 and 2 valence electrons, and groups 13 to 18 have the group number minus 10 (so oxygen in group 16 has 6). Helium is the exception with 2. For transition metals the ns and (n−1)d electrons are usually counted together, which equals the group number.
How do you calculate the total valence electrons in a molecule?
Multiply each element's valence electrons by the number of its atoms and add them up. For H2O: 2 × 1 (H) + 1 × 6 (O) = 8 valence electrons. For CO2: 4 + 2 × 6 = 16.
How do charges change the valence electron count?
A negative charge means extra electrons, so add the charge; a positive charge means electrons were lost, so subtract it. Sulfate SO4²⁻ has 6 + 4 × 6 + 2 = 32 valence electrons, and ammonium NH4⁺ has 5 + 4 × 1 − 1 = 8.
What is the N − A = S rule?
It is a quick octet-rule estimate for Lewis structures. N is the electrons needed for every atom to have a full shell (8 per atom, 2 per hydrogen), A is the available valence electrons, and S = N − A is the number of shared (bonding) electrons. For CO2, N = 24, A = 16, S = 8, so there are 4 bonds, which matches two C=O double bonds.
Why does the calculator say the octet estimate does not apply?
Molecules with an odd number of electrons (NO, NO2), electron-deficient atoms (BF3) or expanded octets on period 3+ atoms (SF6, PCl5, XeF4) break the simple octet rule. The total valence electron count is still correct; draw single bonds to the central atom first and place the remaining electrons as lone pairs.
How many valence electrons do transition metals have?
Counting conventions differ. This calculator uses ns + (n−1)d electrons, which equals the group number: iron has 8 (3d⁶ 4s²) and zinc has 12. Some textbooks count only the outer s electrons, giving 2 for both. For lanthanides and actinides the electrons outside the noble-gas core are counted, treating a full f¹⁴ subshell as core.
Is the number of valence electrons the same as the oxidation state or charge?
No. Valence electrons are the outer electrons available for bonding. An ion's charge comes from gaining or losing some of them, and the oxidation state is a bookkeeping number that depends on the compound. Sodium has 1 valence electron and usually forms Na⁺; chlorine has 7 and usually forms Cl⁻.
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.