Guide
How to Write Chemical Formulas
For an ionic compound: write the cation first and the anion second, read each ion's charge off the periodic table, cross the charges down to become the other ion's subscript, then reduce to the simplest whole-number ratio. Al³⁺ and O²⁻ cross to Al₂O₃; Ca²⁺ and O²⁻ cross to Ca₂O₂, which reduces to CaO.
A chemical formula is a compact code that tells you exactly which elements are in a compound and in what ratio. Writing one correctly follows a small set of reliable rules rather than raw memorization, and once you can read charges off the periodic table, most everyday formulas fall out almost automatically. This guide focuses on ionic compounds, where formula writing is most systematic: what the numbers in a formula mean, how to find the charge on each ion, the crossing method in full, and the polyatomic ions that sometimes need parentheses.
What a formula actually tells you
A formula like H₂O lists the elements present and uses subscripts to give the ratio of their atoms - two hydrogen atoms for every one oxygen. When there is no subscript, the count is one, so the oxygen in water is understood as a single atom. The formula does not usually tell you the shape of the molecule or how it is bonded; it is a recipe of proportions.
For ionic compounds the formula gives the simplest whole-number ratio of ions that makes the compound electrically neutral. This is called a formula unit rather than a molecule, because ionic solids are continuous lattices, not discrete groups. The guiding principle behind every ionic formula is that the total positive charge must exactly cancel the total negative charge.
Finding the charge on each ion
To build an ionic formula you first need the charge on each ion, and the periodic table hands you most of these directly. Main-group metals form predictable positive ions, and many nonmetals form predictable negative ones. Memorizing a handful of column charges covers a large fraction of the compounds you will meet.
Transition metals are less predictable and can form more than one charge, which is why their names include a Roman numeral - iron(II) means Fe²⁺ and iron(III) means Fe³⁺. When a name gives you that numeral, it is telling you the charge to use.
- Group 1 (alkali metals) form +1 ions; Group 2 (alkaline earth metals) form +2 ions.
- Aluminum reliably forms a +3 ion.
- Group 17 (halogens) form −1 ions; Group 16 elements such as oxygen and sulfur form −2 ions.
- Group 15 elements such as nitrogen can form −3 ions.
- Transition metals vary - read the charge from the Roman numeral in the name.
The crossing method, step by step
The most dependable way to combine two ions is to let each ion's charge become the subscript of the other. This guarantees the charges balance, and a final tidy-up gives the simplest ratio. Work through the steps below for the compound of aluminum and oxygen.
- Write the cation first, then the anion, with each ion's charge: Al³⁺ and O²⁻.
- Cross the charges down to become subscripts: the 3 from aluminum goes to oxygen, the 2 from oxygen goes to aluminum, giving Al₂O₃.
- Check neutrality: two Al³⁺ give +6 and three O²⁻ give −6, which cancel - the formula is balanced.
- Reduce to the simplest whole-number ratio if the subscripts share a common factor. Al₂O₃ has no common factor, so it stays as is.
- Contrast with calcium oxide: crossing Ca²⁺ and O²⁻ gives Ca₂O₂, which reduces by two to the correct formula CaO.
Polyatomic ions and parentheses
Many ions are not single atoms but tight groups of atoms carrying an overall charge - for example nitrate (NO₃⁻), sulfate (SO₄²⁻), hydroxide (OH⁻), and ammonium (NH₄⁺). These behave as a single unit in a formula, and the crossing method still works; you just treat the whole group as one ion.
The one new rule is that when you need more than one of a polyatomic ion, you wrap it in parentheses before adding the subscript, so the subscript applies to the entire group. Combining calcium (Ca²⁺) with nitrate (NO₃⁻) gives Ca(NO₃)₂ - the parentheses show two complete nitrate units. Without them, Ca NO₃2 would wrongly suggest a change to the nitrate itself.
- Treat a polyatomic ion as one unit with a single overall charge.
- If you need two or more of that unit, enclose it in parentheses before the subscript: (NO₃)₂.
- If you need only one, no parentheses are required: NaNO₃.
Common mistakes to avoid
The most frequent error is forgetting to reduce the ratio, leaving something like Mg₂O₂ instead of MgO. Because both magnesium and oxygen carry a charge of two, the crossed subscripts cancel and the true formula is the simplest one-to-one unit. Always check whether your subscripts share a common factor.
A second common slip is changing a polyatomic ion's own subscripts instead of using parentheses, or dropping the parentheses when more than one unit is needed. Keep the polyatomic group intact and let the outside subscript do the multiplying. With these habits, the crossing method produces correct formulas consistently, and you can verify any result by confirming the positive and negative charges sum to zero.
It also helps to write the cation before the anion by convention, and to double-check any transition-metal charge against the Roman numeral in the compound's name before you cross. A minute spent confirming each ion's charge saves you from a formula that looks tidy but describes the wrong compound entirely.
A quick worked check
Put the whole process together with iron(III) sulfate. The Roman numeral tells you iron is Fe³⁺, and sulfate is the polyatomic ion SO₄²⁻. Crossing the charges sends the 3 onto sulfate and the 2 onto iron, giving Fe₂(SO₄)₃ - two iron ions and three sulfate groups, with the parentheses keeping each sulfate whole. Checking the charges, two Fe³⁺ give +6 and three SO₄²⁻ give −6, so the formula is neutral and already in its simplest ratio.
Frequently asked questions
What do the small numbers in a chemical formula mean?
They are subscripts giving the ratio of atoms. H₂O means two hydrogen atoms to one oxygen atom. An element with no subscript is counted as one.
How does the crossing method work?
Write the cation and anion with their charges, then use each ion's charge as the other ion's subscript. This balances the charges automatically. Finally reduce the subscripts to their simplest whole-number ratio.
When do I use parentheses in a formula?
Use parentheses around a polyatomic ion whenever you need more than one of it, so the subscript applies to the whole group. For example, calcium nitrate is Ca(NO₃)₂. A single polyatomic unit needs no parentheses.
Why is calcium oxide written CaO and not Ca₂O₂?
Calcium is +2 and oxygen is −2, so crossing the charges gives Ca₂O₂, but those subscripts share a factor of two. Reducing to the simplest ratio gives the correct formula, CaO.