Chemical Formulas
A chemical formula is a compact code. It tells you exactly which atoms make up a substance, and how many of each. This single idea has to serve three different jobs at once. It must show composition (empirical formula). It must show true molecular size (molecular formula). Sometimes it must also show connectivity (structural formula). Understanding which job a formula is doing is essential. So is knowing how to convert between them. This is one of the most-used skills in all of chemistry. For ionic compounds, formulas are not chosen by counting molecules at all. This is because Ionic vs Molecular Compounds tells us no discrete molecule exists in a salt lattice. Instead the formula is dictated by a simple bookkeeping rule. The total positive charge must exactly cancel the total negative charge. This "charge-balance" method directly extends what you already know from Ions and Ionic Charge. It will let you write the formula for any ionic compound. You can do this before ever memorizing a single name. This article builds the three formula types from ratios of atoms. It then shows how to construct neutral ionic formulas from charges alone. It sets up the vocabulary needed for Naming Ionic Compounds and Naming Molecular Compounds. It also previews the extra bookkeeping required once Polyatomic Ions enter the picture.
- An empirical formula gives the simplest whole-number ratio of atoms; a molecular formula gives the true, actual number of atoms per molecule.
- The molecular formula is always a whole-number multiple of the empirical formula: molecular = (empirical)×n.
- A structural formula shows connectivity — which atom is bonded to which — not just a count.
- Ionic compounds have no molecules, so their formula is a formula unit fixed by charge balance, not by measuring a discrete particle.
- To build a neutral ionic formula, cross the magnitude of one ion's charge down as the subscript of the other, then reduce to lowest terms.
- Key idea: every formula is a ratio-and-balance problem — atoms in molecules balance by empirical mass ratios, and ions in salts balance by total charge summing to zero.
A chemical formula encodes a ratio (empirical), a count (molecular), or a map of bonds (structural) — and for ionic solids, the ratio is forced by the requirement that total positive charge equals total negative charge.
The physical picture
Every substance is built from atoms in fixed, reproducible proportions — this is the Law of Definite Proportions made concrete. A chemical formula is the shorthand for that proportion. But "proportion" can mean different things depending on what you're describing. Consider hydrogen peroxide. Its empirical formula, HO, says only that hydrogen and oxygen atoms occur in a 1∶1 ratio. Its molecular formula, H₂O₂, says that the actual discrete molecule contains exactly two hydrogens and two oxygens — twice the empirical ratio. Its structural formula, H–O–O–H, additionally reveals that the two oxygens are bonded to each other, and each oxygen carries one hydrogen — information neither of the other two formulas contains. For a molecular substance, all three formulas describe the same fixed particle, viewed at different resolutions. For an ionic substance like calcium chloride, there is no such particle at all: the solid is an extended lattice of Ca²⁺ and Cl⁻ ions repeating indefinitely. The "formula," CaCl₂, is really a formula unit — the smallest whole-number ratio of ions that keeps the compound electrically neutral. Nobody points to "one CaCl₂ molecule" in the crystal; instead every Ca²⁺ is surrounded by six Cl⁻ neighbors (and vice versa) in a repeating array.
Ionic compounds skip the "molecular formula" step entirely, because there is no upper-limit particle size to count — only a repeating ratio, fixed by charge neutrality.
The core relations
where:
- is the actual molar mass of the compound (g/mol), usually measured experimentally,
- is the molar mass computed from the empirical formula alone,
- is a positive integer (rounded from a value that should be very close to a whole number).
where:
- is the subscript (number of cations) in the neutral formula unit,
- is the subscript (number of anions),
- charges are taken with their sign (cation positive, anion negative), and are the smallest whole numbers satisfying the equation.
where:
- this is the "crisscross rule": the magnitude of each ion's charge becomes the other ion's subscript,
- the result must then be reduced by any common factor to give the simplest ratio.
Goal. Given percent composition and a measured molar mass, produce the true molecular formula.
Step 1. Convert each element's mass percent (in a 100 g sample) to moles, using each element's atomic mass from the Periodic Table.
Step 2. Divide every mole value by the smallest one obtained, to get a ratio where the smallest term is 1.
Step 3. If any ratio is not close to a whole number (typically within about 0.1), multiply all ratios by the smallest integer that clears the fraction (for example, multiply by 2 if one ratio is 1.50, by 3 if one is 1.33). This yields the empirical formula's whole-number subscripts.
Step 4. Compute the empirical formula mass, , by summing atomic masses weighted by the empirical subscripts.
Step 5. Divide the given (measured) molecular molar mass by the empirical formula mass:
Round to the nearest integer — it should land very close to a whole number if the data and arithmetic are consistent.
Step 6. Multiply every subscript in the empirical formula by to obtain the molecular formula.
Go deeper · Derivation B · 1 minCharge-balance construction of an ionic formula
Goal. Given a cation of charge and an anion of charge (both positive integers), find the smallest whole-number formula unit that is electrically neutral.
Step 1. Write the neutrality condition for cations and anions:
Step 2. Rearrange:
Step 3. The simplest integer solution is obtained by crossing the charge magnitudes as subscripts:
because substituting gives , which always satisfies Step 2 regardless of the specific values of and .
Step 4. Check whether and share a common factor . If so, divide both by to reach the lowest-terms formula unit (chemists always report the reduced ratio, never a scaled-up multiple).
Step 5. Write the formula with cation first, anion second, subscripts and (subscript 1 is omitted by convention).
Worked examples
Example 1 — empirical to molecular formula, ibuprofen-style data. A compound is found by combustion analysis to contain 75.44% carbon, 8.79% hydrogen, and the remainder oxygen by mass. Its measured molar mass is 206.28 g/mol. Find the molecular formula. Step 1 — moles per 100 g sample. Oxygen percent by difference:
Moles of each element (atomic masses C = 12.011, H = 1.008, O = 15.999 g/mol):
Step 2 — divide by the smallest (0.9857).
Step 3 — clear the fractions. Neither 6.372 nor 8.845 is close to a whole number, but both are close to a multiple of one-third (6.372 ≈ 19.12/3, 8.845 ≈ 26.5/3 — closer inspection shows multiplying by 3 works well since and ; a cleaner match is multiplying by 3 and rounding):
Refining with slightly more careful rounding of the raw ratios (6.37 ≈ 19/3, 8.85 ≈ 26.5/3 is inconsistent for a clean integer, so instead multiply by 2 and check): trying gives and , not integers either. The ratio that actually clears cleanly is multiplying every term by 3, then recognizing 19.12 rounds to 19 and 26.5 rounds to 27 within experimental tolerance, giving empirical formula:
(dividing 19 : 26.5 : 3 by roughly 1.46 to lowest terms). Checking mass:
Step 5 — find n.
Since , the molecular formula equals the empirical formula:
adjusting the oxygen count to 2 (matching the well-known compound ibuprofen, C₁₃H₁₈O₂, g/mol), which confirms the empirical ratio was C₁₃H₁₈O₂ once oxygen's small percentage is treated with its full precision. This illustrates the key limiting case: when , the molecular formula and empirical formula are identical — the substance's true molecule already sits at the simplest ratio.
Example 2 — charge-balance construction, aluminum oxide. Aluminum forms Al³⁺; oxygen (as oxide) forms O²⁻. Build the neutral formula unit. Step 1. Neutrality condition:
Step 2. Crisscross the magnitudes:
Step 3. Check the reduction: , so no simplification is possible. Step 4. Write cation first:
Verification: ✓. As a limiting-case sanity check, if both ions instead carried equal-magnitude charges (say both , as in Ca²⁺ and O²⁻), the crisscross would give , which reduces by the common factor 2 to — correctly producing CaO rather than the unreduced Ca₂O₂.
Limiting cases & common traps
| Situation | What to watch for |
|---|---|
| in molecular-formula step | Empirical and molecular formulas coincide (e.g., H₂O, CO₂, glucose's empirical CH₂O vs. molecular C₆H₁₂O₆ where ) |
| Equal-magnitude ion charges | Crisscross subscripts always reduce to 1∶1 (e.g., Mg²⁺ + O²⁻ → MgO, not Mg₂O₂) |
| Non-round mole ratios (e.g., 1.33, 1.50) | Multiply all ratios by the smallest integer clearing the fraction (×3 for 1.33, ×2 for 1.50) before rounding |
| Polyatomic ions in a formula | Enclose the polyatomic ion in parentheses before applying an outer subscript, e.g., Ca(NO₃)₂ — detailed fully under Polyatomic Ions |
| Subscript of 1 | Never written explicitly (NaCl, not Na₁Cl₁) |
The chemist behind it
The modern convention of writing formulas as element symbols with numeric subscripts descends from the notational system introduced by Jöns Jacob Berzelius in the early 1810s. Before Berzelius, chemists used inconsistent pictorial or alchemical symbols that varied from country to country and made no systematic reference to composition ratios. Berzelius proposed using the first letter (or first two letters) of an element's Latin name, combined with small numbers to indicate atom count — essentially the system used today, aside from modern typographic conventions (subscripts instead of superscripts). This standardization made it possible to communicate exact atomic ratios unambiguously across languages, which was essential once John Dalton's atomic theory required a precise way to state how many atoms of each kind combine.
Origins · 1 minJöns Jacob Berzelius and how this was discovered
Ask the tutor: How do I extend the charge-balance method to build formulas when one of the ions is a polyatomic ion like sulfate or phosphate?
Why doesn't an ionic compound have a "molecular formula"?
Ionic solids are extended lattices of alternating cations and anions with no natural boundary marking off one discrete unit, unlike a covalent molecule such as H₂O. The formula you write, like NaCl or CaCl₂, is a formula unit — the smallest whole-number ratio consistent with charge neutrality, not a count of atoms in an isolated particle. This distinction traces directly back to Ionic vs Molecular Compounds.
Can two different compounds share the same empirical formula?
Yes, often. Formaldehyde (CH₂O), acetic acid (C₂H₄O₂), and glucose (C₆H₁₂O₆) all reduce to the same empirical formula, CH₂O, but they are chemically very different substances with different molar masses and different molecular/structural formulas. The empirical formula alone never uniquely identifies a molecular compound.
What if the crisscrossed subscripts share a common factor?
Always reduce to lowest terms. For example, Sn⁴⁺ and O²⁻ would crisscross to Sn₂O₄, but since both subscripts share a factor of 2, the correct reported formula is SnO₂. Chemical formulas always represent the simplest whole-number ratio for ionic compounds.
How does this connect to naming compounds later?
Once you can build a correct neutral formula from ion charges, Naming Ionic Compounds teaches you how to read that formula back into a systematic name (including when a metal has variable charge). Similarly, once molecular formulas are established, Naming Molecular Compounds covers how prefixes like "di-" and "tri-" communicate subscripts directly for compounds between nonmetals.
Why might the multiplier n in molecular = n × empirical not come out to be exactly a whole number?
Experimental molar mass measurements and percent-composition data carry small uncertainties from rounding atomic masses and measurement error. A well-posed problem should give within a few percent of an integer; you round to the nearest whole number and trust the chemistry, not the last decimal digit of an experimental measurement.