Home › Calculators › Valence Electrons Calculator

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

Enter your values to see the result.
Advertisement
Advertisement

How to use the Valence Electrons Calculator

  1. Type an element or formula, e.g. N, chlorine, CO2 or NO3-. Symbols are case-sensitive: Co is cobalt, CO is carbon monoxide.
  2. Add a charge for ions, either in the formula (SO4 2-, NH4+) or in the charge box.
  3. Press Calculate to see the total valence electrons and the per-element table.
  4. Use the octet estimate (bonding and lone-pair electrons, central atom) as the starting point for a Lewis structure.
  5. 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.

GroupFamilyValence electronsOuter configurationExamplesTypical ion
1Hydrogen, alkali metals1ns¹H, Li, Na, K+1
2Alkaline earth metals2ns²Be, Mg, Ca+2
3–12Transition metals3–12 (ns + (n−1)d)(n−1)dˣ ns²Fe 8, Cu 11, Zn 12varies
13Boron group3ns² np¹B, Al, Ga+3
14Carbon group4ns² np²C, Si, Sn, Pbvaries
15Nitrogen group (pnictogens)5ns² np³N, P, As−3
16Oxygen group (chalcogens)6ns² np⁴O, S, Se−2
17Halogens7ns² np⁵F, Cl, Br, I−1
18Noble gases8 (He: 2)ns² np⁶He, Ne, Arnone

Worked examples: total valence electrons

SpeciesWorkingTotalLewis structure hint
H₂O2(1) + 682 O–H bonds, 2 lone pairs on O
CO₂4 + 2(6)16O=C=O, 2 lone pairs on each O
NH₃5 + 3(1)83 N–H bonds, 1 lone pair
CH₄4 + 4(1)84 C–H bonds, no lone pairs
NH₄⁺5 + 4(1) − 184 N–H bonds, positive formal charge on N
NO₃⁻5 + 3(6) + 124one N=O and two N–O, resonance
SO₄²⁻6 + 4(6) + 232S central, four S–O bonds
CO₃²⁻4 + 3(6) + 224one C=O, two C–O⁻, resonance
SF₆6 + 6(7)48expanded 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.

Related tools

Electron Configuration CalculatorFull and noble-gas shorthand electron configuration, orbital diagram and valence electrons.Molar Mass CalculatorMolar mass of any chemical formula with an element-by-element mass % breakdown.Interactive Periodic TableAll 118 elements with colour modes, filters, search and full element details.Protons Neutrons Electrons CalculatorCount protons, neutrons and electrons for any element, isotope or ion, with isotope notation.Chemical Equation BalancerBalance chemical, ionic and redox equations with the matrix method and steps.Molarity CalculatorSolve mass, volume, molarity or molar mass, and C1V1 = C2V2 dilutions with units.pH CalculatorConvert pH, pOH, [H+] and [OH-], or find the pH of strong and weak acids and bases.Dilution CalculatorSolve C1V1 = C2V2 for any variable: stock volume, final volume or concentration, with units.Percent Yield CalculatorPercent yield from actual and theoretical yield, or theoretical yield from moles and formulas.PPM CalculatorConvert ppm to mg/L, %, ppb and mg/kg, find ppm of a solution, or ppm to mg/m³ for gases.Grams to Moles CalculatorConvert grams to moles and back from a chemical formula, with molar mass and atom counts.Blood Type CalculatorPossible child blood types and their odds from both parents' ABO and Rh types, with Punnett squares.Buffer pH CalculatorBuffer pH from pKa and acid/base concentrations, or the recipe for a target pH.Combined Gas Law CalculatorSolve P1V1/T1 = P2V2/T2 for any variable, with Boyle's, Charles's and Gay-Lussac's modes.Empirical Formula CalculatorElement percentages or grams to mole ratios, empirical formula and molecular formula.Gibbs Free Energy CalculatorΔG from ΔH, ΔS and temperature, with spontaneity, crossover temperature and K.Mass Percent CalculatorMass percent of a solution, percent composition of a formula, or mass for a target %.Molality CalculatorMolality from grams or moles of solute and solvent mass, or solve for either one.Moles to Atoms CalculatorConvert moles, grams and atoms or molecules with Avogadro's number, atoms per element.Serial Dilution CalculatorConcentration, transfer and diluent volume for every tube of a dilution series.Soap Lye CalculatorNaOH or KOH and water for a soap recipe from oil SAP values, superfat and water ratio.Theoretical Yield CalculatorTheoretical yield in grams and moles from limiting reagent mass and mole ratio.Titration CalculatorAnalyte concentration or equivalence volume from a titration, with pH curve and indicator.Punnett Square CalculatorBuild monohybrid, dihybrid or trihybrid Punnett squares with genotype and phenotype ratios.Stoichiometry CalculatorFrom one known mass or mole amount, get moles and grams of every reactant and product.Six Sigma CalculatorDPMO, yield and sigma level from defects, with the 1.5 sigma shift and a conversion table.Beer-Lambert Law CalculatorSolve A = εlc for absorbance, concentration, molar absorptivity or path length; %T conversion.Boyle's Law CalculatorSolve P1V1 = P2V2 for any missing pressure or volume, with units, gauge option and steps.Centrifuge RPM to RCF CalculatorConvert centrifuge RPM to RCF (× g) or RCF to RPM from rotor radius, with an RPM chart.Charles's Law CalculatorSolve V1/T1 = V2/T2 for volume or temperature, with °C, °F or K converted to kelvin.Hardy-Weinberg CalculatorAllele frequencies, expected genotypes and a chi-square equilibrium test from counts or p, q.Normality CalculatorFind normality from mass or molarity, and how much solid or stock acid makes an N solution.Oxidation Number CalculatorEnter a formula or ion to get the oxidation state of every element, with the rules used.Percent Solution CalculatorHow much solute and solvent for a w/v, w/w or v/v % solution, plus % from amounts and dilutions.
See all 35 Chemistry & Biology Calculators →