TL;DR
A chemical formula is a short written code for a substance. It lists the element symbols that appear in the substance and writes a small number after each one to say how many atoms of that element are present. Water is H2O: two hydrogen atoms and one oxygen atom. The formula tells you what a substance is made of, so you can predict its mass, how it reacts and how much of each ingredient a reaction needs.
Builds on: Atom, the idea that each element is made of one kind of atom · Leads to: chemical equations, where formulas are the words of the reaction, and Stoichiometry, which counts atoms and moles from them
Where it's used
Drug labels and food packaging. The label on a bottle of paracetamol gives its formula, C8H9NO2. A pharmacist, a chemist or a regulator can read from that code that each molecule has 8 carbon, 9 hydrogen, 1 nitrogen and 2 oxygen atoms, and use it to compute the dose in moles and the mass of each ingredient.
Fertilizer and industry. Ammonium nitrate, NH4NO3, is written as a formula on every bag and shipping document. Its formula tells the buyer how much nitrogen the product contains per kilogram, which is the number farmers and regulators actually care about.
Water softening. Table salt, NaCl, is the brine that regenerates a water softener, and calcium carbonate, CaCO3, is the limescale the softener removes. Engineers read the formula to know which ions are present and in what ratio, which decides how the material dissolves.
How it works
Take the formula Ca(OH)2, which appears in lime used for water treatment. We will read it one symbol at a time.
- Find the element symbols. Capital letters name elements: Ca is calcium, O is oxygen, H is hydrogen. Check: three different symbols appear, so three elements are present.
- Read the subscript after a symbol. A small number after one symbol counts the atoms of that element. In Ca(OH)2 the 2 is outside the parentheses, so it applies to the whole group inside. There is no number after Ca, which means one calcium atom. Check: one Ca.
- Expand the group in parentheses. The group (OH) has one O and one H. The subscript 2 outside the parentheses means two copies of the group, so the formula contains two O and two H. Check: .
- Add up each element. Ca: 1. O: 2. H: 2. Check: total atoms .
- Read the meaning. One formula unit of calcium hydroxide holds one calcium ion and two hydroxide groups. The formula is a recipe: it gives the count of each atom, and nothing more.
flowchart LR F["Ca(OH)2"] --> Ca["Ca: 1 atom"] F --> O["O: 2 atoms (1 in each OH, times 2)"] F --> H["H: 2 atoms (1 in each OH, times 2)"] Ca --> T["Total: 5 atoms"] O --> T H --> T
A formula with no parentheses and no subscript is still read the same way. In H2O, the H has subscript 2 and the O has no number, so it is 2 H and 1 O, for 3 atoms in total.
The formula does not give the shape of the molecule or the way the atoms are joined. Two different substances can share one formula, as the common mistakes section shows. The formula is the inventory, not the blueprint.
The math
Definition
A chemical formula for a substance is a string of element symbols, each followed by an optional subscript meaning " atoms of this element", with parentheses that multiply the group inside by the number after them. Writing no subscript means one atom.
Let the formula contain different elements, and let be the number of atoms of element . Then the number of atoms in one unit of the substance is
Step 2 and step 3 in symbols
For a group written as , the counts multiply:
For Ca(OH)2 the group is with oxygen and hydrogen, and . So and . This is the expansion in step 3.
Step 4 in symbols
Adding the counts gives , , , and so
Molecular and empirical formulas
Two formulas are needed for the same substance. The molecular formula gives the true count of atoms in one molecule. The empirical formula gives the smallest whole-number ratio of the counts. Glucose has molecular formula C6H12O6. Divide every count by the largest common factor, 6, and you get the empirical formula CH2O. Hydrogen peroxide is H2O2, with empirical formula HO.
Charge balance for ionic compounds
Salts are made of ions. A formula unit must have zero net charge. Write the cation with charge and the anion with charge . Use cations and anions, with the smallest whole numbers that work, so that . Dividing by any common factor gives the simplest formula. For magnesium, Mg, and chloride, Cl: here and , so one Mg is balanced by two Cl, each with charge . The formula is MgCl2, and the check is .
Worked examples
The formula is H2O.
- The symbol H has subscript 2, so there are 2 hydrogen atoms.
- The symbol O has no subscript, so there is 1 oxygen atom.
- Total atoms: .
- Check: water has three atoms per molecule, which matches the everyday picture of two small hydrogen atoms on one oxygen.
The formula is Al2(SO4)3, an aluminium salt used in water purification.
- Al has subscript 2, so there are 2 aluminium atoms.
- The group (SO4) is multiplied by 3, so there are 3 copies of it.
- Each (SO4) contains 1 sulfur and 4 oxygen atoms.
- Sulfur: atoms.
- Oxygen: atoms.
- Total atoms: .
- Check: the sum of counts matches the count of symbols inside the expanded formula.
Aluminium forms the ion Al. Oxide forms the ion O. Write the formula of the neutral compound.
- Put the two ions in a ratio that makes the total charge zero.
- Try 1 Al and 1 O: total charge . Not zero.
- Try 2 Al and 3 O: total charge . This works.
- The ratio is 2 Al to 3 O, so the formula is Al2O3.
- Check: aluminium oxide is the thin layer that protects aluminium from corroding, and the 2 to 3 ratio agrees with the charge rule.
Try it: write the formula for magnesium nitrate, made of Mg and the nitrate ion NO3. Then count the atoms of each element in one formula unit.
Answer: One Mg has charge , which needs two NO3 ions of charge each. So the formula is Mg(NO3)2. Counts: 1 Mg, 2 N, and O, for atoms in total.
Common mistakes and tradeoffs
Mistake 1: changing subscripts to balance an equation. It is tempting to think that the subscripts can be edited to make a reaction balance. Each atom count is fixed by the substance, so changing it changes the substance. In fact the subscripts define the substance. H2O2 is hydrogen peroxide, a different substance from H2O, because it has an extra oxygen. To balance a reaction you change the coefficient in front of the formula, not the subscript inside it.
Mistake 2: forgetting to multiply through parentheses. It is tempting to read Ca(OH)2 as one oxygen and one hydrogen. In fact the subscript 2 outside the parentheses doubles the group, giving two oxygens and two hydrogens, because the parentheses bind the group together.
Mistake 3: reading an ionic formula as a molecule. NaCl is not a molecule. It is a lattice of alternating ions, and the formula only gives the ratio of ions. Calling NaCl "one molecule" leads to wrong ideas about its bonding.
Mistake 4: assuming one formula means one structure. The formula C2H6O is ethanol, the alcohol in drinks, but it is also dimethyl ether, a gas with a different arrangement of atoms. The formula gives the inventory of atoms, not the arrangement, so two substances can share one formula. Drawing the structure needs more information than the formula.
When to use a formula. Use the molecular formula when you need the exact composition of a molecule, for example to compute its molar mass. Use the empirical formula when only the ratio of elements is measured, for example from a combustion analysis. Use a structural formula when the arrangement of atoms matters, for example to predict reactions.
When not to use it. A formula cannot tell you how atoms are joined or how a crystal is arranged. For those questions, chemists use structural diagrams and crystal structures instead of the plain formula.
History
By the early 1800s chemists knew that elements combine in fixed ratios, but they used many different symbols and disagreed about how many atoms a molecule held. John Dalton drew elements as circles, which was hard to write and print. Jöns Jacob Berzelius, around 1813, proposed the one- and two-letter symbols that we still use. That made formulas quick to write and compare, and his system caught on across Europe.
Disputes over atomic weights kept formulas uncertain for decades. Stanislao Cannizzaro's 1858 method for fixing atomic weights settled many of these, and after that the modern formulas became standard. The formulas we use today are the result of this long shift from pictures to short symbolic codes.
Recap
- A chemical formula lists the element symbols in a substance and their atom counts as subscripts.
- Parentheses multiply the group inside by the number after them.
- The molecular formula gives exact counts; the empirical formula gives the simplest whole-number ratio.
- For salts, the formula is the smallest ratio of ions that makes the total charge zero.
- Next, read Chemical Equation to see how formulas are arranged in a reaction, and Stoichiometry to count the amounts they imply.
Check yourself
QuestionHow many atoms of each element are in one formula unit of Ca(OH)2?Show answer
Calcium: 1. Oxygen: 2. Hydrogen: 2. The subscript 2 outside the parentheses doubles the one O and one H inside the group, and calcium has no subscript, so it counts as one.
QuestionHow many total atoms are in one molecule of glucose, C6H12O6?Show answer
The counts are 6 C, 12 H and 6 O. The total is atoms.
QuestionWhy is the empirical formula of glucose CH2O and not C6H12O6?Show answer
The empirical formula is the simplest whole-number ratio of the atoms. Dividing each count in C6H12O6 by the common factor 6 gives 1 C, 2 H and 1 O, so CH2O. The molecular formula C6H12O6 keeps the true count in one molecule.
QuestionWrite the formula of a neutral compound made from Mg and Cl, then explain why it is not MgCl.Show answer
The formula is MgCl2. One Mg has charge , and it takes two Cl ions with charge each to make the total zero. MgCl would have total charge , which is not neutral.
QuestionA student says that changing H2O to H2O2 is just balancing the equation. Why is this wrong, and what would change the reaction?Show answer
Changing the subscript changes the substance. H2O is water and H2O2 is hydrogen peroxide, a different compound with different properties. Balancing an equation is done by changing the coefficient in front of a formula, which counts whole molecules, not the subscripts inside them.