Not sure which lesson to do first? Find your level and get a plan →

Chemistry · Reaction Patterns · Grade 9-12

Formula Writing

Formula Writing is the systematic process of combining element symbols and subscripts so a compound's total positive charge from cations exactly balances its total negative charge from anions, leaving it electrically neutral.


Quick Answer

Formula Writing is the systematic process of combining element symbols and subscripts so a compound's total positive charge from cations exactly balances its total negative charge from anions, leaving it electrically neutral. You use it whenever a name or a pair of ions has to become a formula: write the cation and anion with their charges, choose the smallest numbers of each that make the total charge zero, and put a polyatomic ion in parentheses if you need more than one. Calcium (2+) and chloride (1−) give CaCl2; aluminium (3+) and sulfate (2−) give Al2(SO4)3.

Why This Matters

Every equation, molar mass and stoichiometry calculation starts from a correct formula, so one wrong subscript spoils everything after it. Write calcium hydroxide as CaOH2 instead of Ca(OH)2 and its molar mass comes out as 58 instead of 74 g/mol. Formula writing also predicts compounds you have never seen: magnesium forms Mg2+ and nitrogen forms N3−, so magnesium nitride must be Mg3N2.

Intuitive Explanation

Two kinds of road salt sit side by side in a hardware shop: sodium chloride, NaCl, and calcium chloride, CaCl2. Both are a metal ion with chloride ions, yet calcium chloride has two chlorides per metal ion. The reason is charge. Sodium forms Na+ and calcium forms Ca2+, while each chloride is Cl−. A crystal must be neutral overall, so one Na+ pairs with one Cl−, but one Ca2+ needs two: +2+2(−1)=0.

The general move is to find the lowest common multiple of the two charges. Aluminium (+3) and oxide (−2) meet at 6: two aluminiums give +6 and three oxides give −6, so the formula is Al2O3. The crisscross shortcut, swapping the charge numbers into subscripts, gives the same answer here, but it has to be reduced afterwards: Mg2+ and O2− crisscross to Mg2O2, which simplifies to MgO. Polyatomic ions such as nitrate, NO3−, act as single units; when you need more than one, put the whole ion in parentheses: Mg(NO3)2.

Compounds of two nonmetals do not follow the charge rule, because their atoms share electrons instead of forming ions. Carbon and oxygen make both CO and CO2, and nitrogen and oxygen make several compounds, so their formulas come from the prefixes in the name: dinitrogen tetroxide is N2O4. Those subscripts are never reduced, since NO2 is a different gas. If a metal or ammonium is involved, balance charges; if both elements are nonmetals, read the prefixes.

Think of it like this. Writing an ionic formula is like levelling a seesaw with +3 weights on one side and −2 weights on the other: it balances only with two of the first and three of the second, and you always use the fewest weights that work. Compounds of two nonmetals don't use the seesaw; their formulas come from their names.

Core idea. An ionic compound has no overall charge, so its formula uses the smallest whole numbers of cations and anions whose charges cancel, with polyatomic ions kept intact as units in parentheses.


When to Use

Use it when you are given a compound's name or its ions and need the formula: write the formula for iron(III) sulfate, or for the compound of Mg2+ and PO43−. Find each ion's charge, balance to zero with the smallest whole numbers, and put parentheses around repeated polyatomic ions. To go from a formula to a name, use Nomenclature. For two nonmetals, take the subscripts straight from the Greek prefixes instead of balancing charges.

Tip. Ask: Am I combining ions in the ratio that makes the total charge zero?

How to Recognize It

Before writing a formula, work out what kind of compound it is and which ions or atoms it contains.

  1. Is the compound made of a metal or ammonium together with a nonmetal or a polyatomic ion?

    Yes means an ionic formula: write each ion's charge and find the smallest numbers that cancel. Two nonmetals form a molecular compound whose name gives the subscripts directly.

  2. Does a polyatomic ion such as nitrate or sulfate need more than one copy?

    Yes means it goes in parentheses with the subscript outside, as in Ca(NO3)2. A single copy needs no parentheses.

  3. Are you given the compound's name rather than its ions?

    Then read the ions from the name first, using the Roman numeral for metals like iron. Turning a formula back into a name is Nomenclature.

  4. Are you asked how many units of the compound react, written in front of the formula?

    That number is a coefficient, set by Balancing Equations; formula writing only sets the subscripts inside one formula.

Formula Writing vs Nomenclature vs Balancing Equations vs Empirical Formula

Writing formulas, naming them, balancing equations and finding empirical formulas all handle the small numbers around formulas. Ask whether you are building one compound from its ions, and which numbers you are allowed to set.

Formula Writing

Meaning
Formula writing turns ions or a name into a compound's formula, choosing subscripts that make the charges cancel.
Key test
Builds one formula, with subscripts that come from the ion charges.
Formula
n(+m)+m(−n)=0
Example
Ammonium and phosphate ions, NH4+ and PO43−, combine as (NH4)3PO4.

Nomenclature

Meaning
Nomenclature is the set of rules for turning a formula into its systematic name, or a name back into a formula.
Key test
The answer is a name, such as copper(II) nitrate.
Example
Cu(NO3)2 is named copper(II) nitrate, with the numeral giving copper's charge.

Balancing Equations

Meaning
Balancing equations sets the coefficients in front of finished formulas so that atoms match on both sides.
Key test
Changes coefficients only, never subscripts.
Example
Na+Cl2→NaCl becomes 2Na+Cl2→2NaCl, with the formula NaCl left untouched.

Empirical Formula

Meaning
An empirical formula gives the simplest whole-number ratio of atoms in a compound, often worked out from measured masses.
Key test
Reduces a known composition rather than building from ion charges.
Example
Hydrogen peroxide, H2O2, has the empirical formula HO.

Formula & Notation

Worked Examples

Example 1 — Aluminium sulfate

Easy

Write the formula for aluminium sulfate.
Show the steps and the answer
  1. Write the ions: aluminium is Al3+ and sulfate is SO42−.

    Aluminium is in group 13 and always forms a 3+ ion; sulfate is a polyatomic ion with a 2− charge.

  2. Find the lowest common multiple of 3 and 2: it is 6.

    The total positive and total negative charge must both reach 6 to cancel.

  3. Use 2 aluminiums (+6) and 3 sulfates (−6), with parentheses around the sulfate: Al2(SO4)3.

    The subscript 3 must apply to the whole SO4 group, so it goes outside the parentheses.

  4. Check: 2(+3)+3(−2)=0; atoms are 2 Al, 3 S and 12 O.

    A neutral total confirms the formula.

Answer: Al2(SO4)3

Takeaway: Balance the charges with the lowest common multiple, and bracket a polyatomic ion that appears more than once.

Example 2 — Contrast: ionic or molecular?

Standard

Write the formulas for (a) magnesium oxide and (b) dinitrogen tetroxide.
Show the steps and the answer
  1. (a) Magnesium is a metal and oxygen a nonmetal, so balance ion charges: Mg2+ and O2−.

    A metal with a nonmetal forms an ionic compound, so charges decide the ratio.

  2. Crisscross gives Mg2O2; reduce to the smallest ratio: MgO.

    One +2 already cancels one −2, so a 1 : 1 ratio is enough.

  3. (b) Nitrogen and oxygen are both nonmetals, so read the prefixes: di- means 2 N, tetr- means 4 O, giving N2O4.

    Molecular compounds share electrons and have no ion charges to balance. That is how you can tell to use prefixes here.

  4. Do not reduce N2O4 to NO2.

    In a molecule the subscripts are the real atom counts; NO2 is nitrogen dioxide, a different substance.

Answer: (a) MgO; (b) N2O4

Takeaway: Reduce subscripts for ionic compounds; for molecular compounds copy the prefixes exactly.

Example 3 — Find the mistake: missing parentheses

Application

Ben is asked for the formula of calcium hydroxide and writes "CaOH2". Find the mistake and correct it.
Show the steps and the answer
  1. Write the ions: Ca2+ and hydroxide, OH−.

    Calcium's 2+ charge needs two hydroxide ions.

  2. Read Ben's formula literally: CaOH2 means 1 Ca, 1 O and 2 H.

    Without parentheses, the subscript 2 applies only to the H, so the formula has one oxygen instead of two.

  3. Correct it: two whole OH groups need parentheses: Ca(OH)2, which is 1 Ca, 2 O and 2 H.

    Charge check: +2+2(−1)=0.

  4. See the effect on molar mass: Ca(OH)2=40.08+2(16.00+1.008)=74.10 g/mol, against 58.10 g/mol for Ben's formula.

    Every later calculation with Ben's formula would be off by 16 g/mol.

Answer: Ca(OH)2

Takeaway: When a polyatomic ion appears more than once, wrap it in parentheses before adding the subscript.

Where You'll See It

  • Spelling words correctly so they mean the right thing

    Just as 'cat' and 'act' use the same letters but mean different things, CO (carbon monoxide, toxic) and CO2 (carbon dioxide) are different compounds, so the subscript must be exactly right.

  • Reading a fertilizer or supplement label

    A label listing calcium carbonate as CaCO3 or iron as FeSO4 relies on correct formula writing so you know exactly which compound and how much of each element you're getting.

  • Combining toy building blocks with charges

    Pairing Al3+ and O2− blocks is like finding the smallest whole-number set that balances: it takes two aluminums and three oxygens to cancel charges, giving Al2O3.

Common Mistakes

  1. The slip: You write the ion charges directly as the subscripts.

    Why it's tempting: Criss-crossing the charges down looks like it gives the subscripts, which works by luck sometimes.

    Instead: After criss-crossing, reduce to the lowest whole-number ratio; Mg2+ and O2− give MgO, not Mg2O2, and Al3+ with O2− gives Al2O3.

  2. The slip: When a polyatomic ion needs a subscript, just put the number on the last atom.

    Why it's tempting: It looks like a normal subscript on the formula, so CaOH2 seems fine.

    Instead: Wrap the whole polyatomic ion in parentheses before adding the subscript: calcium hydroxide is Ca(OH)2, meaning two complete OH− groups.

  3. The slip: Subscripts and coefficients mean the same thing.

    Why it's tempting: Both are numbers attached to formulas, so they blur together.

    Instead: A subscript counts atoms inside one formula unit (H2O has 2 H), while a coefficient multiplies the whole formula in an equation (2H2O means two water molecules).


Mini Practice

Try these on your own. Tap Reveal when you want to check.

  1. Write the formula of the compound formed by sodium ions, Na+, and sulfide ions, S2−.

    Hint: How many +1 charges cancel one −2 charge?

  2. Write the formula of aluminum oxide from Al3+ and O2−.

    Hint: Find the smallest total charge that both 3 and 2 divide into.

  3. Write the formula of iron(III) sulfate. Sulfate is SO42−.

    Hint: The Roman numeral gives iron's charge. Keep sulfate together in parentheses.

  4. Write the formula of ammonium phosphate from NH4+ and PO43−.

    Hint: Both ions are polyatomic. How many ammonium ions balance one phosphate?

  5. A question shows the formula CuCl2 and asks what the compound is called. Is that formula writing or nomenclature?

    Hint: Which direction is the task going: name to formula, or formula to name?

  6. A student writes calcium hydroxide as CaOH2. Find and fix the error.

    Hint: The 2 should apply to the whole hydroxide ion.

Want the full set?

50 practice questions for this concept — free to try, every one with a complete worked solution showing the why, not just the answer.

Frequently Asked Questions

Why is an ionic formula always reduced, but a molecular formula is not?

An ionic solid is a huge lattice of ions with no separate molecules, so its formula only states the ratio, and the smallest ratio is used: magnesium oxide is MgO\text{MgO}, not Mg2O2\text{Mg}_2\text{O}_2. A molecular compound is made of real molecules, so its formula counts the atoms in one of them. Hydrogen peroxide really is H2O2\text{H}_2\text{O}_2, and shrinking it to HO would describe a different particle.

Is there a rule for which element is written first?

Yes. In ionic compounds the cation goes first, so it is NaCl, never ClNa. For two nonmetals the less electronegative element usually comes first, which is why we write CO2\text{CO}_2 and SF6\text{SF}_6 with oxygen and fluorine last. Hydrogen breaks the pattern in some old, familiar formulas: ammonia is NH3\text{NH}_3 and methane is CH4\text{CH}_4, even though hydrogen is the less electronegative element in both.

How do I know a transition metal ion's charge when writing a formula?

The name tells you. Many transition metals form more than one ion, so their names include a Roman numeral: copper(I) is Cu+\text{Cu}^+ and copper(II) is Cu2+\text{Cu}^{2+}. Copper(I) oxide is therefore Cu2O\text{Cu}_2\text{O}, and copper(II) oxide is CuO\text{CuO}. A few transition metals have only one common ion, such as zinc, always Zn2+\text{Zn}^{2+}, and silver, always Ag+\text{Ag}^+, so their names carry no numeral.

Do the parentheses in a formula like Ca(OH)2 change how I count atoms?

Yes: the subscript outside multiplies everything inside. Ca(OH)2\text{Ca(OH)}_2 contains one calcium, two oxygen and two hydrogen atoms. In Al2(SO4)3\text{Al}_2(\text{SO}_4)_3, the 3 applies to the whole sulfate group, giving three sulfur and twelve oxygen atoms alongside the two aluminium atoms, seventeen atoms in all. For molar mass, multiply each atom inside the brackets by the outside subscript before adding.

Learning Path

← Before

IonChemical Bond
Formula Writing

You are here

You need Ion (how atoms gain or lose electrons to become charged) and Chemical Bond (ionic versus covalent) first. Formula writing adds the charge-balancing rule that turns any pair of ions into a neutral formula. Next, Nomenclature links formulas and names in both directions, and Chemical Equation uses correct formulas to describe and balance reactions.

See Also