CHEM-101 · Lesson 3 of 12 · 38 min
The mole, chemical formulas and names
Chemists count atoms by weighing them. A balance cannot see individual atoms, but if we know how much one atom weighs on average, the mass of a sample tells us how many atoms it contains. The unit that makes this practical is the mole. This lesson introduces the mole and molar mass, shows how to move between mass, moles and numbers of particles, and uses those skills to find chemical formulas from experimental data. It also sets out the rules for naming simple compounds, a language you will need for the rest of the program.
The mole and the Avogadro constant
The mole (mol) is the SI unit of amount of substance. One mole contains exactly 6.022 140 76 × 10²³ specified entities, whether atoms, molecules, ions or electrons. This number is the Avogadro constant, N_A, usually rounded to 6.022 × 10²³ mol⁻¹. Its value was chosen so that the mass of one mole of a substance in grams is numerically equal to the mass of one of its entities in atomic mass units. One carbon-12 atom has a mass of exactly 12 u (before 2019, by definition; now to within a few parts in a billion), and one mole of carbon-12 has a mass of 12 g.
The number is almost impossible to picture. A mole of grains of sand would cover Canada to a depth of many metres; a mole of seconds is about 20 million times the age of the universe. Yet a mole of water is only 18 g, about a tablespoon. Atoms are that small.
Here N is the number of particles, n the amount in moles, m the mass and M the molar mass. These two relationships, and the conversion factors they imply, are the core of quantitative chemistry.
Molar mass
The molar mass of an element is its average atomic mass expressed in grams per mole: carbon is 12.011 g/mol, oxygen 15.999 g/mol, chlorine 35.45 g/mol. The molar mass of a compound is the sum of the molar masses of the atoms in its formula. For ionic compounds, which do not consist of discrete molecules, the same calculation gives the formula mass per mole of formula units. Modern periodic tables give atomic masses to four or more significant figures; for most calculations in this course, two decimal places are plenty.
Worked problem
Molar mass of glucose and of calcium phosphate
Calculate the molar masses of glucose, C₆H₁₂O₆, and calcium phosphate, Ca₃(PO₄)₂.
Show solution
- Glucose: 6(12.01) + 12(1.008) + 6(16.00) = 72.06 + 12.10 + 96.00 = 180.16 g/mol.
- Calcium phosphate: the subscript 2 outside the parentheses multiplies everything inside, giving 3 Ca, 2 P and 8 O.
- 3(40.08) + 2(30.97) + 8(16.00) = 120.24 + 61.94 + 128.00 = 310.18 g/mol.
Answer: Glucose: 180.16 g/mol; calcium phosphate: 310.18 g/mol.
The code below parses chemical formulas, including parentheses and hydrate dots, and calculates molar masses. Programs like this are built into every chemistry software package.
import re
MASS = {"H": 1.008, "C": 12.011, "N": 14.007, "O": 15.999, "Na": 22.990,
"Mg": 24.305, "Al": 26.982, "P": 30.974, "S": 32.06, "Cl": 35.45,
"K": 39.098, "Ca": 40.078, "Fe": 55.845, "Cu": 63.546}
def parse(formula):
"""Return a dict of element counts. Handles parentheses and hydrate dots."""
counts = {}
for i, part in enumerate(formula.split(".")):
mult = 1
if i > 0:
m = re.match(r"(\d+)(.*)", part)
if m:
mult, part = int(m.group(1)), m.group(2)
for el, n in parse_group(part).items():
counts[el] = counts.get(el, 0) + n * mult
return counts
def parse_group(s):
"""Parse a formula with no dots, using a stack for parentheses."""
stack = [{}]
tokens = re.findall(r"[A-Z][a-z]?|\d+|\(|\)", s)
i = 0
while i < len(tokens):
tok = tokens[i]
n = int(tokens[i + 1]) if i + 1 < len(tokens) and tokens[i + 1].isdigit() else 1
if tok == "(":
stack.append({}); i += 1; continue
if tok == ")":
group = stack.pop()
for el, c in group.items():
stack[-1][el] = stack[-1].get(el, 0) + c * n
else:
stack[-1][tok] = stack[-1].get(tok, 0) + n
i += 2 if n != 1 or (i + 1 < len(tokens) and tokens[i + 1] == "1") else 1
return stack[0]
def molar_mass(formula):
return sum(MASS[el] * n for el, n in parse(formula).items())
for f in ["H2O", "C6H12O6", "Ca3(PO4)2", "CuSO4.5H2O", "Al2(SO4)3"]:
print(f"{f:12s} {parse(f)} M = {molar_mass(f):.2f} g/mol")H2O {'H': 2, 'O': 1} M = 18.02 g/mol
C6H12O6 {'C': 6, 'H': 12, 'O': 6} M = 180.16 g/mol
Ca3(PO4)2 {'Ca': 3, 'P': 2, 'O': 8} M = 310.17 g/mol
CuSO4.5H2O {'Cu': 1, 'S': 1, 'O': 9, 'H': 10} M = 249.68 g/mol
Al2(SO4)3 {'Al': 2, 'S': 3, 'O': 12} M = 342.13 g/molConverting between mass, moles and particles
Every conversion runs through moles. Mass converts to moles by dividing by molar mass; moles convert to particles by multiplying by the Avogadro constant. The formula then links moles of a compound to moles of each element in it: one mole of H₂O contains two moles of H atoms and one mole of O atoms.
Worked problem
From grams to atoms
How many hydrogen atoms are in 5.00 g of methane, CH₄ (M = 16.04 g/mol)?
Show solution
- Moles of CH₄: 5.00 g ÷ 16.04 g/mol = 0.3117 mol.
- Moles of H atoms: 0.3117 mol CH₄ × (4 mol H / 1 mol CH₄) = 1.247 mol H.
- Atoms of H: 1.247 mol × 6.022 × 10²³ mol⁻¹ = 7.51 × 10²³ atoms.
Answer: 7.51 × 10²³ hydrogen atoms (three significant figures).
A useful habit is to estimate first. Five grams of methane is about a third of a mole, so it contains about 2 × 10²³ molecules and four times as many hydrogen atoms, roughly 8 × 10²³. The calculated answer agrees.
Types of chemical formulas
A molecular formula gives the actual number of each kind of atom in a molecule: hydrogen peroxide is H₂O₂, glucose is C₆H₁₂O₆. An empirical formula gives only the simplest whole-number ratio: HO for hydrogen peroxide, CH₂O for glucose. Different compounds can share an empirical formula: formaldehyde (CH₂O), acetic acid (C₂H₄O₂) and glucose all have the empirical formula CH₂O. A structural formula shows how atoms are connected, which molecular formulas cannot: ethanol (CH₃CH₂OH) and dimethyl ether (CH₃OCH₃) both have the molecular formula C₂H₆O but are quite different substances. Ionic compounds are always written as empirical formulas, because they consist of extended arrays of ions rather than molecules.
Percent composition
The mass percent of an element in a compound is its share of the molar mass. Percent composition is used to check the purity of a compound, to compare fertilizers or ores, and, run in reverse, to determine formulas.
Worked problem
Nitrogen content of fertilizers
Compare the mass percent of nitrogen in ammonium nitrate, NH₄NO₃ (80.04 g/mol), and urea, CO(NH₂)₂ (60.06 g/mol).
Show solution
- Ammonium nitrate has 2 N: 2 × 14.01 / 80.04 × 100 % = 35.0 %.
- Urea has 2 N: 2 × 14.01 / 60.06 × 100 % = 46.7 %.
Answer: Urea is 46.7 % nitrogen and ammonium nitrate 35.0 %, which is one reason urea is the most widely used solid nitrogen fertilizer on prairie farms and in the US corn belt.
Empirical formulas from experimental data
To find an empirical formula from mass data, convert the mass of each element into moles, then find the simplest whole-number ratio. A practical sequence: assume a 100 g sample so that percentages become grams; convert grams to moles; divide every mole value by the smallest; and if the results are not all close to whole numbers, multiply by a small integer (2, 3, 4) until they are. A ratio such as 1 : 1.5 becomes 2 : 3; 1 : 1.33 becomes 3 : 4.
Worked problem
An empirical formula from percent composition
A compound is 40.0 % carbon, 6.71 % hydrogen and 53.3 % oxygen by mass. Find its empirical formula.
Show solution
- In 100 g: 40.0 g C, 6.71 g H, 53.3 g O.
- Moles: C 40.0/12.01 = 3.33; H 6.71/1.008 = 6.66; O 53.3/16.00 = 3.33.
- Divide by the smallest (3.33): C 1.00, H 2.00, O 1.00.
Answer: The empirical formula is CH₂O.
Combustion analysis
For organic compounds, the classic method is combustion analysis. A weighed sample is burned completely in excess oxygen. All the carbon ends up in carbon dioxide and all the hydrogen in water; these are trapped in separate absorbers and weighed. From the masses of CO₂ and H₂O we calculate the masses of C and H in the original sample. If the compound also contains oxygen, its mass is found by difference, because the oxygen in the products came partly from the sample and partly from the supplied oxygen. Modern CHN analyzers automate the process, measuring the gases instrumentally, but the arithmetic is unchanged.
# Combustion analysis of a compound containing C, H and O
M_C, M_H, M_O = 12.011, 1.008, 15.999
M_CO2, M_H2O = M_C + 2 * M_O, 2 * M_H + M_O
sample = 0.2500 # g of compound burned
co2 = 0.3664 # g of CO2 collected
h2o = 0.1500 # g of H2O collected
mass_C = co2 * M_C / M_CO2
mass_H = h2o * 2 * M_H / M_H2O
mass_O = sample - mass_C - mass_H
moles = {"C": mass_C / M_C, "H": mass_H / M_H, "O": mass_O / M_O}
smallest = min(moles.values())
print({el: round(m / smallest, 2) for el, m in moles.items()})
for mult in range(1, 5):
ratio = {el: m / smallest * mult for el, m in moles.items()}
if all(abs(r - round(r)) < 0.08 for r in ratio.values()):
print("multiplier", mult, "->", {el: round(r) for el, r in ratio.items()})
break{'C': 1.0, 'H': 2.0, 'O': 1.0}
multiplier 1 -> {'C': 1, 'H': 2, 'O': 1}Molecular formulas
An empirical formula combined with the molar mass gives the molecular formula. The molar mass, measured by mass spectrometry or from gas density (lesson 11), must be a whole-number multiple of the empirical formula mass. Divide to find that multiple and multiply every subscript by it.
Worked problem
From empirical to molecular formula
A compound has the empirical formula CH₂O and a molar mass of 180 g/mol. What is its molecular formula?
Show solution
- Empirical formula mass: 12.01 + 2(1.008) + 16.00 = 30.03 g/mol.
- Multiple: 180 ÷ 30.03 = 5.99 ≈ 6.
- Multiply subscripts by 6: C₆H₁₂O₆.
Answer: C₆H₁₂O₆, which could be glucose, fructose or another hexose; the formula alone cannot distinguish them.
Hydrates
Many ionic compounds crystallize with water molecules built into their crystal structure. Copper(II) sulfate pentahydrate, CuSO₄·5H₂O, is a striking blue; heating it drives off the water and leaves white anhydrous CuSO₄. The number of water molecules per formula unit can be found by weighing a sample before and after heating.
Worked problem
Finding the formula of a hydrate
Heating 2.500 g of a magnesium sulfate hydrate, MgSO₄·xH₂O, leaves 1.221 g of anhydrous MgSO₄ (120.37 g/mol). Find x.
Show solution
- Mass of water lost: 2.500 − 1.221 = 1.279 g.
- Moles of MgSO₄: 1.221 / 120.37 = 0.01014 mol. Moles of water: 1.279 / 18.02 = 0.07098 mol.
- Ratio: 0.07098 / 0.01014 = 7.00.
Answer: x = 7; the compound is MgSO₄·7H₂O, Epsom salt.
Naming simple compounds
Chemical names follow rules set by the International Union of Pure and Applied Chemistry (IUPAC). Three categories cover most compounds met in this course.
Binary ionic compounds are named cation first, then anion with the ending -ide: NaCl is sodium chloride, CaO calcium oxide, Al₂S₃ aluminum sulfide. For metals that form more than one ion, mostly transition metals, a Roman numeral gives the charge: FeCl₂ is iron(II) chloride and FeCl₃ iron(III) chloride. Polyatomic ions keep their own names, which must be learned.
| Ion | Name | Ion | Name |
|---|---|---|---|
| NH₄⁺ | ammonium | NO₃⁻ | nitrate |
| OH⁻ | hydroxide | NO₂⁻ | nitrite |
| CN⁻ | cyanide | SO₄²⁻ | sulfate |
| CH₃COO⁻ | acetate | SO₃²⁻ | sulfite |
| MnO₄⁻ | permanganate | PO₄³⁻ | phosphate |
| HCO₃⁻ | hydrogen carbonate (bicarbonate) | CO₃²⁻ | carbonate |
| ClO⁻ | hypochlorite | ClO₃⁻ | chlorate |
Binary molecular compounds, formed between two nonmetals, use Greek prefixes for the number of each atom: CO is carbon monoxide, CO₂ carbon dioxide, N₂O₄ dinitrogen tetroxide, PCl₅ phosphorus pentachloride. The prefix mono- is dropped for the first element. The prefixes are mono (1), di (2), tri (3), tetra (4), penta (5), hexa (6), hepta (7), octa (8), nona (9) and deca (10).
Acids in water are named from their anions. Binary acids take the prefix hydro- and the ending -ic acid: HCl(aq) is hydrochloric acid. Oxoacids change -ate to -ic acid and -ite to -ous acid: H₂SO₄ is sulfuric acid (from sulfate), HNO₂ is nitrous acid (from nitrite). CHEM-102 develops the chemistry of acids; organic nomenclature waits for CHEM-261.
Worked problem
Names and formulas
Name or write formulas for: (a) Mg(NO₃)₂, (b) copper(II) hydroxide, (c) SF₆, (d) iron(III) sulfate.
Show solution
- (a) Magnesium nitrate.
- (b) Cu²⁺ and OH⁻ combine 1 : 2: Cu(OH)₂.
- (c) Sulfur hexafluoride (both nonmetals, so prefixes).
- (d) Fe³⁺ and SO₄²⁻: the lowest ratio giving zero charge is 2 : 3, so Fe₂(SO₄)₃.
Answer: (a) magnesium nitrate; (b) Cu(OH)₂; (c) sulfur hexafluoride; (d) Fe₂(SO₄)₃.
Common mistakes
MistakeThe molar mass of Ca₃(PO₄)₂ counts 4 oxygen atoms.
InsteadThe subscript outside the parentheses multiplies everything inside: there are 8 oxygen atoms.
MistakeTo find an empirical formula, use the mass percentages directly as the ratio.
InsteadConvert masses to moles first; elements have different molar masses.
MistakeIn combustion analysis, the oxygen in the CO₂ and H₂O all came from the sample.
InsteadMost came from the supplied oxygen; the sample’s oxygen is found by difference.
MistakeFeCl₃ is named iron trichloride.
InsteadIonic compounds use Roman numerals for variable charges, not prefixes: iron(III) chloride.
MistakeA ratio of 1 : 1.5 should be rounded to 1 : 2.
InsteadMultiply by 2 to get whole numbers: 2 : 3.
Summary and key terms
- One mole contains exactly 6.022 140 76 × 10²³ entities; the molar mass in g/mol equals the entity mass in u.
- Conversions between mass, moles and particles run through moles: n = m/M and N = nN_A.
- Molecular formulas give actual atom counts; empirical formulas give the simplest ratio; structural formulas show connectivity.
- Mass percent composition is calculated from molar masses and is used to check purity and find formulas.
- Empirical formulas come from converting masses to moles and finding the simplest whole-number ratio; combustion analysis supplies the masses for organic compounds.
- The molecular formula is a whole-number multiple of the empirical formula, found from the molar mass.
- Ionic compounds are named cation then anion, with Roman numerals for variable charges; molecular compounds use Greek prefixes.
- mole
- The amount of substance containing exactly 6.022 140 76 × 10²³ entities.
- Avogadro constant
- The number of entities per mole, 6.022 140 76 × 10²³ mol⁻¹.
- molar mass
- The mass of one mole of a substance, in g/mol.
- formula unit
- The simplest ratio of ions in an ionic compound, treated as a unit for counting.
- empirical formula
- The simplest whole-number ratio of atoms in a compound.
- molecular formula
- The actual numbers of each kind of atom in a molecule.
- percent composition
- The mass percent of each element in a compound.
- combustion analysis
- Burning a sample to determine its carbon and hydrogen content from the masses of CO₂ and H₂O formed.
- hydrate
- An ionic compound with water molecules incorporated in its crystals.
- polyatomic ion
- A charged group of covalently bonded atoms, such as sulfate.
Practice problems
Work each problem on paper first, then reveal the answer to check.
Calculate the molar mass of Al₂(SO₄)₃.
Show answer
2(26.98) + 3(32.06) + 12(16.00) = 342.1 g/mol.
How many moles are in 25.0 g of NaCl (58.44 g/mol)?
Show answer
0.428 mol.
How many molecules are in 0.250 mol of water?
Show answer
1.51 × 10²³ molecules.
What is the mass of 3.01 × 10²² atoms of iron?
Show answer
0.0500 mol × 55.85 g/mol = 2.79 g.
Calculate the mass percent of oxygen in CaCO₃ (100.09 g/mol).
Show answer
3 × 16.00 / 100.09 = 47.96 %.
A compound is 85.6 % C and 14.4 % H. Find its empirical formula.
Show answer
C 7.13 mol, H 14.3 mol; ratio 1 : 2; CH₂.
The compound in the previous question has a molar mass of 56.1 g/mol. What is its molecular formula?
Show answer
56.1/14.03 = 4; C₄H₈.
Name Na₂SO₃ and N₂O₅.
Show answer
Sodium sulfite; dinitrogen pentoxide.
Write the formula of ammonium phosphate.
Show answer
(NH₄)₃PO₄.
Name the acid H₃PO₄.
Show answer
Phosphoric acid (from phosphate).
Lesson quiz · 5 questions
Score 60% or more to complete this lesson.
Create a free account to save your progress, take quizzes and earn a certificate.