A molecular formula is a shorthand way of representing a molecule using element symbols and numeric subscripts. It tells you exactly which atoms are in a molecule and how many of each. For example, the molecular formula for acetic acid (the compound that gives vinegar its sharp taste) is C₂H₄O₂, meaning each molecule contains two carbon atoms, four hydrogen atoms, and two oxygen atoms.
How to Read a Molecular Formula
Every molecular formula uses one- or two-letter symbols from the periodic table to identify the elements present. A small subscript number after each symbol tells you how many atoms of that element appear in a single molecule. If there’s no subscript, it means there’s just one atom of that element. Water, H₂O, has two hydrogen atoms and one oxygen atom. Glucose, C₆H₁₂O₆, has six carbons, twelve hydrogens, and six oxygens.
There’s even a standard convention for the order elements are listed. Known as the Hill system, it places carbon first, hydrogen second, and then all remaining elements in alphabetical order. If a compound contains no carbon, every element is simply listed alphabetically. This ordering makes it easier to search chemical databases and compare formulas consistently.
Molecular Formula vs. Empirical Formula
An empirical formula gives only the simplest whole-number ratio of elements in a compound, not the actual count of atoms. Glucose has the molecular formula C₆H₁₂O₆, but its empirical formula is CH₂O, a 1:2:1 ratio of carbon to hydrogen to oxygen. Acetic acid (C₂H₄O₂) shares that same empirical formula, CH₂O, even though it’s a completely different substance. The molecular formula is more informative because it reflects the true composition of one molecule.
Sometimes the two formulas are identical. Water’s molecular formula, H₂O, is already in its simplest ratio. The same is true for carbon dioxide, CO₂. The distinction only matters when the actual molecule is a multiple of the simplest ratio.
What a Molecular Formula Doesn’t Tell You
A molecular formula shows what’s in a molecule but not how those atoms are connected. This creates a significant blind spot: different compounds can share the exact same molecular formula yet behave nothing alike. These compounds are called isomers.
Consider two molecules with the formula C₃H₈O. One arrangement gives you 1-propanol (a type of alcohol), and another gives you 2-propanol (rubbing alcohol). Despite having identical atom counts, the position of the oxygen-hydrogen group differs, which changes their physical and chemical properties. A more dramatic example: C₄H₁₀ can be either butane or isobutane, two gases with different boiling points and shapes. The molecular formula alone can’t distinguish between them.
To show how atoms are actually bonded, chemists use structural formulas, which draw out each bond between atoms, or condensed structural formulas, which group atoms along a chain. These formats sacrifice the simplicity of a molecular formula but reveal the architecture that determines how a substance actually behaves.
Ionic Compounds Use a Different System
Molecular formulas apply specifically to covalent (molecule-forming) compounds. Ionic compounds, like table salt (NaCl), don’t exist as individual molecules. Instead, they form repeating crystal lattices where positive and negative ions are arranged in a three-dimensional grid. Because there’s no single “molecule” to describe, chemists refer to the smallest representative unit as a formula unit rather than a molecular formula. The formula NaCl simply represents the 1:1 ratio of sodium to chlorine ions in the lattice. For most ionic compounds, the formula you see is already the empirical formula.
Elements With Molecular Formulas
Molecular formulas aren’t limited to compounds. Several elements naturally exist as molecules rather than individual atoms. Seven elements form diatomic molecules under normal conditions: hydrogen (H₂), nitrogen (N₂), oxygen (O₂), fluorine (F₂), chlorine (Cl₂), bromine (Br₂), and iodine (I₂). When you breathe in oxygen, you’re inhaling O₂ molecules, each made of two oxygen atoms bonded together. Some elements form even larger clusters. Ozone is O₃, and sulfur commonly exists as S₈, a ring of eight sulfur atoms.
How Molecular Formulas Are Determined
In practice, figuring out a compound’s molecular formula is a two-step process. First, you determine the empirical formula, typically through combustion analysis or other techniques that measure the percentage of each element in a sample. Second, you need the compound’s actual molar mass to figure out how the molecular formula relates to the empirical formula.
The math is straightforward. You divide the compound’s molar mass by the mass of the empirical formula, and the result is a whole number, often called “n.” Then you multiply every subscript in the empirical formula by n. If a compound has an empirical formula of CH₂O (molar mass of about 30) and the measured molar mass is 180, then n equals 6, giving a molecular formula of C₆H₁₂O₆, which is glucose.
Mass spectrometry is one of the most common tools for measuring molar mass. It works by ionizing molecules and measuring their mass-to-charge ratio, producing a spectrum that reveals the molecular weight with high precision. Once you have that weight, calculating the molecular formula from an empirical formula becomes simple arithmetic.
Common Examples at a Glance
- Water: H₂O (2 hydrogen, 1 oxygen)
- Carbon dioxide: CO₂ (1 carbon, 2 oxygen)
- Glucose: C₆H₁₂O₆ (6 carbon, 12 hydrogen, 6 oxygen)
- Hydrogen peroxide: H₂O₂ (2 hydrogen, 2 oxygen; empirical formula is HO)
- Ethanol: C₂H₆O (2 carbon, 6 hydrogen, 1 oxygen)
- Acetic acid: C₂H₄O₂ (2 carbon, 4 hydrogen, 2 oxygen)
Notice that hydrogen peroxide (H₂O₂) and water (H₂O) both contain only hydrogen and oxygen, but in different ratios. The molecular formula makes that difference immediately clear, which is why it remains one of the most fundamental tools in chemistry for identifying and communicating what a substance is made of.

