What Is a Chemical Formula?
A chemical formula is a shorthand way of showing which elements are in a compound and how many atoms of each one are present. H2O tells you there are two hydrogen atoms and one oxygen atom. NaCl tells you there's one sodium and one chlorine.
The numbers written below and to the right of an element symbol are called subscripts. No subscript means there's just one atom of that element. A subscript of 2 means two atoms, and so on.
Chemical formulas don't tell you how the atoms are arranged, just what's there. For that, you'd need a structural formula, which is a different thing entirely.
The Three Main Formula Types You'll Encounter
Most chemistry homework involves three types:
- Molecular formulas show the actual number of atoms in one molecule of a substance. CO2 is a molecular formula. It tells you exactly what's in one molecule of carbon dioxide.
- Covalent compound formulas cover compounds formed when two nonmetals bond together by sharing electrons. CO2, H2O, and NH3 are all covalent.
- Ionic compound formulas cover compounds formed between a metal and a nonmetal (or a polyatomic ion). NaCl, CaCl2, and Mg5N2 are all ionic. These use a balancing rule called the crisscross method.
Your homework question will usually tell you which type you're working with, or you can figure it out by looking at what elements are involved.
How To Write Covalent Compound Formulas
Covalent compounds form when two nonmetals combine. Oxygen, nitrogen, carbon, hydrogen, and the halogens are all nonmetals.
Writing covalent formulas is fairly straightforward once you know the naming rules, because the name usually tells you exactly what's in the formula.
The prefixes to know:
Prefix | Meaning |
mono- | 1 |
di- | 2 |
tri- | 3 |
tetra- | 4 |
penta- | 5 |
Step 1: Read the compound name. Take "dinitrogen tetroxide." The name tells you there are 2 nitrogen atoms and 4 oxygen atoms. Step 2: Write the element symbols in the order they appear. N comes first, then O. Step 3: Add the subscripts from the prefixes. N2O4. That's it. The name does most of the work for you. |
Watch out for these exceptions:
- Mono- is dropped when it's the first element. "Carbon dioxide" has one carbon, not zero.
- Water (H2O) and ammonia (NH3) are common compounds with fixed formulas you should just memorize.
- Diatomic elements like hydrogen, oxygen, nitrogen, and the halogens always exist as pairs when they appear alone: H2, O2, N2, F2, Cl2, Br2, I2.
Common covalent compounds:
Name | Formula |
Water | H2O |
Carbon dioxide | CO2 |
Ammonia | NH3 |
Sulfur dioxide | SO2 |
Dinitrogen tetroxide | N2O4 |
How To Write Ionic Compound Formulas
Ionic compounds form between a metal (which gives up electrons and becomes a positively charged cation) and a nonmetal or polyatomic ion (which gains electrons and becomes a negatively charged anion).
| The key rule: the total positive charge must equal the total negative charge. The compound has to be electrically neutral. |
The fastest way to do this is the crisscross method.
The Crisscross Method (Step-by-Step)
Example: Calcium chloride
Step 1: Find the charge of each ion. Calcium (Ca) has a charge of +2. Chlorine as an ion (Cl-) has a charge of -1. If you're not sure of the charges, check your periodic table. Metals in Group 1 have +1 charges, Group 2 have +2, and so on. Common anion charges are on most reference sheets. Step 2: Write the symbols next to each other. Ca Cl Step 3: Crisscross the numbers. Take the number from the calcium charge (2) and make it the subscript for chlorine. Take the number from the chlorine charge (1) and make it the subscript for calcium. Ca1Cl2 Step 4: Drop any subscript of 1. CaCl2 Step 5: Check that it balances. Ca2+ gives +2. Two Cl- ions give -2. Total charge = 0. |
Solve Chemistry Problems Using Correct Formulas Get detailed assistance for applying chemical formulas in reactions and calculations Master chemical formulas and apply them correctly in every reaction.
More worked examples:
Magnesium nitride (Mg and N3-)
Sodium chloride (Na and Cl)
|
What To Do With Polyatomic Ions
Polyatomic ions are groups of atoms that carry a charge together, like nitrate (NO3-) or sulfate (SO4²-). The formula rules are the same, but you need to use parentheses when the subscript is more than 1.
Example: Calcium nitrate
|
Common polyatomic ions to know:
Ion | Formula | Charge |
Nitrate | NO3 | -1 |
Sulfate | SO4 | -2 |
Phosphate | PO4 | -3 |
Hydroxide | OH | -1 |
Ammonium | NH4 | +1 |
How To Write Molecular Formulas
A molecular formula shows the exact number of each atom in one molecule. You'll mostly encounter these when you're told the compound or given its structure, rather than needing to derive them from scratch.
The steps are simple:
Step 1: Identify every element in the molecule. Step 2: Count the atoms of each element. Step 3: Write the element symbols with their atom counts as subscripts. The convention for order is carbon first, hydrogen second, then all other elements in alphabetical order. So glucose is C6H12O6, not H12C6O6. |
If there's only one atom of an element, you don't write a subscript at all. CO2 not C1O2.
Also, visit our blog to know about how to balance chemical equations.
Quick Reference: Chemical Formula Rules
Situation | Rule | Example |
Covalent compound from name | Use prefixes as subscripts | di = 2, tri = 3 |
Ionic compound | Crisscross the charges | Ca2+ + Cl- = CaCl2 |
Subscript of 1 | Drop it (write nothing) | NaCl not Na1Cl1 |
Polyatomic ion with subscript >1 | Use parentheses | Ca(NO3)2 |
A diatomic element alone | Always pair it | O2, H2, N2 |
Common Mistakes Students Make
- Writing the charge instead of the subscript. The crisscross method uses the charge number as the subscript, not as the symbol. Ca2+Cl- is not a formula. CaCl2 is.
- Forgetting to reduce. If both subscripts share a common factor, reduce them. Mg2+ and O2- would give Mg2O2 by crisscross, but that reduces to MgO. Ionic formulas use the simplest whole-number ratio.
- Skipping parentheses for polyatomic ions. Ca(NO3)2 and CaNO32 are not the same thing. Always use parentheses when a polyatomic ion has a subscript greater than 1.
- Mixing up covalent and ionic rules. The crisscross method only applies to ionic compounds. Don't try to use it on CO2.
Once you know whether you're working with a covalent compound or an ionic one, the rest of the process follows from clear rules every time.
Practice the crisscross method with a few examples, and it'll start to feel automatic. If you're still working through a chemistry assignment and need more hands-on help, you're not stuck.
Learn about the difference between organic and inorganic chemistry in our new blog.
Master Chemical Formulas for Better Chemistry Grades Learn the concepts and techniques behind formulas with professional guidance Understanding chemical formulas makes chemistry simpler and more manageable.



