AP · Chemistry · Periodic Trends

Valence Electrons and Ionic Compounds

11 min readUpdated November 30, 2026FreeAP Chemistry, Atomic Structure and Properties

A main-group element's group tells you its number of valence electrons, and that sets the charge of the ion it forms: metals lose their valence electrons, and nonmetals gain enough to fill their valence shell. Balance the positive and negative charges and you have the formula of the ionic compound. Elements in the same group have the same number of valence electrons, so they form ions of the same charge and compounds with matching formulas.

Quick check

  1. Which has the lower first ionization energy, sodium or magnesium?Show answerHide answer

    Sodium. Its single 3s electron feels a core charge of +1 rather than +2, so it is easier to remove.

  2. Calcium is in group 2. What charge does a calcium ion carry?Show answerHide answer

    2+. Calcium loses its two valence electrons to form Ca²⁺.

Know these already? Jump to the practice questions

What you'll be able to do

  • Identify the number of valence electrons and the ion charge of a main-group element.
  • Predict the formula of an ionic compound from its elements.
  • Interpret successive ionization energies to find an element's group.
  • Explain why elements in the same group form similar compounds.
  • Predict the compounds of an unfamiliar element from its position.

Key terms

Valence electrons

The electrons in an atom's outermost occupied shell; for a main-group element, the s and p electrons of the highest shell.

In plain English
The electrons on the outside, which take part in reactions.
Don't write
"All the electrons in the atom."

Formula unit

The simplest whole-number ratio of ions in an ionic compound, such as one Ca²⁺ to two Cl⁻ in CaCl₂.

In plain English
The smallest repeating recipe of ions.
Don't write
"A molecule of calcium chloride."

What charge does a main-group ion take?

Atoms of these main groups gain or lose electrons until they have the electron configuration of a noble gas:

GroupValence electronsTypical ionExample
111+Na⁺
222+Mg²⁺
1333+Al³⁺
1553−N³⁻
1662−O²⁻
1771−Cl⁻

Why does magnesium stop at 2+? Its successive ionization energies (rounded, from the NIST Atomic Spectra Database) are 738, 1451 and 7733 kJ/mol.

  1. The first two electrons come from the 3s subshell, the valence shell.
  2. The third must come from the 2p subshell, much closer to the nucleus and far less shielded.
  3. So the third ionization energy is over five times the second, and Mg³⁺ does not form in compounds.

Atoms in groups 15 to 17 have a high core charge (+5 to +7), so they gain electrons until the valence shell holds eight.

Key idea

An ion's charge is set by how many electrons the atom must lose or gain to reach a noble-gas configuration.

Check yourself

What ion does sulfur form, and why?
Show answerHide answer

S²⁻. Sulfur has 6 valence electrons, so gaining 2 fills its valence shell and gives the configuration of argon.

How do you predict the formula of an ionic compound?

An ionic compound has no overall charge, so the total positive charge equals the total negative charge.

  1. Write each ion with its charge.
  2. Find the lowest common multiple of the two charge sizes.
  3. Divide it by each charge to get the number of each ion.
  4. Write the cation first, with the numbers as subscripts, and leave out 1.

For aluminum and oxygen: Al³⁺ and O²⁻; the lowest common multiple of 3 and 2 is 6; so 2 Al³⁺ and 3 O²⁻: Al₂O₃.

The name follows the formula: the metal's name, then the nonmetal's stem with -ide (aluminum oxide, calcium nitride).

Check yourself

What is the formula of the compound of magnesium and chlorine?
Show answerHide answer

MgCl₂: one Mg²⁺ balances two Cl⁻.

Why do elements in the same group react alike?

Elements in a group have the same valence configuration (all of group 1 is ns1ns^1), so:

  1. They lose or gain the same number of electrons.
  2. So they form ions of the same charge.
  3. So their compounds have matching formulas: NaCl and KCl; MgO and CaO; Na₂O and K₂O.

They are not identical. Down group 1 the valence electron is in a higher shell, farther from the nucleus, so it is removed more easily, so reactivity rises: potassium reacts with water more vigorously than sodium.

Check yourself

Lithium bromide is LiBr. What is the formula of cesium bromide?
Show answerHide answer

CsBr. Cesium is in group 1 like lithium, so it forms a 1+ ion.

How can you predict the behavior of an unfamiliar element?

Use the element's position in two ways:

  • Group: gives the valence electrons, so the ion charge and the formulas of its compounds.
  • Period: gives the shell, so with the trends in the note on Atomic Radius, Ionization Energy and Electronegativity, its size and how easily it loses electrons.

For example, strontium is in group 2, period 5. It forms Sr²⁺, so its oxide is SrO and its chloride SrCl₂, like calcium's. Its valence electrons are in shell 5, so it has a larger radius and a lower first ionization energy than calcium.

Examiner's eye

Marks go to naming the shared feature (the same number of valence electrons) before giving the predicted formula. A formula with no reason earns little in a justify question.

Check yourself

Selenium is below sulfur in group 16. Sodium sulfide is Na₂S. What is the formula of sodium selenide?
Show answerHide answer

Na₂Se. Selenium has 6 valence electrons like sulfur, so it forms Se²⁻.

Worked example 1: Predict a formula

Question: Predict the formula of the ionic compound formed by aluminum and sulfur.

What tells you the method

A metal and a nonmetal: find each ion's charge, then balance.

  1. Step 1: Find the ions.

    Aluminum is in group 13, so Al³⁺. Sulfur is in group 16, so S²⁻.

    Why

    Aluminum loses its 3 valence electrons; sulfur gains 2 to fill its valence shell.

  2. Step 2: Balance the charges.

    The lowest common multiple of 3 and 2 is 6, so 2 Al³⁺ (+6) and 3 S²⁻ (−6).

    Why

    The compound has no overall charge.

  3. Step 3: Write the formula.

    Cation first, with subscripts.

    Why

    Formulas of ionic compounds list the cation first.

Check it

2(+3)+3(−2)=02(+3) + 3(-2) = 0.

Answer

The formula is Al₂S₃ (aluminum sulfide).

Worked example 2: Find the group from ionization data

Question: Successive ionization energies of a period 3 element X, rounded from the NIST Atomic Spectra Database:

Electron removed1st2nd3rd4th
Ionization energy (kJ/mol)5781817274511578

(a) How many valence electrons does X have? Give a number. (b) Predict the formula of the compound of X with oxygen, using X as its symbol.

What tells you the method

Successive ionization energies: look for the big jump.

  1. Step 1: Compare each value with the one before.

    The ratios are about 3.1, 1.5 and 4.2. The largest jump is from the 3rd to the 4th.

    Why

    A large jump means the next electron comes from an inner shell, closer to the nucleus and less shielded.

  2. Step 2: Count the electrons before the jump.

    Three electrons come off before it, so X has 3 valence electrons and forms X³⁺.

    Why

    Only valence electrons are removed in forming the ion.

  3. Step 3: Balance with oxide.

    X³⁺ and O²⁻: 2 X³⁺ (+6) and 3 O²⁻ (−6).

    Why

    The charges must cancel.

Check it

Three valence electrons in period 3 puts X in group 13, the position of aluminum, which forms Al₂O₃.

Answer

(a) 33; (b) X₂O₃.

Your turn

Question: Predict the formula of calcium nitride.

  1. Step 1: Find the ions.

    Calcium is in group 2, so Ca²⁺. Nitrogen is in group 15, so N³⁻.

  2. Step 2: Your go: balance the charges and write the formula.

Show the full solutionHide the solution

Step 2. The lowest common multiple of 2 and 3 is 6, so 3 Ca²⁺ (+6) and 2 N³⁻ (−6).

Answer: The formula is Ca₃N₂.

Traps

Trap

The subscripts in a formula are the charges of the ions.

It seems right because the "criss-cross" shortcut moves charges into subscripts. But subscripts are the numbers of ions needed to cancel the charges, so Mg²⁺ and O²⁻ give MgO, not Mg₂O₂.

What is the formula of calcium oxide?

CaO. One Ca²⁺ balances one O²⁻, and formulas use the simplest ratio.

Trap

Elements in the same group have identical properties.

It seems right because they form the same kind of compounds. But the valence electrons are farther out lower in the group, so radius grows and ionization energy falls, and reactivity changes.

Do sodium and potassium form the same type of chloride, and do they react equally fast with water?

Same type (NaCl and KCl), but potassium reacts faster, because its valence electron is farther from the nucleus and easier to remove.

What's examined

On the AP® Chemistry exam (Unit 1: Atomic Structure and Properties), this topic appears in multiple-choice and free-response questions. Expect to predict ion charges and formulas, read successive ionization energies, and justify a prediction about an unfamiliar element from the element above or below it.

Practice questions

  1. Recall Barium is in group 2. Which ion does it form?
  • A) Ba⁺
  • B) Ba²⁻
  • C) Ba²⁺
  • D) Ba³⁺
Show answer

Answer: C. Barium loses its two valence electrons.

Why the others are wrong:

  • A removes only one of the two valence electrons.
  • B treats barium as a nonmetal that gains electrons.
  • D removes a core electron, which takes far more energy.
  1. Apply Predict the formula of magnesium phosphide.
Show answer

Answer: The formula is Mg₃P₂.

Marking points:

  • Mg²⁺ (group 2) and P³⁻ (group 15).
  • 3 Mg²⁺ (+6) balance 2 P³⁻ (−6).
  1. Apply Potassium oxide is K₂O. Which is the formula of rubidium sulfide?
  • A) Rb₂S
  • B) RbS
  • C) RbS₂
  • D) Rb₂S₃
Show answer

Answer: A. Rubidium is in group 1 like potassium, and sulfur is in group 16 like oxygen, so the pattern matches K₂O.

Why the others are wrong:

  • B gives Rb a 2+ charge.
  • C swaps the ratio of the ions.
  • D treats sulfur as forming a 3− ion.
  1. Apply Selenium has atomic number 34. How many electrons does a selenide ion, Se²⁻, have? Give a number.
Show answer

Answer: 3636 electrons.

Marking points:

  • A selenium atom has 34 electrons.
  • A 2− charge means 2 extra electrons: 34+2=3634 + 2 = 36.
  1. Exam-style The first three ionization energies of element Z, rounded from the NIST Atomic Spectra Database, are 590, 1145 and 4912 kJ/mol. Which formula is most likely for the chloride of Z?
  • A) ZCl
  • B) Z₂Cl
  • C) ZCl₃
  • D) ZCl₂
Show answer

Answer: D. The big jump comes after the second electron, so Z has 2 valence electrons and forms Z²⁺, which needs two Cl⁻.

Why the others are wrong:

  • A stops at the first electron and ignores the small second step.
  • B gives Z a charge of 1/2 per atom, which no simple ion has.
  • C counts the third electron, which comes from an inner shell.
  1. Exam-style Gallium is directly below aluminum in group 13. Aluminum oxide is Al₂O₃. Which is the most likely formula of gallium oxide?
  • A) GaO
  • B) Ga₂O₃
  • C) Ga₃O₂
  • D) GaO₃
Show answer

Answer: B. Gallium has 3 valence electrons like aluminum, so it forms Ga³⁺, and 2 Ga³⁺ balance 3 O²⁻.

Why the others are wrong:

  • A assumes a 2+ ion.
  • C swaps the subscripts.
  • D would need a 6+ ion.

Key points

Recall, then reveal

Say the main points from memory first, then check them.

Show key pointsHide key points
  • Main-group metals lose their valence electrons and nonmetals gain electrons to reach a noble-gas configuration.
  • The big jump in successive ionization energies shows where the valence electrons end.
  • Balance total positive and negative charge with the smallest whole numbers to write a formula.
  • Same group means same valence electrons, so same ion charge and matching formulas.
  • Lower in a group, valence electrons are farther out, so the atoms are larger and lose electrons more easily.

Keep learning

Explore AP Chemistry tutoring →

View the full Chemistry syllabus →

More in this unit

Atomic Structure and Properties

All Periodic Trends notes

Part of Novark's AP Chemistry notes